Rabu, 03 Agustus 2016

Android : Core building blocks

Android : Core building blocks - Hallo sahabat Computer Programmer Medical Coding, Pada Artikel yang anda baca kali ini dengan judul Android : Core building blocks, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan Artikel Android, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : Android : Core building blocks
link : Android : Core building blocks

Baca juga


Android : Core building blocks

An activity is a class that represents a single screen. It’s like a Frame in AWT. It is a part of Android core building blocks.


An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. If an application has more than one activity, then one of them should be marked as the activity that is presented when the application is launched.


An activity is implemented as a subclass of Activity class as follows:


public class MainActivity extends Activity {
}Intent



Intent is also a part of Android core building Blocks. Intent is used to invoke components. It is mainly used to :
  • Start the service
  • Launch an activity
  • Display a web page
  • Display list of contacts
  • Broadcast message
  • Dial a phone call etc.


For example, you may write the following code to view the webpage…


Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.x-yourwebsite.com"));
startActivity(intent);

Service
In Android core building blocks service is a background process that can run for a long time.


There are two types of services local and remote. Local service is accessed from within the application whereas remote service is accessed remotely from other applications running on the same device.


For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity.


A service is implemented as a subclass of Service class as follows:


public class MyService extends Service {
}View



A view is the UI element such as button, text field, label etc. Anything that you see is a view.Content Provider


Content Providers are used to share data between the applications.


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.


public class MyContentProvider extends ContentProvider {
}


Broadcast Receivers

Broadcast Receivers simply respond to broadcast messages from other applications or from the system.


For e.g., applications can also initiate broadcasts to let other applications know that some data has been downloaded to the device and is available for them to use, so this is broadcast receiver who will intercept this communication and will initiate appropriate action.


A broadcast receiver is implemented as a subclass of BroadcastReceiver class and each message is broadcasted as an Intent object.


public class MyReceiver extends BroadcastReceiver {
}

Fragment

Fragments are like parts of activity. An activity can display one or more fragments on the screen at the same time. Activity is part of Android core building blocks.


 AndroidManifest.xml


It contains information about activities, content providers, permissions etc. Android core building blocks contains AndroidManifest.xml & It is like the web.xml file in Java EE.


 Android Virtual Device (AVD)


It is used to test the android application without the need for mobile or tablet etc. It can be created in different configurations to emulate different types of real devices.


Demikianlah Artikel : Android : Core building blocks

Semoga artikel Android : Core building blocks ini, bisa memberi manfaat untuk anda semua dan jangan bosan untuk datang kembali mengunjungi blog ini. Baiklah, sampai jumpa di postingan artikel lainnya.

Artikel yang anda baca saat ini Android : Core building blocks dengan alamat link https://idkingcode.blogspot.com/2016/08/android-core-building-blocks.html

Artikel Terkait

Android : Core building blocks
4/ 5
Oleh

Berlangganan

Suka dengan artikel di atas? Silakan berlangganan gratis via email