Android/Intent

An Android Intent is a "description of an action to be performed".

Is a message passing system

Allow for late binding between components

broadcast data with and between applications

how to listen for changes in system state

can be defined explicitly or implicitly, and used to start Activities or Services

Broadcast Intents are used to publish systemwise data

Attributes
Intents use Primary and Secondary attributes

the primary attributes


 * "action"


 * "data"

secondary attributes are "category", "type", "component" and "extras"

Description
Intents can be used to trigger other applications to do something. generally this would involve opening up the Camera, or Contacts, or SMS application, in order to have that component perform some functionality that you require for your own application purposes. Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivity(i); this will cause the default Camera application to launch

Intents can be called Explicitly or Implicitly.

Explicitly providing the class to load
Explicit intents have specified a component via setComponent(ComponentName) or setClass(Context, Class) which provides the exact class to run Intent intent = new Intent(MyActivity.this, MyOtherActivity.class); startActivity(intent);

Implicitly requesting an Action be performed
In order for your application to use the Image that is returned by the camera app, you need to tell the Intent how to return the result like so; final static int CAMERA_RESULT = 0; startActivityForResult(i, CAMERA_RESULT);

Is this an over-ridden method??? @todo protected void onActivityResult(     int requestCode,       int resultCode,       Intent intent) {  super.onActivityResult(requestCode, resultCode, intent); if (resultCode == RESULT_OK) {      Get Bundle extras = intent.getExtras; Bitmap bmp = (Bitmap) extras.get("data"); imv = (ImageView) findViewById(R.id.ReturnedImageView); imv.setImageBitmap(bmp); }  }

broadcastActivity
Allows sending an Intent to any interested broadcast Receivers wfdw

fe

bindService
To communicate with an already running service