Thursday, 21 April 2016

Hello Friends,,,, till now we had acquire knowledge on whats the android? and its architecture all now i am going to detail about the Core Building Blocks of Android that means Fundamental Blocks of Android they are :
  • Activity
  • View
  • Intent
  • Services
  • Content Providers
  • Fragments
  • AndroidManifest.xml
  • AVD (Android Virtual Device)
Activity: An Activity is a Class that represents a single Screen
               An Activity is implemented as a subclass of an Activity. Here is the Syntax :
             
  Public class MainActivity extends Activity{
       }

View : Anything that you see on screen is View that is UI Elements such as Buttons, Label ,                             Text Fields etc..,

Intent : Intent is mainly used to invoke the Components. It is mainly used for

  • Start the Service
  • Launch an activity
  • Display a web page
  • Display a list of Contacts
  • Broadcast a message
  • Dial a phone call etc.., Here is the Syntax
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://www.acquireandroid.blogspot.in"));
startActivity(i);

Here i is the object creation for intent, this is the code to view the webpage which is mentioned in Uri.parse....

Services : Service is a background process that can run for Long Time
There are two types of services Local Service and Remote Service

  • Local Service is accessed from within the application
  • Remote Service is accessed remotely from other application running on the same device
Content Providers : Content Providers are used to share the data between application
A Content provider is implemented as a subclass of ContentProvider class and must implement a standard set of APIs that enable other applications to perform transactions... Here is the Syntax

Public class MyContentProvider extends ContentProvider
{
       public void onCreate()
          {
           }
}

Fragments : It is like a Parts of activity. An Activity can display one or more fragments on the screen at the same time. 

AndroidManifest.xml : It contains information about activities, content providers, permissions etc. It is like web.xml file in Java EE.

AVD (Android Virtual Device) : It is used to test the android application without the need for mobile or tablet etc. It can be created in different configuration to emulate different types of real devices.



In Future i will go through detailed about these Fundamental Blocks...that's all for today friends Happy learning... :-)

No comments:

Post a Comment