您的位置:首页 > 移动开发 > Android开发

精通Android3笔记--第一章

2011-11-24 08:43 387 查看
1、Dalvik VM获取生成的java类文件,将他们组成一个或多个Dalvik可执行文件(.dex),他重用多个类文件的重复信息,相比没有压缩的jar文件空间缩小一倍。Delvik还对垃圾收集进行了优化,而写其采用了一种不同的汇编代码生成方法。

2、FreeType库负责字体支持。

3、SQLite是一个独立的开源项目,没有绑定到Android,适用于SQLite的工具也同样适用于Android数据库。

4、大多数应用程序通过Dalvik VM访问SQLite等这些核心库。

5、模拟器不能模拟USB连接、照相机与视频采集、耳机、电池、蓝牙、WIFI、NFC和OpenGL ES2.0。

6、Android UI是新一代UI框架,他的UI是声明性的,具有独立的主题。

7、Android中的所有对话框都是异步的。

8、Android支持补间动画(Tweening)和逐帧动画。

9、Android中重要的包:

android.app: Implements the Application model for Android. Primary

classes include Application, representing the start and stop

semantics, as well as a number of activity-related classes, fragments,

controls, dialogs, alerts, and notifications.

android.bluetooth: Provides a number of classes to work with

Bluetooth functionality. The main classes include BluetoothAdapter,

BluetoothDevice, BluetoothSocket, BluetoothServerSocket, and

BluetoothClass. You can use BluetoothAdapter to control the locally

installed Bluetooth adapter. For example, you can enable it, disable it,

and start the discovery process. The BluetoothDevice represents the

remote Bluetooth device that you are connecting with. The two

Bluetooth sockets are used to establish communication between the

devices. A Bluetooth class represents the type of Bluetooth device you

are connecting to.

android.content: Implements the concepts of content providers.

Content providers abstract out data access from data stores. This

package also implements the central ideas around intents and Android

Uniform Resource Identifiers (URIs).

android.content.pm: Implements Package Manager-related classes. A

package manager knows about permissions, installed packages,

installed providers, installed services, installed components such as

activities, and installed applications.

android.content.res: Provides access to resource files both

structured and unstructured. The primary classes are AssetManager

(for unstructured resources) and Resources.

android.database: Implements the idea of an abstract database. The

primary interface is the Cursor interface.

android.database.sqlite: Implements the concepts from the

android.database package using SQLite as the physical database.

Primary classes are SQLiteCursor, SQLiteDatabase, SQLiteQuery,

SQLiteQueryBuilder, and SQLiteStatement. However, most of your

interaction is going to be with classes from the abstract

android.database package.

android.gesture: This package houses all the classes and interfaces

necessary to work with user-defined gestures. Primary classes are

Gesture, GestureLibrary, GestureOverlayView, GestureStore,

GestureStroke, GesturePoint. A Gesture is a collection of

GestureStrokes and GesturePoints. Gestures are collected in a

GestureLibrary. Gesture libraries are stored in a GestureStore.

Gestures are named so that they can be identified as actions.

android.graphics: Contains the classes Bitmap, Canvas, Camera, Color,

Matrix, Movie, Paint, Path, Rasterizer, Shader, SweepGradient, and

TypeFace.

android.graphics.drawable: Implements drawing protocols and

background images, and allows animation of drawable objects.

android.graphics.drawable.shapes: Implements shapes including

ArcShape, OvalShape, PathShape, RectShape, and RoundRectShape.

android.hardware: Implements the physical Camera-related classes.

The Camera represents the hardware camera, whereas

android.graphics.Camera represents a graphical concept that’s not

related to a physical camera at all.

android.location: Contains the classes Address, GeoCoder, Location,

LocationManager, and LocationProvider. The Address class represents

the simplified XAL (Extensible Address Language). GeoCoder allows

you to get a latitude/longitude coordinate given an address, and vice

versa. Location represents the latitude/longitude.

android.media: Contains the classes MediaPlayer, MediaRecorder,

Ringtone, AudioManager, and FaceDetector. MediaPlayer, which

supports streaming, is used to play audio and video. MediaRecorder is

used to record audio and video. The Ringtone class is used to play

short sound snippets that could serve as ringtones and notifications.

AudioManager is responsible for volume controls. You can use

FaceDetector to detect people’s faces in a bitmap.

android.net: Implements the basic socket-level network APIs. Primary

classes include Uri, ConnectivityManager, LocalSocket, and

LocalServerSocket. It is also worth noting here that Android supports

HTTPS at the browser level and also at the network level. Android also

supports JavaScript in its browser.

android.net.wifi: Manages WiFi connectivity. Primary classes include

WifiManager and WifiConfiguration. WifiManager is responsible for

listing the configured networks and the currently active WiFi network.

android.opengl: Contains utility classes surrounding OpenGL ES 1.0

and 2.0 operations. The primary classes of OpenGL ES are

implemented in a different set of packages borrowed from JSR 239.

These packages are javax.microedition.khronos.opengles,

javax.microedition.khronos.egl, and

javax.microedition.khronos.nio. These packages are thin wrappers

around the Khronos implementation of OpenGL ES in C and C++.

android.os: Represents the OS services accessible through the Java

programming language. Some important classes include

BatteryManager, Binder, FileObserver, Handler, Looper, and

PowerManager. Binder is a class that allows interprocess

communication. FileObserver keeps tabs on changes to files. You use

Handler classes to run tasks on the message thread, and Looper to run

a message thread.

android.preference: Allows applications the ability to have users

manage their preferences for that application in a uniform way. The

primary classes are PreferenceActivity, PreferenceScreen, and

various Preference-derived classes such as CheckBoxPreference and

SharedPreferences.

android.provider: Comprises a set of prebuilt content providers

adhering to the android.content.ContentProvider interface. The

content providers include Contacts, MediaStore, Browser, and

Settings. This set of interfaces and classes stores the metadata for

the underlying data structures.

android.sax: Contains an efficient set of Simple API for XML (SAX)

parsing utility classes. Primary classes include Element, RootElement,

and a number of ElementListener interfaces.

android.speech: Contains constants for use with speech recognition.

android.speech.tts: Provides support for converting text to speech.

The primary class is TextToSpeech. You will be able to take text and

ask an instance of this class to queue the text to be spoken. You have

access to a number of callbacks to monitor when the speech has

finished, for example. Android uses the Pico TTS (Text to Speech)

engine from SVOX.

android.telephony: Contains the classes CellLocation,

PhoneNumberUtils, and TelephonyManager. A TelephonyManager lets

you determine cell location, phone number, network operator name,

network type, phone type, and Subscriber Identity Module (SIM) serial

number.

android.telephony.gsm: Allows you to gather cell location based on

cell towers and also hosts classes responsible for SMS messaging.

This package is called GSM because Global System for Mobile

Communication is the technology that originally defined the SMS datamessaging

standard.

android.telephony.cdma: Provides support for CDMA telephony.

android.text: Contains text-processing classes.

android.text.method: Provides classes for entering text input for a

variety of controls.

android.text.style: Provides a number of styling mechanisms for a

span of text.

android.utils: Contains the classes Log, DebugUtils, TimeUtils, and

Xml.

android.view: Contains the classes Menu, View, ViewGroup, and a

series of listeners and callbacks.

android.view.animation: Provides support for tweening animation.

The main classes include Animation, a series of interpolators for

animation, and a set of specific animator classes that include

AlphaAnimation, ScaleAnimation, TranslationAnimation, and

RotationAnimation. Android 3.0 introduced the android.animation

package, which is similar, but more broad because it can work with

objects rather than just views.

android.view.inputmethod: Implements the input-method framework

architecture.

android.webkit: Contains classes representing the web browser. The

primary classes include WebView, CacheManager, and CookieManager.

android.widget: Contains all of the UI controls usually derived from

the View class. Primary widgets include Button, Checkbox,

Chronometer, AnalogClock, DatePicker, DigitalClock, EditText,

ListView, FrameLayout, GridView, ImageButton, MediaController,

ProgressBar, RadioButton, RadioGroup, RatingButton, Scroller,

ScrollView, Spinner, TabWidget, TextView, TimePicker, VideoView, and

ZoomButton.

com.google.android.maps: Contains the classes MapView,

MapController, and MapActivity, essentially classes required to work

with Google maps.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息