Jay McGavren's Journal

2008-09-26

Android 1.0 API impressions...

What they’re describing here might be applicable not just to mobile apps, but maybe applications in general. Could this become the basis of an OS for a set-top box, game console, or desktop?

An Activity is a unit of action a user can initiate. Though an Activity can be used as an application, it isn’t the same concept; an Activity could be accessed from the menu of another Activity, for example.

The lifecycle of an activity is:

onCreate()
onRestart()
Called here after an application is stopped, not during its initial startup.
onStart()
Activity is becoming visible to user.
onResume()
Activity can interact with user.
onPause()
System is about to switch to another activity.
onStop()
Activity is no longer visible to user. May be followed by onRestart() or onDestroy().
onDestroy()
During this method, if isFinishing() returns true, user requested finish. Otherwise, system did.

This model is cool because it requires that an app be ready to save its state for later reloading at any time. An app that follows this setup properly will be ready for the user to switch activities, to reflect changes to the global config, or for the phone’s battery to run low.

Notifications: I’m imagining this to be like Growl or Enso notifications. Hope I’m right, but I haven’t read far enough to know yet.

Background processes!!! The inability of third-party apps to do this is my number one complaint about the iPhone. I want a daemon that can initiate different processes when I walk into work, home, or school, and I think it simply isn’t possible on iPhone.

comments powered by Disqus