Building Blocks in Android are :
Example: Like if are using Music Player , all the song content which shows in list, it is GUI and it is shown on Activity/Fragment.
Services :
Broadcast Receiver :
This is also a java class but it extends from BroadCast Receiver .
Example : class ExampleBroadCast extends BroadCastReceiver {} .
BroadCast Receiver is used to listen the broadcast event generated by system or android app .
Activity :
Activity is just a class . A class which extends from Activity, for the purpose of GUI.
Example : class ExampleActivity extends Activity { }
It also saves as .java file .
Activity is used for interaction with GUI . Like if we have to show button , textview, list view in our android app then we have to present it on Activity .
We have to declare Activity in Manifest file .
<manifest ... > <application ... > <activity android:name=".ExampleActivity" /> ... </application ... > ...</manifest >
Example: Like if are using Music Player , all the song content which shows in list, it is GUI and it is shown on Activity/Fragment.
Music Owl Music Player |
Services :
It is used when we have to perform long running operation in background / or without blocking UI .
Like if we have to upload large file we cannot block ui for 1min or may be more so in that case we have to use Service .
Take another example of Music Player, if you download this app, then after playing song, you move back or close the activity, still the player play song, this is because of service.
If we want to execute any code, in background, then the solution is Service .
Take another example of Music Player, if you download this app, then after playing song, you move back or close the activity, still the player play song, this is because of service.
If we want to execute any code, in background, then the solution is Service .
It is also a java class . A class which extend from Service .
Example : class ExampleService extends Service.
We have to declare Service in Manifest file .
<manifest ... > <application ... > <service android:name=".ExampleService" /> ... </application ... > ...</manifest >
Broadcast Receiver :
This is also a java class but it extends from BroadCast Receiver .
Example : class ExampleBroadCast extends BroadCastReceiver {} .
BroadCast Receiver is used to listen the broadcast event generated by system or android app .
<manifest ... > <application ... > <receiver android:name=".ExampleBroadCast" /> ... </application ... > ...</manifest >
We have to define it in Android Menifest file with receiver tag .
Content Provider :
Content Provider is used to provide the content by using content resolver . Like if we have to get all contact from our app. We will use Content Provider .
Content provider provide data from one application to others on request, and these requests are handled by the methods of the ContentResolver class. The data may be stored the db or file .
Content Provider :
Content Provider is used to provide the content by using content resolver . Like if we have to get all contact from our app. We will use Content Provider .
Content provider provide data from one application to others on request, and these requests are handled by the methods of the ContentResolver class. The data may be stored the db or file .
Very interesting information that you have shared with us.i have personally thank you for sharing your ideas with us.
ReplyDeleteAndroid Training in Chennai
app development course in chennai
JAVA Training in Chennai
Python Training in Chennai
Big data training in chennai
Selenium Training in Chennai
Android Training in Chennai
Android Training in Tambaram
Really an awesome blog for the freshers. Thanks for posting the information.
ReplyDeleteAndroid Training in Delhi
Android Course in Delhi
I had completely gothrough your post and it is full of innovative information.thanks for sharing this.
ReplyDeleteAndroid Training Institute in Chennai | Android Training Institute in anna nagar | Android Training Institute in omr | Android Training Institute in porur | Android Training Institute in tambaram | Android Training Institute in velachery