Basics
Basics
Basics
An android component is simply a piece of code that has a well defined life cycle e.g.
Activity, Receiver, Service etc.
Activity
View
A view is the UI element such as button, label, text field etc. Anything that you see is a
view.
Intent
For example, you may write the following code to view the webpage.
Service
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.
Content Provider
Fragment
Fragments are like parts of activity. An activity can display one or more fragments on
the screen at the same time.
AndroidManifest.xml
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.
1. package first.javatpoint.com.welcome;
2.
3. import android.support.v7.app.AppCompatActivity; // The theory is that AppCompatActivity makes
it easier for you to develop apps that will behave consistently across many versions of Android, compared to inheriting from
4. import android.os.Bundle; // Bundle is a class in android which is used to pass data from one activity to another
activity within an android application. We can pass data using key and value pairs using bundles.
5.
6. public class MainActivity extends AppCompatActivity {
7. @Override
8. protected void onCreate(Bundle savedInstanceState) {
9. super.onCreate(savedInstanceState);
10. setContentView(R.layout.activity_main);
11. }
12. }