Posts

Showing posts from August, 2013

INTENT STRUCTURE

The primary pieces of information in an intent are: action -- The general action to be performed, such as ACTION_VIEW, ACTION_EDIT, ACTION_MAIN, etc. data -- The data to operate on, such as a person record in the contacts database, expressed as a Uri. Some examples of action/data pairs are: ACTION_VIEW content://contacts/people/1 -- Display information about the person whose identifier is "1". ACTION_DIAL content://contacts/people/1 -- Display the phone dialer with the person filled in. ACTION_VIEW tel:123 -- Display the phone dialer with the given number filled in. Note how the VIEW action does what what is considered the most reasonable thing for a particular URI. ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled in. ACTION_EDIT content://contacts/people/1 -- Edit information about the person whose identifier is "1". ACTION_VIEW content://contacts/people/ -- Display a list of people, which the user can browse through. This example...

INTENT IN ANDROID

INTENT IN ANDROID: An Intent is exactly what it describes. It's an "intention" to do an action. An Intent is basically a message to say you did or want something to happen. Depending on the intent, apps or the OS might be listening for it and will react accordingly. Think of it as a blast email to a bunch of friends, in which you tell your friend Ali to do something. The other folks will ignore the email, but Ali will react to it. To listen for an intent (like the phone ringing, or an SMS is received), you implement a broadcast receiver. If you want to fire off an intent to do something, like pop up the dialer, you fire off an intent saying you will.

ANDROID ARCHITECTURE