Android Java 框架基础[知识点汇总]

学习android的过程中,把整个框架的基础结构牢记很重要,特此摘录了一些这个框架的一些基础知识,在使用的过程中按照这个框架学习,事半功倍。

开发过程中参考JDK的文档和android的sdk文档可以清楚遇到的很多问题,遇到问题是现在这两个文档中一般都能找到原因(安装sdk的文档参考http://www.cnblogs.com/2018/archive/2011/02/17/1957356.html

分层结构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 abstraction 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 many 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


Android 2.3


9


Android 2.2


8


Android 2.1


7


Android 2.0.1


6


Android 2.0


5


Android 1.6


4


Android 1.5


3


Android 1.1


2


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 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 assistance 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 should 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 mechanism. All these pieces of information need to be tied together for an Android application to execute. The glue mechanism for this task of defining relationships is the AndroidManifest.xml file.

<service>Servicemight also include the <intent-filter>

<receiver>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

SDK的文档目录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 calls to the following protected methods:

voidonCreate(Bundle savedInstanceState)
void onStart()
void onRestart()
void onResume()
void onPause()
void onStop()
void onDestroy()

由Android SDK/NDK默认管理的目录和文件:


AndroidManifest.xml


软件的android关键配置文件

涉及安全、启动的Activty等


default.properties


API Level的设置等


proguard.cfg


代码混淆使用


界面资源和访问代码


res gen 两个字目录下的文件

res下有如下类别

 res/anim:用XML表示的基于帧的动画

 res/drawable:不同规格的图标、图片等,drawable-hdpidrawable-ldpidrawable-mdpi三个子目录

 res/layout:视图对象的XML表示

 res/values:strings, colors, styles, dimensions, arrays的XML表示

 res/xml:User-defined XML files that are compiled into a binary representation

 res/raw:Arbitrary and uncompiled files that can be added

gen res中加入的资源在gen中生成访问代码R.java


assets


数据等文件

android.content.res.AssetManager asset = Application.getAssets()这个类辅助访问


src


JAVA代码


NDK


Jniobj libs目录

Jni: 放C/C++代码

Obj/libs:是c/c++的编译obj文件和so库

在这些默认文件和目录的基础上可以加入自己的需要管理的目录或文件

时间: 2024-10-25 11:52:03

Android Java 框架基础[知识点汇总]的相关文章

Mysql基础知识点汇总_Mysql

1.什么是SQL语句 sql语言:结构化的查询语言.(Structured Query Language),是关系数据库管理系统的标准语言. 它是一种解释语言:写一句执行一句,不需要整体编译执行. 语法特点: 1.没有" ",字符串使用' '包含 2.没有逻辑相等,赋值和逻辑相等都是= 3.类型不再是最严格的.任何数据都可以包含在' '以内 4.没有bool值的概念,但是在视图中可以输入true/false 5.它也有关系运算符:> < >= <= = <

Java必备基础知识点(超全)

Java基础 1. 简述Java的基本历史 java起源于SUN公司的一个GREEN的项目,其原先目的是:为家用消费电子产品发送一个信息的分布式代码系统,通过发送信息控制电视机.冰箱等   2. 简单写出Java特点,写出5个以上,越多越好 简单的.面向对象的.分布式的.安全的.稳定的.与平台无关的.可解释的.多线的.动态的语言.   3. 什么是Java? JAVA:一种编程语言           一种开发环境           一种应用环境           一种部署环境   4. 请

Android JAVA 语言基础例子代码

Android的界面一般都是java开发的,因此对于c++,.net人员来说理解和编写有一个适应过程,最近参考了一下资料,把这些涉的一些java基础使用以例子代码的形式总结起来,记录了这个平台的熟悉过程. 文件目录(涉及了java的一些主要语法) AnnotDefine.java AnnotDemo.java             ClassDemo.java CodeResource_en_US.java    Collection.java demo.java               

android电话应用基础知识点

问题描述 package com.phone; import android.net.Uri;import android.os.Bundle;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.content.pm.PackageManager;import android.telephony.TelephonyManager;import

Java正则表达式易错知识点汇总_java

一.概述 正则表达式是Java处理字符串.文本的重要工具. Java对正则表达式的处理集中在以下两个类:java.util.regex.Matcher   模式类:用来表示一个编译过的正则表达式.java.util.regex.Pattern   匹配类:用模式匹配一个字符串所表达的抽象结果. (很遗憾,Java Doc并没有给出这两个类的职责概念.)  比如一个简单例子: import java.util.regex.Matcher; import java.util.regex.Patter

Android RIL的java框架

Android RIL的Java部分也被分为了两个模块,RIL模块与Phone模块.其中RIL模块负责进行请求以及相应的处理,它将直接与RIL的原声代码进行通信.而Phone模块则向应用程序开发者提供了一系列的电话功能接口. 1.RIL模块结构 在RIL.java中实现了几个类来进行与下层rild的通信. 它实现了如下几个类来完成操作:    RILRequest:代表一个命令请求    RIL.RILSender:负责AT指令的发送    RIL.RILReceiver:用于处理主动和普通上报

《Android的设计与实现:卷I》——第2章 框架基础JNI

第2章 框架基础JNI JNI(Java Native Interface,Java本地接口)是Java平台上定义的一套标准的本地编程接口.JNI允许Java代码与本地代码互操作,即Java代码可以调用本地代码,本地代码也可以调用Java代码.所谓本地代码指的是用其他编程语言(如C/C++)实现的.依赖于特定硬件和操作系统的代码.通过JNI调用本地代码,可以实现Java语言所不能实现的功能.在Android平台上,Dalvik虚拟机会实现JNI定义的接口. 2.1 JNI在Android系统中所

JAVA基础教程汇总

到这一篇博客为止,JAVA的基础部分已经介绍完了,这一篇为基础部分的汇总. JAVA介绍 JAVA概述 Java的特点 JDK/bin目录下的不同exe文件的用途 JAVA环境变量配置 第一个JAVA程序 第一个JAVA程序解析 JAVA语法基础 JAVA语法基础之标识符和关键字 JAVA语法基础之变量和基本数据类型 JAVA语法基础之运算符 JAVA语法基础之流程控制 JAVA语法基础之数组 JAVA面向对象 JAVA面向对象之对象和类 JAVA面向对象之构造方法 JAVA面向对象之方法 JA

Android数据库框架——ORMLite轻量级的对象关系映射(ORM)Java包

Android数据库框架--ORMLite轻量级的对象关系映射(ORM)Java包 事实上,我想写数据库的念头已经很久了,在之前写了一个答题系统的小项目那只是初步的带了一下数据库,数据库是比较强大的,不是我们三言两语就能解决的,我一直想抽个时间自己再过一遍Sqlite和JDBC的,但是,大家也知道,琐事比较多,我们来说一下数据库的框架吧,事实上市面上,我觉得还可以的数据库框架有两个,ORMLite和GreenDao,我以前做的运动类的应用上,就需要存储大量的运动数据,我们最开始是在本地写数据库的