Android programming Basics

Source: Internet
Author: User

Application Basics
Android applications are written in the Java programming language.
The android SDK tool compiles Android code, data, and resource files into an android package. This is a collection file with the name ending with .apk. The code in the same APK file is considered an application.
After an android application is installed on a device, each android application resides in its own security sandbox.
The Android operating system is a multi-user Linux system, and each application is equivalent to a user.
By default, the system assigns an independent Linux User ID to each application. the system grants a license to all the files of the application, so that only the user (actually a process) corresponding to the application can access the application.
Each process has its own Virtual Machine (VM), which ensures that one application code is isolated from other applications.
By default, each application has its own Linux Process after it runs.
The Android system implements the minimum permission principle. By default, each application only has the permission to access its own components (to ensure that it works properly ).
There are two ways for an application to share data with other applications:
1. Share the same Linux User ID with two applications;
2. the user authorizes the application (during installation)

Common android classes
1. Activity
Activity is an application part. It provides the visible part of the screen for user interaction.

Android applications can activate an activity of another application. In this regard, Android applications do not have a main entry function like Java or C.

The activities developed by developers are subclasses of Android. App. activity.
2. Intent
Data transmission between applications is similar to a submitted form.
3. Service
Invisible. It undertakes most of the data processing work.

The service runs in the background and performs a long-term operation or interacts with a remote process. It does not provide a user interface.
All services developed by developers are subclasses of Android. App. Service.
4. Content Provider
Provides data for applications.

In Android, data is stored in the file system, SQLite database, web, and other persistent storage locations. through content provider, other applications can query or even modify the data (pay attention to authorization ).
Content provider can also operate the private data of an application.
Content provider can be implemented from Android. content. contentprovider.

Activate Components
Activities, services, and broadcast receivers can all be activated by intent.
Activity activation can be performed by passing an intent object to startactiviy () or startactivityforresult ().
Service Activation can be bound to a service by passing an intent to startservice () or an intent to bindservice.

Development Environment:
1. SDK
2. Eclipse
2. ADT (Android development plug-in under eclipse)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.