Basic Android Java framework [knowledge point Summary]

Source: Internet
Author: User

In the process of learning Android, it is very important to keep the basic structure of the entire framework in mind. Here we extract some basic knowledge about this framework. In the process of using this framework, we will learn more with half the effort.

In the development process, refer to the JDK documentation and Android SDK documentation can clearly encounter a lot of problems, encountered problems is now these two documents can generally find the reason (install SDK Documentation Reference http://www.cnblogs.com/2018/archive/2011/02/17/1957356.html)

Layered Android Layers

ØProminent code librarieS, including:

-Browser technology from WebKit, the same Open Source engine powering Mac's Safari and the iPhone's mobile Safari browser. WebKit has become the de facto standard for most mobile platforms.

-Database support via SQLite, an easy-to-use SQL database.

-Advanced graphics support, including 2D, 3D, animation from scalable games language (SGL), and OpenGL ES.

-Audio and video media support from packetvideo 'sopencore, and Google's own stagefright media framework.

-Secure Sockets Layer (SSL) capabilities from the Apache project.

ØAn array of managers that provide service

-Activities and views-telephony

-Windows-Resources

-Location-Based Services

ØThe android Runtime, Which provides:

-Core Java packages for a nearly full-featured Java programming environment. Note that this isn' t a Java me environment.

-The Dalvik VM employs services of the Linux-based kernel to provide an environment to host Android applications.

ØA Linux Kernel

Provides a foundational hardware implements action layer, as well as core services such as process, memory, and filesystem management. the kernel is where hardware-specific drivers are implemented-capabilities such as Wi-Fi and Bluetooth are here. the android stack is designed to be flexible, with specified optional components that largely rely on the availability of specific hardware on a given device. these components include features such as touch screens, cameras, GPS receivers, and accelerometers.

API level

API level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.

Platform version

API level

For Android 2.3

9

For Android 2.2

8

For Android 2.1

7

Android 2.0.1

6

For Android 2.0

5

For Android 1.6

4

For Android 1.5

3

For Android 1.1

2

For Android 1.0

1

Intent intentfilters

Intents And intentfilters, Android's innovative navigation and triggering mechanisms.

An intent is a declaration of need. it's made up of a number of pieces of information that describe the desired action or service. we're re going to examine the requested action and, generically, the data that accompanies the requested action.

An intentfilter is a declaration of capability and interest in offering consistency to those in need. It can be generic or specific with respect to which intents it offers to service.

The action attribute of an intent is typically a verb, the data component of an intent is expressed in the form of a URI

The intentfilter defines the relationship between the intent and the application. intentfilters can be specific to the data portion of the intent, the action portion, or both. intentfilters also contain a field known as a category. the category helps classify the action.

Intentfilters are often defined in an application's androidmanifest. xml file with the <intent-filter> tag.

Activity

An application might have a UI, but it doesn't have to have one. If it has a UI, it'll have at least one activity.

Service

If an application is to have a long lifecycle, it's often best to put it into a service.

Broadcastreceiver

If an application wants to receive and respond to a global event, such as a ringing phone or an incoming text message, it must register as a broadcastreceiver.

Contentprovider

If an application manages data and needs to expose that data to other applications running in the android environment, you shoshould consider a contentprovider.

Androidmanifest. xml

A fundamental fact of Android development is that an android application contains at least one activity, service, broadcastreceiver, or contentprovider. some of these elements advertise the intents They're interested in processing via the intentfilter mechanic. all these pieces of information need to be tied together for an Android Application to execute. the glue mechanic for this task of defining relationships is the androidmanifest. XML file.

<Service> servicemight also include the <intent-filter>

<Cycler> broadcastreceivermight have an explicit <intent-filter> tag

<Uses-Permission>

<Application

Core Android packages

Java. Lang-core Java language classes

Java. io-input/output capabilities

Java.net-Network Connections

Java. Text-text-handling utilities

Java. Math-math and number-manipulation classes

Javax.net-network classes

Javax. Security-security-related classes

Javax. XML-dom-based XML classes

Org. Apache. *-http-related classes

Org. XML-sax-based XML classes

Android. app-Android Application Model access

Android. Bluetooth-android's bluetooth functionality

Android. Content-accessing and publishing data in Android

Android.net-contains the URI class, used for accessing content

Android. gesture-create, recognize, load, and save gestures

Android. Graphics-graphics primitives

Android. Location-location-based services (such as GPS)

Android. OpenGL-OpenGL classes

Android. OS-system-level access to the android Environment

Android. provider-contentprovider-related classes

Android. telephony-telephony capability access, including support for both Code Division Multiple Access (CDMA) and Global System for Mobile Communication (GSM) Devices

Android. Text-text Layout

Android. util-collection of utilities for logging and text manipulation, including XML

Android. View-UI elements

Android. WebKit-browser functionality

Android. widget-more UI elements

Application Fundamentals

File :///... /Android-SDK-Windows/docs/GUIDE/topics/fundamentals.html

Activity Lifecycle

As an activity transitions from state to state, it is notified of the change by callto the following protected methods:

Voidoncreate (bundle Savedinstancestate)
Void onstart ()
Void onrestart ()
Void onresume ()
Void onpause ()
Void onstop ()
Void ondestroy ()

Default directories and files managed by Android SDK/ndk:

Androidmanifest. xml

Key configuration files for Android software

Activty involving security and startup

Default. Properties

API level settings

proguard. CFG

Code mixed use

interface resources and access code

files in the res Gen directory

res has the following categories

Res/anim: frame-based animation in XML format

Res/drawable: for icons and images of different specifications, drawable-hdpidrawable-ldpidrawable-mdpi has three subdirectories

Res/layout: XML Representation of the view object

Res/values: XML Representation of strings, colors, styles, dimensions, and arrays

Res/xml: user-defined XML files that are compiled into a binary representation

Res/raw: arbitrary and uncompiled files that can be added

The resources added to gen res generate access code in Gen R. java

Assets

Data and other files

Android. content. res. assetmanager asset = application. getassets ()

SRC

Java code

Ndk

Jniobj libs directory

JNI: Put C/C ++ code

OBJ/libs: C/C ++ compiled OBJ file and so Library

You can add your own directories or files to be managed based on these default files and directories.

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.