Summary

In this hour, you've seen how different Android applications can be designed using three application components: Context, Activity, and Intent. Each Android application comprises one or more activities. Top-level application functionality is accessible through the application context. Each activity has a special function and (usually) its own layout, or user interface. An activity is launched when the Android system matches an intent object with the most appropriate application activity, based on the action and data information set in the intent. Intents can also be used to pass data from one activity to another.

In addition to learning the basics of how Android applications are put together, you've also learned how to take advantage of useful Android utility classes, such as application logging, which can help streamline Android application development and debugging.

Q. How do I design a responsive application that will not be shut down during low-memory conditions?

A. Applications can limit (but never completely eradicate) the risk of being shut down during low-memory situations by prudently managing activity state. This means using the appropriate activity callbacks and following the recommendations. Most importantly, applications should acquire resources only when necessary and release those resources as soon as possible.

Q. How should I design an input form for an Android application?

A. Mobile applications need to be ready to pause and resume at any time. Typical web form style—with various fields and Submit, Clear, and Cancel buttons—isn't very well suited to mobile development. Instead, consider committing data as it is entered. This will keep data housekeeping to a minimum as activity state changes, without frustrating users.

0 0

Post a comment