The Android Application Framework

Broadcast receivers are communication components that receive messages that aresent between the Android operating system and other application components, or
between Android application components themselves.

Broadcast receivers can also use the Android NotificationManager class to alert theuser via built-in phone notification methods.

Broadcast receivers are created by extending the Android BroadcastReceiver class.


To create your own content provider, you extend the ContentProvider base class, whichimplements a standard set of methods that are used to store and retrieve data.
Applications access the methods defined by your ContentProvider class with aContentResolver object, which is used to talk to any content provider.

A content provider is activated when it receives a request for data from a contentresolver. The other three components—activities, services, and broadcast receivers—
are activated via asynchronous messages called intents.


For activitiesand services, an Intent object provides an action to be taken, the data that the actionneeds to operate on.

(1)An activity is started up,bypassing an Intent object to the Context.startActivity() method. or if it’s already started, given a new task, .The Activity class can look at the contents of the Intent object viathe getIntent() method, and at subsequent intent objects via theonNewIntent() method.

(2)An Android service component is started by passing an Intent objectto the Context.startService() method, which then calls the serviceclass onStart() method, and passes it the Intent object that containsthe actions for the service to perform and the data on which toperform them.

(3)If the service is already running and the Intent object contains newinstructions, then the intent is passed to the Context.bindService()method in order to establish an open connection between the callingcomponent and the service that is being used. This always open, realtimeconnection between code modules is commonly called binding inprogramming.

(4)An Android broadcast receiver component is started by passing anIntent object to the Context.sendBroadcast() method, or optionally tothe Context.sendOrderedBroadcast() method orContext.sendStickyBroadcast() method. The Intent object in thiscase contains the message action to be taken and the data (themessage) on which that action needs to be taken.


Interactivity

Event listeners, which execute the proper code in response to an eventthat is triggered when a UI element is used by the user.

Intents

Intents are asynchronous messages that travel between Android’s activities, services, and broadcast receivercomponents.

Understanding Java SE and the Dalvik VirtualMachine

The runtime translates the Javaand XML code that you write into a language that the operating system and the deviceunderstand.

The DVM is an optimization mechanism and technology that allows application code and resources to be highly optimized for use in mobile and embedded environments

When you launch an Android application, it creates a process that allocates memory and CPU processing resources (processor time slices) to the application, so that it has the resources needed to function. Each time an application is launched and a process is spawned, an instance or copy of the DVM is launched into your Android smartphone’s memory. The DVM actually takes the Java language instructions and application's design guidelines in an XML format, along with any external resources (images, audio files, and so on), and translates them into optimized low-level binary code that goes into the smartphone’s memory and eventually into the processor for processing.

Android smartphones are tiny Linux computers.

XML

high-density dots per inch (hdpi).

Launching Your Application: The AndroidManifest.xml File

the AndroidManifest.xml data definitions are used by Android to set up areas of system memory for application components that need to be supported. They also are used to define secure access permissions for the more sensitive areas of Android.

interface

the public interface is a label that tells the application what this class can do, without the application needing to test its capabilities.

Bundle

Bundle, which allows us to create bundles of variables for convenience and organization.

Bundle object, which is a collection of all of the states for your activity screen UI elements. It exists so that the screen UI elements can be restored if the screen is replaced by navigation to other screens during the use of your application.

View Class and ViewGroups class

Views have the ability to receive events.

ViewGroups are layout containers, usually collections of UI elements.

LinearLayout class, which has been subclassed from the ViewGroup class, which is subclassed from the View class, which is subclassed from the Object class.

Views use padding values and ViewGroups use margin values.

RelativeLayout:

android:layout_below="@id/label"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:layout_toLeftOf="@id/ok"
android:layout_alignTop="@id/ok"



更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. This android SDk requires Android deve
  2. 浅谈Android下拉菜单Spinner
  3. Error:(15) No resource identifier foun
  4. android执行外部程序,类似DELPHI里的EXEC
  5. android 读取,写入图片到sd卡源码
  6. Android(安卓)自动更新之状态栏下载
  7. android -------- Android(安卓)Studio 4
  8. Android实现对HOME键的捕获和屏蔽
  9. Android调用系统应用程序
  10. How to import sample Android projects