Monday, April 18, 2011

Plan SL

I think i write whenever i feel i have something new going on in my life which is not frequent. And of course travelling is sth i Like most. Yesterday i was just facebooking and got a call from Tarun for going SL for the long weekend (Good Friday). As usual once again the Baniya inside me told me that i should not go (its costly tour) but the travel sickness asked me to say Yes and we decided to go. From long time i have not been to any place on my own (company tours bahut se lage hai). So this is another chance to spend some good time. 
After two or three hours in evening(mid nite) i again got a call from him for the passport and other formal detail and it was given.
Once again the trip is planned and I am going to SL this weekend.

Friday, April 15, 2011

ANDROID: Activity as a web page

Mobile apps creation are somewhat similar to web apps. The major difference is memory available. But here I am going to discuss more on similarity. Lets start with the basic:

Activity as a web page:

Activity is like a web page on the web application. Each activity is a web page. Whenever u launch the application, one main activity gets displayed and which can start other activities. In this case the previous activity is stopped, and similar to web app where a browser keeps the previous page which u can go back by pressing back button. Here the operating system preserves the prev acitivity in a "stack".

 

So whenever a new activity starts it goes into stack and when u press back button it will be taken out and destroyed and will not be saved unlike browsers which have Next button.

 

When the activity is stopped it received the callback methods informing abt its state and the action taken by OS for the activity.

 

IMP: Whenever an activity is stopped, it should release the resources (eg. Db and network connections). The activity can again acquire the resources and actions when it get resumes.

 

So basically every app starts with coding of main activity which is a class which extends the activity class and defines its callback methods (onCreate, onPause etc.) which will be similar to your home page.

 

For more technical details about creating, stopping, invoking another activity, and different states of the acitivity, please refer to the link: http://developer.android.com/guide/topics/fundamentals/activities.html