by
Tuesday, December 30, 2014
0
comments
Android interview for experience
Android QA
Android Tutorial
Android Application Architecture:
Android Application Architecture
has following components such as
Services, Intent, Resources
Externalization, Notification signaling users, Content providers
Dalvik Virtual Machine
Activities
An activity represents a single screen with user interface.
public void MyActivity extends Activity{
}
Service is like an Activity but has no interface. It is component that runs in background for long running process eg: music player
Types:
- Unbound Services
- It runs in the background indefinitely, even if the activity which started this service ends.
- Bound Services
- It runs till lifespan of the activity which started this service. Client-Server interface.
public void MyService extends Service{
}
<service android:name=”.MyService”/>
Intent
Describing specific action.
Types:
- Implicit Intent
- It redirect from Activity in application to external application activity.
Uri uri = Uri.parse(“http://www.google.com”);
Intent i = new Intent(Intent.ACTION_VIEW,uri);
startActivity(i);
- It redirect from Activity to another Activity in application.
Intent i = new Intent(this,SecondActivity.class);
startActivity(i);
BroadcastReceiver
It simply respond to broadcast messages from other applications or from the system.
public class MyReceiver extends BroadcastReceiver{ public void onReceive(Context context,Intent intent){} }
Content Providers
A content provider component supplies data from one application to others on request.
0 comments:
Post a Comment