A GUI tool will appear that will show devices on left hand side and running packages on right hand side. TO see how the View hierarchy looks like select Device first. then what package you are interested in and finally Load View Hierarchy button. It might take 3- 5 seconds to appear.
As the name says, its a complete tool for ondevice debugging. It provides access to device data.
- let it be accessing different databases on device those are created by different applications. Imp for accessing data/data directory on Device your device has to be dev rooted.
e.g. for accessing databases on android, One need to go to data
From command line
> adb shell
you are in a android shell.
> cd data/data
>cd application.package.name
cd databases
then use sqlite3 utility for opening xxx.db
e.g. > sqlite3 xxx.db
SQLite version 3.5.9
Enter “.help” for instructions
If you want to see tables in the xxx.db
sqlite> .tables;
2. In Android, Loc based services are provided by the
– LocationManager class in android.location package.
Your device can obtain periodic updates of the device’s geographical locations.Android application fires intent when it enters the proximity of a certain location.
3. Connect to android console to give commands to androids host (e.g. Emulator or device)…
tools>telnet
telnet> 0 localhost 5554
(this will connect to the currently active device….)
There are many courses from all streams that could be of our potential interest.
I have interest in computer science and Alternative energy resources. And I found my world here. .. so don’t take time just go ahead and look for your horizon.
I want to say enjoy your android walk through with these android notes …
Know How / Android Platform ..
Dalvik virtual machine
Android use DVM (Dalvik Virtual Machine.) Following are some points on DVM and android relation….
1. byte code vm similar to JVM
2. .dex byte code files -> java class files got converted into .dex files.
3. In Every process run in it’s own Dalvik VM runtime.
4. Mobstr cpus are register based so dalvik cuts over head
.dex allows proicesses to share system classes saves memory
5. Integrating and Extending the existing components …
Integrating existing components –>
Fire Intent and pick one of the already available set of library which we need for
example –> Gmail wants photo and it integrate picasa lib for picking photos …
6. Android has flushed issue tracker
http://code.google.com/p/android
Group for discussion ….
http://code.google.com/groups.html
7. Bluetooth API –> Is part of the Android API..
Introduction to SDK
Concepts …. Application building blocks , There are Four building blocks of every android application. Every android application can have one of these or all of these in it.
1. Activity –> UI Components …
2. Intent Receivers –> Pices of code responds to notifications or status changes
3. Services –> dont have UI and runs in backgrounds ..
4. Content Provider –> Provide Handel to Deal with Data.
Some More Detail on these Building blocks
1/ Activity –>
1/ Can be faceless
2/ can be in a floating window
3/ Can return a value.
4/ Can be embedded.
Views - Used for building android screens…
1. TextView EditText, Button, Image View
CheckBox, Lists
2. Every activity has a tree of views
1. view can be in xml
2. view can be instantiated from code.
3. support xml based styles and themes.
Layouts
1. FrameLayout
2. Linear layout
3. RelativeLayout
4. TableLayout
5. AbsoluteLayout view given specific layout
2/ Intents and Intents Filers
Intents description what you want to do.
- Moving from one screen to another screen (we can declare intents what will do following task…)
- Caller calles startActivity(myintent),
- System picks Activity whose IntentFilter best matches myIntent.
- New Activity is informed of the Intent. Intent Receivers
- Respond to alarms and notifications
- Will wake up your process if necessary
- System can broadcast intents : data
connections, phone state changes, etc.
- Intent receivers can start Services for lengthy tasks(e.g downloading new data).
- IntentReceivers in AndroiidManifest.xml
- Can also attach Intent Receivers to other objects so they can receive notifications( Activities , Views etc.)
3/ Services
- Faceless classes that run in the background.
- Music player , network download, etc.
- Services run in your applications process or their own process.
- your code can bind to Services in your process or another process.
- Once bound, you communicates with Services using a remotable interface defined in IDL.
4/ Content Providers
- enabling data sharing across Applications .
- Query data (Returns Cursor)
- delete , Update , and insert rows.
- Hide underlaying implementation
- Work across processes.
- All content is rep by URI’s
- Convenience methods mean clients dont’ need to know syntax
Application Life Cycle …
- Applications run in their own processes.
- Processes are started and stopped as needed to run an app components Process.
Life cycle Methods …
onCreate() –> we can check revive all the states when we get back to here ….
onPause() –> we would like to pause and save all of our states ….
onStop() –> we like to close services or other system resources that we have acquired.
- There is a limit for amt of computations in onCreate() or lifeCycle Methods So be careful while using them and decide what to put what not to put …..
Other API’s in Android
1. 2D Graphics ….
We can build custon graphics components ….
2. Location Manager
- Applicationa can refister for notifications of current locations
- Can register for app specific Intents to be fired based on proximity.
- We can register with location manager for particular loc so that we can get to know the location
- Track files … lugia@mit.edu (Anh Nguyen) xml file containing lat long, or google earth file …
- Map view , MapActivity,
3. Media Support …
- Play back and record media files
- Audio , Pictures and video
- Codec’s still being decided (mp4, wma etc ….)
- Access through intents
Stream from a URL
Set MIME type to help decide action
- Also class level API
Embed playback
Recording.
- Streaming through RTP
4. XMPP Service –> we can use GTalk service ….
logged-in to Gtalk -> we can send messages to friends …
The BlackBerry® Plug-in for Microsoft® Visual Studio® allows Microsoft® based developer to develop wirelessly enable applications for BlackBerry® smartphones. Download the Plug-in.
Key benefits for developers include:
Familiar development experience — Plugs into an existing Microsoft Visual Studio 2005 development environment, providing a familiar experience for .NET developers to create rich client applications for the BlackBerry platform.
Seamless wireless connectivity — Leverages the inherent security and managed wireless connectivity of the BlackBerry® Enterprise Solution, allowing developers to seamlessly connect to back-end enterprise systems using .NET Web Services.
Simplified BlackBerry development — Provides a framework of re-useable BlackBerry application components that simplifies user interface design, data management and wireless connectivity of rich-client applications.
Enterprise-class security and manageability — Applications developed using the BlackBerry Plug-in for Microsoft Visual Studio will leverage the same secure, push-based technology and scalable architecture of BlackBerry® Enterprise Server. IT departments also benefit from simplified management and centralized control of their wireless deployments.
For downloading the plug-in developer needs to have plackberry developer community UID and password. For registration onto blackberry Developer community click.
This example explains how we can use File handling API JSR 75 on J2me Handheld.I have used SonyEricsson Handset to test the Code. The following code does very simple job, It save the image in the File system of the phone. _________________________________________________________________________
3.J2ME LWL view can easily differentiate logs on the bases of Logging levels.
4.J2me LWL can ignore logs on the bases of logging levels.
5.J2me LWL can be easily switched off or switched on.
Logging API
Logging Levels Interface
Logging levels is nothing but a log differentiating parameters.
*INFO: General Information kind of log.
*SEVERE: ERROR or Exception LOG.
*WARNING: WARNINGS App Developer can use only when there is a problem which can
e.g. for using levels LoggerLevels.INFO
Logging Class
1.Static Method for setting J2ME LWL configuration , this method canbe called anytime before calling logging function, configureLog method has four parameters as follows,
LOG_INFO_BOOL_PARAM àBoolean parameter for configuring informative logs.
LOG_SEVERE_PARAM àBoolean parameter for configuring SEVERE kind of problems for e.g. Exceptions and ERRORS.
LOG_WARNING_PARAMàBoolean parameter for configuring a warning kind of logs.
NO_OF_LOG_ENTRIES àFor configuring upper limit of log.
LOGGING_ON_SYS_OUT à for logging on system output.public static void configureLog(boolean LOG_INFO_BOOL_PARAM ,booleanLOG_SEVERE_PARAM ,boolean LOG_WARNING_PARAM, int NO_OF_LOG_ENTRIES)
e.g. of calling the method
LogUtil.configureLog(true,true,true,10);
2.j2me LWL Method for logging, This method has three parameters they are as follows,
a.logEntryà String value of Log.
b.logTypeà Logging level accepts integer constants values given in LoggerLevels interface. e.g. LoggerLevels.INFO
c.clearà for keeping one log at a time.
public static void log (String logentry, int logType, boolean clear);e.g. LogUtil.log(“FirstLogEntry”,LoggerLevel.INFO,false);3.J2me LWL method for closing the record store the data base of LWL. This method has no parameters. This should be called for closing the database.Public static void freeLoggerUtils ();LogUtil.freeLoggerUtils();
Log Viewing Utility
This utility can be used for viewing logs , to use the logging utility application has to do following tasks, The tasks are as follows.
1.While building an application integrate J2meLWL.jar in lib directory.
2.Once application is build put an entry in .jad file of application i.e.