Tuesday, May 15, 2012

Basic Building blocks Activities Services Broadcast Receivers and Content providers

Basic Building blocks
Android application is written in java program.But android phone tabs cant be execute the java file directly.Android os supporting devices like phone and Tabs contain  Dalvik Virtual machine.


Android program is mainly run on the Dalvik environment that is DALVIK VIRTUAL MACHINE.Dalvik Virtual Machine is  register based virtual machine,designed and written by Dan Borstin with the contribution of Google engineers.Features DVM is mainly optimized for low memory requirements and It designed to multiple VM instance to run at once,It also support for process isolation and Memmory management and Threading support.




Application Components


  • Activities
  • Services
  • Content providers
  • Broadcast receivers

       Activities
Activity represent a single screen with a user interface.Each of the screen are independent to each other.
To extend the features of the Activity we have to extend the class as follows:-


                 class Activity1 extends Activity implements OnClickListener
.Services

service also a componet that run in the Background to perform long running action.musuc player is the one of the example for Services.Service need to declard  in the androidmanifest.xml as follows:-


<service android:name="yourclasss"> </service>


and also mention the running services as  android:process=":process_description" attribute.

        Content providers


Content provider which manages a shared set of application of data.Shared pref reference and bundle mainly handle the Content provider services.
        Broadcast receivers
Broadcast component that respond to system wide broadcast announcent-for example during the low battery time we cant take the snap using camera function this is because the camera application get the system status through the Broadcast receiver

No comments :

Post a Comment