Tuesday, December 7, 2010

Work With Android

How Android applications work :

When the user runs an application, Android starts it and brings it to the foreground. From that application, the user might invoke another application, or another screen in the same application, and then another and another. All these programs and screens are recorded on the application stack by the system’s Activity Manager. At any time, the user can press the Back button to return to the previous screen on the stack. Each user interface screen is represented by an Activity class . Each activity has its own life cycle.
In Android, an application can be “alive” even if its process has been killed , ie. the activity life cycle is not tied to the process life cycle. Processes are just disposable containers for activities
Lets take a close look

During lifetime, each activity of an Android program can be in one of several states as shown

We override these these methods in our Activity class, and Android will call them at the appropriate time

    • onCreate(Bundle): This is called when the activity first starts up.

    • onStart( ): This indicates the activity is about to be displayed to the user

    • onResume( ): This is called when your activity can start interacting with the user. This is a good place to start animations and music.

    • onPause( ): This runs when the activity is about to go into the background, usually because another activity has been launched in front of it. This is where we should save our program’s persistent
      state, such as a database record being edited.

    • onStop( ): This is called when our activity is no longer visible to the user and it won’t be needed for a while. If memory is tight, onStop( ) may never be called (the system may simply terminate our process)

    • onRestart( ): If this method is called, it indicates our activity is being redisplayed to the user from a stopped state.

    • onDestroy( ): This is called right before our activity is destroyed. If memory is tight, onDestroy( ) may never be called (the system may simply terminate your process).

    • onSaveInstanceState(Bundle): Android will call this method to allow the activity to save per-instance state, such as a cursor position within a text field. Usually we won’t need to override it because the default implementation saves the state for all our user interface controls automatically.

    • onRestoreInstanceState(Bundle): This is called when the activity is being reinitialized from a state previously saved by the onSave-InstanceState( ) method. The default implementation restores the state of our user interface.

Tuesday, November 30, 2010

How To SetUp Android Development Environment

There are many ways to develop for Android and because of all the options it is sometimes a little daunting getting your environment setup. I found myself bouncing from web page to web page, not really sure if I had the right tools and if they were setup correctly. I wanted to document the process that worked for me.

Environment / Tools

  • Windows OS

  • Eclipse IDE for Java Developers (v3.5 Galileo)

  • JDK Update 22

  • Android SDK Tools, Revision 4

Step 1 Install Eclipse IDE

    • Download Galileo v3.5 from here Eclipse Galileo v3.5

    • This is a zip file and does not require installation. Just copy the eclipse folder into your programs directory

Step 2 : Install Java Platform (JDK 6 Update 22)

    • Download the installation file from Sun from here http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Select Your Platform

  • Now run the JDK installation. Install to default directory. Complete the installation.

Step 3 : Download the Android SDK Tools, Revision 4

  • This does not require installation. Just unzip and copy the files. You can install the package anywhere but remember where you put as you will need to reference it in Eclipse. I Extract it inside my eclipse folder. (C:\"program files"\eclipse)

World Of Android

As we all know todays world is a technology world ... With fast growing technology we hav to cope up with dat. One of Todays mobile Tech Jargons are smartphones which are now one of our basic need.
A simple smartphone contains Advanced Operating Systems + (Virtually) Infinite extensibility through applications: Symbian, Android, Windows Mobile, iOS – do these names ring a bell? These are mobile phone operating systems. Apple had over 200,000 apps in its store, while Android had over 50,000 apps in its Android Marketplace. so what it means , an ‘operating system platform open to developers’.
So think excellent email, calendar, organizer integration; think powerful apps presented in a simple, intuitive way – yup, that’s a smartphone . And as a Developer We r the one to build them.

A simple Question that comes in our Mind .
Q. What an ANDROID Is ? And how to develop own Applications ?
Ans : A fully integrated mobile “software stack” that consists of an operating system, middleware, user-friendly interface and a large collection of applications.
Google Inc., Intel, T-Mobile, Sprint, HTC, Qualcomm, Motorola and others have collaborated on the development of Android through the Open Handset Alliance, a multinational alliance of technology and mobile industry leaders.

Now a days ANDROID is a basic need of smartphones and a great opportunities to developers.
So a simple question HOW TO WORK WITH ANDROID ?
Well its not a hectic task to develop android applications . We just need to establish an android environment ,a little knowledge of JAVA , some creatve skills and bingooo everythings goes on.
To setup an android development Environment see my next post.

Total Pageviews