安卓 英文 外文文献翻译 Android API级别
物联网工程中英文对照外文翻译文献

中英文对照外文翻译(文档含英文原文和中文翻译)Android: A Programmer’s Guide1 What Is Android1.1 Key Skills & Concepts● History of embedded device programming● Explanation of Open Handset Alliance● First look at the Android home screenIt can be said that, for a while, traditional desktop application developers have been spoiled. This is not to say that traditional desktop application development is easier than other forms of develop ment. However, as traditional desktop application developers, we have had the ability to create alm ost any kind of application we can imagine. I am including myself in this grouping because I got my start in desktop programming.One aspect that has made desktop programming more accessible is that we have had the ability to interact with the desktop operating system, and thus interact with any underlying hardware, pretty1freely (or at least with minimal exceptions). This kind of freedom to program independently, how ever, has never really been available to the small group of programmers who dared to venture int o the murky waters of cell phone development.NOTE :I refer to two different kinds of developers in this discussion: traditional desktop applicati on developers, who work in almost any language and whose end product, applications, are built to run on any “desktop” operating system; and Android developers, J ava developers who develop for the Android platform. This is not for the purposes of saying one is by any means better or wors e than the other. Rather, the distinction is made for purposes of comparing the development styles and tools of desktop operating system environments to the mobile operating system environment1.2 Brief History of Embedded Device ProgrammingFor a long time, cell phone developers comprised a small sect of a slightly larger group of developers known as embedded device developers. Seen as a less “glamorous” sibling to desktop—and later web—development, embedded device development typically got the proverbial short end of the stick as far as hardware and operating system features, because embedded device manufacturers were notoriously stingy on feature support.Embedded device manufacturers typically needed to guard their hardware secrets closely, so they gave embedded device developers few libraries to call when trying to interact with a specific device. Embedded devices differ fro m desktops in that an embedded device is typically a “computer on a chip.” For example, consider your standard television remote control; it is not really seen as an overwhelming achievement of technological complexity. When any button is pressed, a chip interprets the signal in a way that has been programmed into the device. This allows the device to know what to expect from the input device (key pad), and how to respond to those commands (for example, turn on the television). This is a simple form of embedded device programming. However, believe it or not, simple devices such as these are definitely related to the roots of early cell phone devices and development.Most embedded devices ran (and in some cases still run) proprietary operating systems. The reason for choosing to create a proprietary operating system rather than use any consumer system was really a product of necessity. Simple devices did not need very robust and optimized operating systems.As a product of device evolution, many of the more complex embedded devices, such as early PDAs, household security systems, and GPSs, moved to somewhat standardized operating system platforms about five years ago. Small-footprint operating systems such as Linux, or even an embedded version of Microsoft Windows, have become more prevalent on many embedded devices. Around this time in device evolution, cell phones branched from other embedded devices onto their own path. This branching is evident whenyou examine their architecture.Nearly since their inception, cell phones have been fringe devices insofar as they run on proprietary software—software that is owned and controlled by the manufacturer, and is almost always considered to be a “closed” system. The practice of manufacturers using proprietary operating systems began more out of necessity than any other reason. That is, cell phone manufacturers typically used hardware that was completely developed in-house, or at least hardware that was specifically developed for the purposes of running cell phone equipment. As a result, there were no openly available, off-the-shelf software packages or solutions that would reliably interact with their hardware. Since the manufacturers also wanted to guard very closely their hardware trade secrets, some of which could be revealed by allowing access to the software level of the device, the common practice was, and in most cases still is, to use completely proprietary and closed software to run their devices. The downside to this is that anyone who wanted to develop applications for cell phones needed to have intimate knowledge of the proprietary environment within which it was to run. The solution was to purchase expensive development tools directly from the manufacturer. This isolated many of the “homebrew” develo pers.NOTE:A growing culture of homebrew developers has embraced cell phone application development. The term “homebrew” refers to the fact that these developers typically do not work for a cell phone development company and generally produce small, one-off products on their own time.Another, more compelling “necessity” that kept cell phone development out of the hands of theeveryday developer was the hardware manufacturers’ solution to the “memory versus need” dilemma. Until recently, cell phones did little more than execute and receive phone calls, track your contacts, and possiblysend and receive short text messages; not really the “Swiss army knives” of technology they are today.Even as late as 2002, cell phones with cameras were not commonly found in the hands of consumers.By 1997, small applications such as calculators and games (Tetris, for example) crept their way ontocell phones, but the overwhelming function was still that of a phone dialer itself. Cell phones had not yetbecome the multiuse, multifunction personal tools they are today. No one yet saw the need for Internetbrowsing, MP3 playing, or any of the multitudes of functions we are accustomed to using today. It ispossible that the cell phone manufacturers of 1997 did not fully perceive the need consumers would havefor an all-in-one device. However, even if the need was present, a lack of device memory and storagecapacity was an even bigger obstacle to overcome. More people may have wanted their devices to be all-in-one tools, but manufacturers still had to climb the memory hurdle.To put the problem simply, it takes memory to store and run applications on any device, cell phones included. Cell phones, as a device, until recently did not have the amount of memory available to them thatwould facilitate the inclusion of “extra” programs. Within the last two years, the price of memory hasreached very low levels. Device manufacturers now have the ability to include more memory at lowerprices. Many cell phones now have more standard memory than the average PC had in the mid-1990s. So,now that we have the need, and the memory, we can all jump in and develop cool applications for cellphones around the world, right? Not exactly.Device manufacturers still closely guard the operating systems that run on their devices. While a fewhave opened up to the point where they will allow some Java-based applications to run within a smallenvironment on the phone, many do not allow this. Even the systems that do allow some Java apps to rundo not allow the kind of access to the “core” system that standard desktop developers are accustomed to having.1.3 Open Handset Alliance and AndroidThis barrier to application development began to crumble in November of 2007 when Google, under theOpen Handset Alliance, released Android. The Open Handset Alliance is a group of hardware and softwaredevelopers, including Google, NTT DoCoMo, Sprint Nextel, and HTC, whose goal is to create a more opencell phone environment. The first product to be released under the alliance is the mobile device operatingsystem, Android.With the release of Android, Google made available a host of development tools and tutorials to aid would-be developers onto the new system. Help files, the platform software development kit (SDK), and even a developers’ community can be found at Google’s Android website, This site should be your starting point, and I highly encourage you to visit the site.NOTE :Google, in promoting the new Android operating system, even went as far as to create a $10million contest looking for new and exciting Android applications.While cell phones running Linux, Windows, and even PalmOS are easy to find, as of this writing, nohardware platforms have been announced for Android to run on. HTC, LG Electronics, Motorola, andSamsung are members of the Open Handset Alliance, under which Android has been released, so we canonly hope that they have plans for a few Android-based devices in the near future. With its release inNovember 2007, the system itself is still in a software-only beta. This is good news for developers because it gives us a rare advance look at a future system and a chance to begin developing applications that willrun as soon as the hardware is released.NOTE:This strategy clearly gives the Open Handset Alliance a big advantage over other cell phone operating system developers, because there could be an uncountable number of applications available immediately for the first devices released to run Android.Introduction to AndroidAndroid, as a system, is a Java-based operating system that runs on the Linux 2.6 kernel. The system is very lightweight and full featured. Android applications are developed using Java and can be ported rather easily to the new platform. If you have not yet downloaded Java or are unsure about which version you need, I detail the installation of the development environment in Chapter 2. Other features of Android include an accelerated 3-D graphics engine (based on hardware support), database support powered by SQLite, and an integrated web browser.If you are familiar with Java programming or are an OOP developer of any sort, you are likely used to programmatic user interface (UI) development—that is, UI placement which is handled directly within the program code. Android, while recognizing and allowing for programmatic UI development, also supports the newer, XML-based UI layout. XML UI layout is a fairly new concept to the average desktop developer. I will cover both the XML UI layout and the programmatic UI development in the supporting chapters of this book.One of the more exciting and compelling features of Android is that, because of its architecture, third-partyapplications—including those that are “home grown”—are executed with the same system priority as those that are bundled with the core system. This is a major departure from most systems, which give embeddedsystem apps a greater execution priority than the thread priority available to apps created by third-partydevelopers. Also, each application is executed within its own thread using a very lightweight virtualmachine.Aside from the very generous SDK and the well-formed libraries that are available to us to develop with,the most exciting feature for Android developers is that we now have access to anything the operatingsystem has access to. In other words, if you want to create an application that dials the phone, you haveaccess to the phone’s dialer; if you want to create an application that utilizes the phone’s internal GPS (ifequipped), you have access to it. The potential for developers to create dynamic and intriguing applicationsis now wide open.On top of all the features that are available from the Android side of the equation, Google has thrown insome very tantalizing features of its own. Developers of Android applications will be able to tie their applications into existing Google offerings such as Google Maps and the omnipresent Google Search.Suppose you want to write an application that pulls up a Google map of where an incoming call isemanating from, or you want to be able to store common search results with your contacts; the doors ofpossibility have been flung wide open with Android.Chapter 2 begins your journey to Android development. You will learn the how’s and why’s of usingspecific development environments or integrated development environments (IDE), and you will downloadand install the Java IDE Eclipse.2 Application: Hello World2.1 Key Skills & Concepts● Creating new Android projects● Working with Views● Using a TextView● Modifying the main.xml file● Running applications on the Android EmulatorIn this chapter, you will be creating your first Android Activity. This chapter examines theapplication-building process from start to finish. I will show you how to create an Android project inEclipse, add code to the initial files, and run the finished application in the Android Emulator. The resultingapplication will be a fully functioning program running in an Android environment.Actually, as you move through this chapter, you will be creating more than one Android Activity.Computer programming tradition dictates that your first application be the typical Hello World! application,so in the first section you will create a standard Hello World! application with just a blank background andthe “Hello World!” text. Then, for the sake of enabling you to get to know the language better, the next section explains in detail the files automatically created by Android for your Hello World! application. You will create two iterations of this Activity, each using different techniques for displaying information to the screen. You will also create two different versions of a Hello World! application that will display an image that delivers the “Hello World!” message. This will give you a good introduction to the controls and inner workings of Android.NOTE:You will often see “application” and “Activity” used interchangeably. The difference between the two is that an application can be composed of multiple Activities, but one application must have at leastone Activity. Each “window” or screen of your application is a separate Activity. Therefore, if you create a fairly simple application with only one screen of data (like the Hello World! application in this chapter),that will be one Activity. In future chapters you will create applications with multiple Activities.To make sure that you get a good overall look at programming in Android, in Chapter 6 you will createboth of these applications in the Android SDK command-line environment for Microsoft Windows andLinux. In other words, this chapter covers the creation process in Eclipse, and Chapter 6 covers the creationprocess using the command-line tools. Therefore, before continuing, you should check that your Eclipseenvironment is correctly configured. Review the steps in Chapter 3 for setting the PATH statement for theAndroid SDK. You should also ensure that the JRE is correctly in your PATH statement.TIP:If you have configuration-related issues while attempting to work with any of the command-lineexamples, try referring to the configuration steps in Chapters 2 and 3; and look at the Android SDK documentation.2.2 Creating Your First Android Project in EclipseTo start your first Android project, open Eclipse. When you open Eclipse for the first time, it opens toan empty development environment (see Figure 5-1), which is where you want to begin. Your first task isto set up and name the workspace for your application. Choose File | New | Android Project, which willlaunch the New Android Project wizard.CAUTION Do not select Java Project from the New menu. While Android applications are written in Java, and you are doing all of your development in Java projects, this option will create a standard Java application. Selecting Android Project enables you to create Android-specific applications.If you do not see the option for Android Project, this indicates that the Android plugin for Eclipse was not fully or correctly installed. Review the procedure in Chapter 3 for installing the Android plugin for Eclipse to correct this.2.3 The New Android Project wizard creates two things for youA shell application that ties into the Android SDK, using the android.jar file, and ties the project intothe Android Emulator. This allows you to code using all of the Android libraries and packages, and alsolets you debug your applications in the proper environment.Your first shell files for the new project. These shell files contain some of the vital application blocksupon which you will be building your programs. In much the same way as creating a Microsoft .NETapplication in Visual Studio generates some Windows-created program code in your files, using the Android Project wizard in Eclipse generates your initial program files and some Android-created code. Inaddition, the New Android Project wizard contains a few options, shown next, that you must set to initiate your Android project. For the Project Name field, for purposes of this example, use the titleHelloWorldText. This name sufficiently distinguishes this Hello World! project from the others that youwill be creating in this chapter.In the Contents area, keep the default selections: the Create New Project inWorkspace radio button should be selected and the Use Default Location check box should be checked.This will allow Eclipse to create your project in your default workspace directory. The advantage ofkeeping the default options is that your projects are kept in a central location, which makes ordering,managing, and finding these projects quite easy. For example, if you are working in a Unix-basedenvironment, this path points to your $HOME directory.If you are working in a Microsoft Windows environment, the workspace path will beC:/Users/<username>/workspace, as shown in the previous illustration. However, for any number of reasons, you may want to uncheck the Use Default Location check box and select a different location for your project. One reason you may want to specify a different location here is simply if you want to choose a location for this specific project that is separate from other Android projects. For example, you may want to keep the projects that you create in this book in a different location from projects that you create in the future on your own. If so, simply override the Location option to specify your own custom location directory for this project.3 Application FundamentalsAndroid applications are written in the Java programming language. The compiled Java code — along with any data and resource files required by the application — is bundled by the aapt tool into an Androidpackage, an archive file marked by an .apk suffix. This file is the vehicle for distributing the application and installing it on mobile devices; it's the file users download to their devices. All the code in a single .apk file is considered to be one application.In many ways, each Android application lives in its own world:1. By default, every application runs in its own Linux process. Android starts the process when any of the application's code needs to be executed, and shuts down the process when it's no longer needed and system resources are required by other applications.2. Each process has its own virtual machine (VM), so application code runs in isolation from the code of all other applications.3. By default, each application is assigned a unique Linux user ID. Permissions are set so that the application's files are visible only to that user and only to the application itself — although there are ways to export them to other applications as well.It's possible to arrange for two applications to share the same user ID, in which case they will be able to see each other's files. To conserve system resources, applications with the same ID can also arrange to run in the same Linux process, sharing the same VM.3.1 Application ComponentsA central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Application have four types of components:(1)ActivitiesAn activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the Activity base class.An application might consist of just one activity or, like the text messaging application just mentioned, it may contain several. What the activities are, and how many there are depends, of course, on the application and its design. Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched. Moving from one activity to another is accomplished by having the current activity start the next one.Each activity is given a default window to draw in. Typically, the window fills the screen, but it might be smaller than the screen and float on top of other windows. An activity can also make use of additional windows —— for example, a pop-up dialog that calls for a user response in the midst of the activity, or a windowswindow that presents users with vital information when they select a particular item on-screen.The visual content of the window is provided by a hierarchy of views — objects derived from the base View class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views (those at the bottom of the hierarchy) draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity's interaction with the user takes place.For example, a view might display a small image and initiate an action when the user taps that image. Android has a number of ready-made views that you can use — including buttons, text fields, scroll bars, menu items, check boxes, and more.A view hierarchy is placed within an activity's window by the Activity.setContentView() method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.)(2)ServicesA service doesn't have a visual user interface, but rather runs in the background for an indefinite period of time. For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate something and provide the result to activities that need it. Each service extends the Service base class.A prime example is a media player playing songs from a play list. The player application would probably have one or more activities that allow the user to choose songs and start playing them. However, the musicplayback itself would not be handled by an activity because users will expect the music to keep playing even after they leave the player and begin something different. To keep the music going, the media player activity could start a service to run in the background. The system would then keep the music playback service running even after the activity that started it leaves the screen.It's possible to connect to (bind to) an ongoing service (and start the service if it's not already running). While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback.Like activities and the other components, services run in the main thread of the application process. So that they won't block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback). See Processes and Threads, later.(3)Broadcast receiversA broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use.An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the BroadcastReceiver base class.Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user's attention in various ways —— flashing the backlight, vibrating the device, playing a sound, and so the user's attention in various wayson. They typically place a persistent icon in the status bar, which users can open to get the message.(4)Content providersA content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense. The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.See the separate Content Providers document for more information on using content providers. Whenever there's a request that should be handled by a particular component, Android makes sure that the application process of the component is running, starting it if necessary, and that an appropriate instance of the component is available, creating the instance if necessary.3.2 Activating components: intentsContent providers are activated when they're targeted by a request from a ContentResolver. The other three components — activities, services, and broadcast receivers — are activated by asynchronous messages called intents. An intent is an Intent object that holds the content of the message. For activities and services, it names the action being requested and specifies the URI of the data to act on, among other things. For example, it might convey a request for an activity to present an image to the user or let the user edit some text. For broadcast receivers, theIntent object names the action being announced. For example, it might announce to interested parties that the camera button has been pressed.。
android的多国语言适配

android多国语言文件夹android多国语言文件夹文件汇总如下:(有些语言的书写顺序可能跟中文是相反的)中文(中国):values-zh-rCN中文(台湾):values-zh-rTW中文(香港):values-zh-rHK英语(美国):values-en-rUS英语(英国):values-en-rGB英文(澳大利亚):values-en-rAU英文(加拿大):values-en-rCA英文(爱尔兰):values-en-rIE英文(印度):values-en-rIN英文(新西兰):values-en-rNZ英文(新加坡):values-en-rSG英文(南非):values-en-rZA阿拉伯文(埃及):values-ar-rEG阿拉伯文(以色列):values-ar-rIL保加利亚文: values-bg-rBG加泰罗尼亚文:values-ca-rES捷克文:values-cs-rCZ丹麦文:values-da-rDK德文(奥地利):values-de-rAT德文(瑞士):values-de-rCH德文(德国):values-de-rDE德文(列支敦士登):values-de-rLI希腊文:values-el-rGR西班牙文(西班牙):values-es-rES西班牙文(美国):values-es-rUS芬兰文(芬兰):values-fi-rFI法文(比利时):values-fr-rBE法文(加拿大):values-fr-rCA法文(瑞士):values-fr-rCH法文(法国):values-fr-rFR希伯来文:values-iw-rIL印地文:values-hi-rIN克罗里亚文:values-hr-rHR匈牙利文:values-hu-rHU印度尼西亚文:values-in-rID意大利文(瑞士):values-it-rCH意大利文(意大利):values-it-rIT 日文:values-ja-rJP韩文:values-ko-rKR立陶宛文:valueslt-rLT拉脱维亚文:values-lv-rLV挪威博克马尔文:values-nb-rNO 荷兰文(比利时):values-nl-BE荷兰文(荷兰):values-nl-rNL波兰文:values-pl-rPL葡萄牙文(巴西):values-pt-rBR 葡萄牙文(葡萄牙):values-pt-rPT 罗马尼亚文:values-ro-rRO俄文:values-ru-rRU斯洛伐克文:values-sk-rSK斯洛文尼亚文:values-sl-rSI塞尔维亚文:values-sr-rRS 瑞典文:values-sv-rSE泰文:values-th-rTH塔加洛语:values-tl-rPH土耳其文:values--r-rTR乌克兰文:values-uk-rUA 越南文:values-vi-rVN。
Android—API中文文档

Android2.2——API中文文档LLGYZB@目录:(1)—— TextView(2)—— EditText(3)—— AccessibilityService(4)—— Manifest(5)—— View(6)—— ImageView(7)—— ImageButton(8)—— QuickContactBadge(9)—— ZoomButton(10)—— CheckBox(11)—— RadioButton(12)—— Button(13)—— ToggleButton(14)—— ViewStub(15)——GridView一、TextView1、结构ng.Object↳android.view.View↳android.widget.TextView2、已知直接子类:Button, CheckedTextView, Chronometer, DigitalClock, EditText3、已知间接子类:AutoCompleteTextView, CheckBox, CompoundButton, ExtractEditText,MultiAutoCompleteTextView, RadioButton, ToggleButton二、EditText1、结构ng.Object↳ android.view.View↳android.widget.TextView↳ android.widget.EditText已知直接子类:AutoCompleteTextView, ExtractEditText已知间接子类: MultiAutoCompleteTextView2、xml 属性补充说明:a).由于是继承自TextView,所以属性是一样的,但是这里重点补充了输入法相关的属性说明和研究,部分注释也做了相应的调整。
b).Word格式下载/source/26641643、例子3.1<!--[endif]-->android:imeOptions例子<EditText android:id="@+id/txtTest" android:imeOptions="actionGo" android:layout_width="100dp" android:layout_height="wrap_con tent"></EditText>((EditText)findViewById(R.id.txtTest)).setOnEditorActionListener( new TextView.OnEditorActionListener() {@Overridepublic boolean onEditorAction(TextView v, int actionI d,KeyEvent event) {if (actionId == EditorInfo.IME_ACTION_GO) {Toast.makeText(TestActivity.this, "你点了Go!", Toast.LENGTH_SHORT).show();}return false;}});三、AccessibilityService1、结构ng.Object↳android.content.Context↳android.content.ContextWrapper↳android.app.Service↳android.accessibilityservice.AccessibilityServicepublic abstract class AccessibilityService extends Service2、类概述当AccessibilityEvent事件被启动后AccessibilityService 会接收回调函数运行于后台,这些事件指的是在用户接口间的状态转换,比如,焦点变化,按钮被点击等。
安卓应用基础中英文对照外文翻译文献

中英文对照外文翻译(文档含英文原文和中文翻译)Android Application FundamentalsAndroid applications are written in the Java programming language. The Android SDK tools compile the code—along with any data and resource files—into an Android package, an archive file with an .apk suffix. All the code in a single .apk file is considered to be one application and is the file that Android-powered devices use to install the application.Once installed on a device, each Android application lives in its own security sandbox:The Android operating system is a multi-user Linux system in which each application is a different user.By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them.Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.By default, every application runs in its own Linux process. Android starts the process when any of the application's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other applications. In this way, the Android system implements the principle of least privilege. That is, each application, by default, has access only to the components that it requires to do its work and no more. This creates a very secure environment in which an application cannot access parts of the system for which it is not given permission.However, there are ways for an application to share data with other applications and for an application to access system services:It's possible to arrange for two applications to share the same Linux user ID, in which case they are able to access each other's files. To conserve system resources, applications with the same user ID can also arrange to run in the same Linux process and share the same VM (the applications must also be signed with the same certificate).An application can request permission to access device data such as the user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All application permissions must be granted by the user at install time.That covers the basics regarding how an Android application exists within the system. The rest of this document introduces you to:1、The core framework components that define your application.2、The manifest file in which you declare components and required device features for your application.3、Resources that are separate from the application code and allow your application to gracefully optimize its behavior for a variety of device configurations.Application ComponentsApplication components are the essential building blocks of an Android application. Each component is a different point through which the system can enter your application. Not all components are actual entry points for the user and some depend on each other, but each oneexists as its own entity and plays a specific role—each one is a unique building block that helps define your application's overall behavior.There are four different types of application components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.Here are the four types of application components:ActivitiesAn activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to form a cohesive user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application that composes new mail, in order for the user to share a picture.An activity is implemented as a subclass of Activity and you can learn more about it in the Activities developer guide.ServicesA service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it.A service is implemented as a subclass of Service and you can learn more about it in the Services developer guide.Content providersA content provider manages a shared set of application data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. Through the content provider, other applications can query or evenmodify the data (if the content provider allows it). For example, the Android system provides a content provider that manages the user's contact information. As such, any application with the proper permissions can query part of the content provider (such as ContactsContract.Data) to read and write information about a particular person.Content providers are also useful for reading and writing data that is private to your application and not shared. For example, the Note Pad sample application uses a content provider to save notes.A content provider is implemented as a subclass of ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions. For more information, see the Content Providers developer guide.Broadcast receiversA broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system—for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts—for example, to let other applications know that some data has been downloaded to the device and is available for them to use. Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is just a "gateway" to other components and is intended to do a very minimal amount of work. For instance, it might initiate a service to perform some work based on the event.A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object. For more information, see the BroadcastReceiver class.A unique aspect of the Android system design is that any application can start another application’s component. For example, if you want the user to capture a photo with the device camera, there's probably another application that does that and your application can use it, instead of developing an activity to capture a photo yourself. You don't need to incorporate or even link to the code from the camera application. Instead, you can simply start the activity in the camera application that captures a photo. When complete, the photo is even returned to your application so you can use it. To the user, it seems as if the camera is actually a part of your application.When the system starts a component, it starts the process for that application (if it's not already running) and instantiates the classes needed for the component. For example, if your application starts the activity in the camera application that captures a photo, that activity runs in the process that belongs to the camera application, not in your application's process. Therefore, unlike applications on most other systems, Android applications don't have a single entry point (there's no main()function, for example).Because the system runs each application in a separate process with file permissions that restrict access to other applications, your application cannot directly activate a component from another application. The Android system, however, can. So, to activate a component in another application, you must deliver a message to the system that specifies your intent to start a particular component. The system then activates the component for you.Activating ComponentsThree of the four component types—activities, services, and broadcast receivers—are activated by an asynchronous message called an intent. Intents bind individual components to each other at runtime (you can think of them as the messengers that request an action from other components), whether the component belongs to your application or another.An intent is created with an Intent object, which defines a message to activate either a specific component or a specific type of component—an intent can be either explicit or implicit, respectively.For activities and services, an intent defines the action to perform (for example, to "view" or "send" something) and may specify the URI of the data to act on (among other things that the component being started might need to know). For example, an intent might convey a request for an activity to show an image or to open a web page. In some cases, you can start an activity to receive a result, in which case, the activity also returns the result in an Intent (for example, you can issue an intent to let the user pick a personal contact and have it returned to you—the return intent includes a URI pointing to the chosen contact).For broadcast receivers, the intent simply defines the announcement being broadcast (for example, a broadcast to indicate the device battery is low includes only a known action string that indicates "battery is low").The other component type, content provider, is not activated by intents. Rather, it is activated when targeted by a request from a ContentResolver. T he content resolver handles all direct transactions with the content provider so that the component that's performing transactions with the provider doesn't need to and instead calls methods onthe ContentResolver object. This leaves a layer of abstraction between the content provider and the component requesting information (for security).There are separate methods for activating each type of component:You can start an activity (or give it something new to do) by passingan Intent to startActivity() or startActivityForResult() (when you want the activity to return a result).You can start a service (or give new instructions to an ongoing service) by passingan Intent to startService(). Or you can bind to the service by passing an Intent to bindService().You can initiate a broadcast by passing an Intent to methodslike sendBroadcast(), sendOrderedBroadcast(), or sendStickyBroadcast().You can perform a query to a content provider by calling query() on a ContentResolver.For more information about using intents, see the Intents and Intent Filters document. More information about activating specific components is also provided in the following documents: Activities, Services, BroadcastReceiver and Content Providers.Declaring componentsThe primary task of the manifest is to inform the system about the application's components. For example, a manifest file can declare an activity as follows:In the <application> element, the android:icon attribute points to resources for an icon that identifies the application.In the <activity> element, the android:name at tribute specifies the fu lly qualified class name of the Activity subclass and the android:label attributes specifies a string to use as the user-visible label for the activity.You must declare all application components this way:1、<activity>elements for activities2、<service> elements for services3、<receiver>elements for broadcast receivers4、<provider>elements for content providersActivities, services, and content providers that you include in your source but do not declare in the manifest are not visible to the system and, consequently, can never run. However, broadcast receivers can be either declared in the manifest or created dynamically in code (as BroadcastReceiver objects) and registered with the system bycalling registerReceiver().Declaring component capabilitiesAs discussed above, in Activating Components, you can use an Intent to start activities, services, and broadcast receivers. You can do so by explicitly naming the target component (using the component class name) in the intent. However, the real power of intents lies in the concept of intent actions. With intent actions, you simply describe the type of action you want to perform (and optionally, the data upon which you’d like to perform the action) and allow the system to find a component on the device that can perform the action and start it. If there are multiple components that can perform the action described by the intent, then the user selects which one to use.The way the system identifies the components that can respond to an intent is by comparing the intent received to the intent filters provided in the manifest file of other applications on the device.When you declare a component in your application's manifest, you can optionally include intent filters that declare the capabilities of the component so it can respond to intents from other applications. You can declare an intent filter for your component by addingan <intent-filter>element as a child of the component's declaration element.For example, an email application with an activity for composing a new email might declare an intent filter in its manifest entry to respond to "send" intents (in order to send email). An activity in your application can then create an intent with the “send” action (ACTION_SEND), which the system matches to the email application’s “send” activity and launches it when you invoke the intent with startActivity().For more about creating intent filters, see the Intents and Intent Filters document.Declaring application requirementsThere are a variety of devices powered by Android and not all of them provide the same features and capabilities. In order to prevent your application from being installed on devices that lack features needed by your application, it's important that you clearly define a profile for the types of devices your application supports by declaring device and software requirements in your manifest file. Most of these declarations are informational only and the system does not read them, but external services such as Google Play do read them in order to provide filtering for users when they search for applications from their device.For example, if your application requires a camera and uses APIs introduced in Android 2.1 (API Level7), you should declare these as requirements in your manifest file. That way, devices that do not have a camera and have an Android version lower than 2.1 cannot install your application from Google Play.However, you can also declare that your application uses the camera, but doesnot require it. In that case, your application must perform a check at runtime to determine if the device has a camera and disable any features that use the camera if one is not available.Here are some of the important device characteristics that you should consider as you design and develop your application:Screen size and densityIn order to categorize devices by their screen type, Android defines two characteristics for each device: screen size (the physical dimensions of the screen) and screen density (the physical density of the pixels on the screen, or dpi—dots per inch). To simplify all the different types of screen configurations, the Android system generalizes them into select groups that make them easier to target.The screen sizes are: small, normal, large, and extra large.The screen densities are: low density, medium density, high density, and extra high density.By default, your application is compatible with all screen sizes and densities, because the Android system makes the appropriate adjustments to your UI layout and image resources. However, you should create specialized layouts for certain screen sizes and provide specialized images for certain densities, using alternative layout resources, and by declaring in your manifest exactly which screen sizes your application supports withthe <supports-screens> element.For more information, see the Supporting Multiple Screens document.Input configurationsMany devices provide a different type of user input mechanism, such as a hardware keyboard, a trackball, or a five-way navigation pad. If your application requires a particular kind of input hardware, then you should declare it in your manifest with the <uses-configuration> element. However, it is rare that an application should require a certain input configuration.Device featuresThere are many hardware and software features that may or may not exist on a given Android-powered device, such as a camera, a light sensor, bluetooth, a certain version of OpenGL, or the fidelity of the touchscreen. You should never assume that a certain feature is available on all Android-powered devices (other than the availability of the standard Android library), so you should declare any features used by your application withthe <uses-feature> element.Platform VersionDifferent Android-powered devices often run different versions of the Android platform, such as Android 1.6 or Android 2.3. Each successive version often includes additional APIs not available in the previous version. In order to indicate which set of APIs are available, each platform version specifies an API Level (for example, Android 1.0 is API Level 1 and Android 2.3 is API Level 9). If you use any APIs that were added to the platform after version 1.0, you should declare the minimum API Level in which those APIs were introduced using the <uses-sdk> element.It's important that you declare all such requirements for your application, because, when you distribute your application on Google Play, the store uses these declarations to filter which applications are available on each device. As such, your application should be available only to devices that meet all your application requirements.For more information about how Google Play filters applications based on these (and other) requirements, see the Filters on Google Play document.Application ResourcesAn Android application is composed of more than just code—it requires resources that are separate from the source code, such as images, audio files, and anything relating to the visual presentation of the application. For example, you should define animations, menus, styles, colors, and the layout of activity user interfaces with XML files. Using application resources makes it easy to update various characteristics of your application without modifying code and—by providing sets of alternative resources—enables you to optimize your application for a variety of device configurations (such as different languages and screen sizes).For every resource that you include in your Android project, the SDK build tools define a unique integer ID, which you can use to reference the resource from your application code or from other resources defined in XML. For example, if your application c ontains an image file named logo.png (saved in the res/drawable/ directory), the SDK tools generate a resource IDnamed R.drawable.logo, which you can use to reference the image and insert it in your user interface.One of the most important aspects of providing resources separate from your source code is the ability for you to provide alternative resources for different device configurations. For example, by defining UI strings in XML, you can translate the strings into other languages and save those strings in separate files. Then, based on a language qualifier that you append to the resource directory's name (such as res/values-fr/ for French string values) and the user's language setting, the Android system applies the appropriate language strings to your UI.Android supports many different qualifiers for your alternative resources. The qualifier is a short string that you include in the name of your resource directories in order to define the device configuration for which those resources should be used. As another example, you should often create different layouts for your activities, depending on the device's screen orientation and size. For example, when the device screen is in portrait orientation (tall), you might want a layout with buttons to be vertical, but when the screen is in landscape orientation (wide), the buttons should be aligned horizontally. To change the layout depending on the orientation, you can define two different layouts and apply the appropriate qualifier to each layout's directory name. Then, the system automatically applies the appropriate layout depending on the current device orientation.For more about the different kinds of resources you can include in your application and how to create alternative resources for various device configurations, see theApplication Resources developer guide.安卓应用基础在Java编程语言编写的Android应用程序的Android的SDK工具编译代码以及与任何数据和到一个Android的包,一个归档文件档案资源的.apk后缀,所有的在一个单一的代码.apk文件被认为是一个应用程序,是Android的文件,供电设备来安装应用程序。
Android外文文献翻译11

Android Application Fundamentals nguage pil.th.code—alon.wit.an.dat.an.resourc.files—int.an Androi.package.a.archiv.an .apk suffix.Al.th.cod.i..single .apk.considere.t.b.on. applicatio.an.i.th..t.instal.th.application.Once installed on a device, each Android application lives in its own security sandbox:The Android operating system is a multi-user Linux system in which each application is a different user.e .I.(e.onl.b.th.syste.an.i.unknow.t.th.application). Th.syste.set.permission.fo.al.th.file.i.a.applicatio.s.tha.o e.I.assigne.t.tha.applicatio.ca.acces.them.Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.B.default.ever.applicatio.run.i.it.ow.Linu.process.Androi.st art.th.proces.whe.an.o.th.application'.component.nee.t.b.exe cuted.the.shut.dow.th.proces.whe.it'.n.longe.neede.o.whe.th. syste.mus.recove.memor.fo.othe.applications.I.thi.way.th.Androi.syste.implement.the principl.o.leas.pri vilege.Tha.is.eac.application.b.default.ha.acces.onl.t.th.co mponent.tha.i.require.t.d.it.wor.an.n.more.Thi.create..ver.s ecur.environmen.i.whic.a.applicatio.canno.acces.part.o.th.sy ste.fo.whic.i.i.no.give.permission.However, there are ways for an application to share data with other applications and for an application to access system services:It'.possibl.t.arrang.fo.tw.application.t.shar.th.sam.Lin e.ID.i.whic.cas.the.ar.abl.t.acces.eac.other'.files.T.co e.I.ca.als.ar rang.t.ru.i.th.sam.Linu.proces.an.shar.th.sam.V.(th.applicat ion.mus.als.b.signe.wit.th.sam.certificate).A.applicatio.ca.reques.permissio.t.acces.devic.dat.suc.a.th. user'.contacts.SM.messages.th.mountabl.storag.(S.card).camer a.Bluetooth.an.more.Al.applicatio.permission.mus.b.grante.b. e.a.instal.time.Tha.cover.th.basic.regardin.ho.a.Androi.applicatio.exist .withi.th.system.Th.res.o.thi.documen.introduce.yo.to:1.The core framework components that define your application.2.The manifest which you declare components and required device features for your application.3、Resource.tha.ar.separat.fro.th.applicatio.cod.an.allo.you.ap plicatio.t.gracefull.optimiz.it.behavio.fo..variet.o.devic.c onfigurations.Application Componentsponent.ar.th.essentia.buildin.block.o.a. ponen.i..differen.poin.throug.whic ponent.ar.actua.e e.an.som.depen.o.eac.other.bu.eac.on.exist .a.it.ow.entit.an.play..specifi.role—eac.on.i..uniqu.buildin.bloc.tha.help.defin.you.application' .overal.behavior.ponents.Eac.ty p.serve..distinc.purpos.an.ha..distinc.lifecycl.tha.define.h ponen.i.create.an.destroyed.Here are the four types of application components: ActivitiesAn activity e.interface. Fo.example.a.emai.applicatio.migh.hav.on.activit.tha.show..l pos.a.email.an.anothe.activit.fo.readin.emails.Althoug.th.activitie.wor.togethe.t.for e.experienc.i.th.emai.application.eac.on.i.indep enden.o.th.others.A.such..differen.applicatio.ca.star.an.on. o.thes.activitie.(i.th.emai.applicatio.allow.it).Fo.example. .camer.applicatio.ca.star.th.activit.i.th.emai.applicatio.th e.t.shar..picture.An activity is implemented as a subclass of Activity and you can learn more about it in the Activities developer guide. ServicesA service ponen.tha.run.i.th.backgroun.t.perfor. long-runnin.operation.o.t.perfor.wor.fo.remot.processes..ser e.interface.Fo.example..servic.migh.pla e.i.i..differen.application.o e.interactio ponent.suc.a.a.activity.ca.star.th .servic.an.le.i.ru.o.bin.t.i.i.orde.t.interac.wit.it.A service is implemented as a subclass of Service and you can learn more about it in the Services developer guide. Content providersA conten.provider manage..share.se.o.applicatio.data.Y o.ca.stor.th.dat.i.th..a.SQLit.database.o.th.web.o.an.othe.p ersisten.storag.locatio.you.applicatio.ca.access.Throug.th.conten.provider.othe.application.ca.quer.o.eve.modif.th.dat.( i.th.conten.provide.allow.it).Fo.example.th.Androi.syste.pro er'rmation.A.such.an.applicatio.wit.th.prope.permission.ca.quer.par.o.t h.conten.provide.(suc.as ContactsContract.Data.t.rea.an.wri rmatio.abou..particula.person.efu.fo.readin.an.writin.dat.tha .i.privat.t.you.applicatio.an.no.shared.Fo.example.the Not. Pad e..conten.provide.t.sav.notes..conten.provide.i.implemente.a..subclas.of ContentProvider an.mus.implemen..standar.se.o.API.tha.enabl.othe.applicati rmation.se.the Conten.P roviders develope.guide.Broadcast receiversA broadcas.receiver ponen.tha.respond.t.system-w id.broadcas.announcements.Man.broadcast.originat.fro.th.syst em—fo.example..broadcas.announcin.tha.th.scree.ha.turne.off.th. batter.i.low.o..pictur.wa.captured.Application.ca.als.initia t.broadcasts—fo.example.t.le.othe.application.kno.tha.som.dat.ha.bee.down e.Althoug.broadcas .receiver.don'e.interface.the.may creat..statu.ba.notification e.whe..broadcas.even.occurs.Mor. commonly.though..broadcas.receive.i.jus.." ponent.an.i.intende.t.d..ver.minima.amoun.o.work.Fo.instance .i.migh.initiat..servic.t.perfor.som.wor.base.o.th.event. .broadcas.receive.i.implemente.a..subclas.of BroadcastRecei ver an.eac.broadcas.i.delivere.a.an Intent object.Fo.mor. information.se.th.BroadcastReceiver class..uniqu.aspec.o.th.Androi.syste.desig.i.tha.an.applicatio. ca.star.anothe.application’.component.Fo.example.i.yo.wan.t e.t.captur..phot.wit.th.devic.camera.there'.probabl.anot .it.instea. o.developin.a.activit.t.captur..phot.yourself.Yo.don'.nee.t. incorporat.o.eve.lin.t.th.cod.fro.th.camer.application.Inste ad.yo.ca.simpl.star.th.activit.i.th.camer.applicatio.tha.cap plete.th.phot.i.eve.returne.t.you.applica er.i.seem.a.i.th.camer.i.actuall..p ar.o.you.application.ponent.i.start.th.proces.fo.tha.ap plicatio.(i.it'.no.alread.running.an.instantiate.th.classe.n ponent.Fo.example.i.you.applicatio.start.th.ac tivit.i.th.camer.applicatio.tha.capture..photo.tha.activit.r un.i.th.proces.tha.belong.t.th.camer.application.no.i.you.application'.process.Therefore.unlik.application.o.mos.othe.sy stems.Androi.application.don'.hav..singl.entr.poin.(there'.n o main() function.fo.example).Becaus.th.syste.run.eac.applicatio.i..separat.proces.wit. tha.restric.acces.t.othe.applications.you.applicatio.canno.d ponen.fro.anothe.application.Th.Androi.sy ponen.i.anothe.application .yo.mus.delive..messag.t.th.syste.tha.specifie.your intent ponen.fo.you.Activating Componentsponen.types—activities.services.an.broadcas.receivers—ar.activate.b.a.asynchronou.messag.calle.an intent.Intent.b ponent.t.eac.othe.a.runtim.(yo.ca.thin.o.the ponents).whet ponen.belong.t.you.applicatio.o.another.An intent is created with an Intent object, which defines a message to activate either a specific component or a specific type of component—an intent can be either explicit or implicit, respectively.Fo.activitie.an.services.a.inten.define.th.actio.t.perfor .(fo.example.t."view.o."send.something.an.ma.specif.th.UR.o. th.dat.t.ac.o.(ponen.bein.starte.m igh.nee.t.know).Fo.example.a.inten.migh.conve..reques.fo.a.a ctivit.t.sho.a.imag.o.t.ope..we.page.I.som.cases.yo.ca.star.a.activit.t.receiv..result.i.whic.case.th.activit.als.return .th.resul.i.an Intent (fo.example.yo.ca.issu.a.inten.t.le. e.pic..persona.contac.an.hav.i.returne.t.you—th.retur.inten.include..UR.pointin.t.th.chose.contact).For broadcast receivers, the intent simply defines the announcement being broadcast (for example, a broadcast to indicate the device battery is low includes only a known action string that indicates "battery is low").ponen.type.conten.provider.i.no.activate.b. intents.Rather.i.i.activate.whe.targete.b..reques.fro.a Con tentResolver.Th.conten.resolve.handle.al.direc.transaction.w ponen.that'.performin.trans action.wit.th.provide.doesn'.nee.t.an.instea.call.method.o.t he ContentResolver ye.o.abstractio.bet rmatio.(f o.security).There are separate methods for activating each type of component:You can start an activity (or give it something new to do) by passingan Intent to startActivity()or startActivityForResult( )(when you want the activity to return a result).Yo.ca.star..servic.(o.giv.ne.instruction.t.a.ongoin.serv ice.b.passin.an Intent to startService().O.yo.ca.bin.t.th .servic.b.passin.an Intent tobindService().You can initiate a broadcast by passing an Intent to methods like sendBroadcast(), sendOrderedBroadcast(),or sendStickyBroadcast().You can perform a query to a content provider bycalling query()on a ContentResolver.in.intents.se.the Intent.an.Inten .Filters ponent.i.als.provide.i.th.followin.documents: Activities, Services, BroadcastReceiver and Conten.Providers.Declaring components<?xm.version="1.0.encoding="utf-8"?><manifes....>..<applicatio.android:icon="@drawable/app_icon.png....> ....<activit.android:name="com.example.project.ExampleActivi ty".........android:label="@string/example_label....>....</activity>.........</application></manifest>In the <application>element, theandroid:icon attribute points to resources for an icon that identifies the application.In the <activity>element, the android:name at tribute specifies the fu lly qualified class name of theActivity subclass and the android:label attributes specifies a string to use as the user-visible label for the activity.You must declare all application components this way:1.<activity> elements for activities2.<service> elements for services3.<receiver> elements for broadcast receivers4.<provider> elements for content providersActivities.services.an.conten.provider.tha.yo.includ.i.yo u.sourc.bu.d.no.declar.i.th.manifes.ar.no.visibl.t.th.syste. and.consequently.ca.neve.run.However.broadcas.receiver.ca.b. eithe.declare.i.th.manifes.o.create.dynamicall.i.cod.(as Br oadcastReceiver objects.an.registere.wit.th.syste.b.callingregisterReceiver().Declaring component capabilitiesA.discusse.above.in .an In tent t.star.activities.services.an.broadcas.receivers.Yo.ca ponen.(ponen.c .i.th.intent.However.th.rea.powe.o.intent.lie.i.th.c oncep.o.inten.actions.Wit.inten.actions.yo.simpl.describ.th. typ.o.actio.yo.wan.t.perfor.(an.optionally.th.dat.upo.whic.y ou’ponen .o.th.devic.tha.ca.perfor.th.actio.an.star.it.I.ther.ar.mult ponent.tha.ca.perfor.th.actio.describe.b.th.intent.th e.The way the system identifies the components that can respond to an intent is by comparing the intent received to the intent filters provided in the manifest other applications on the device.ponen.i.you.application'.manifest.yo.ca .optionall.includ.inten.filter.tha.declar.th.capabilitie.o.t ponen.s.i.ca.respon.t.intent.fro.othe.applications.Yo.c ponen.b.addin.an <intent-f ilter> ponent'.declaratio.element.posin..n e.emai.migh.declar.a.inten.filte.i.it.manifes.entr.t.respon. t."send.intent.(i.orde.t.sen.email).A.activit.i.you.applicat io.ca.the.creat.a.inten.wit.th.“send.actio.(ACTION_SEND).whic.th.syste.matche.t.th.emai.ap plication’.“unche.i.whe.yo.invok.th.inten.with star tActivity().For more about creating intent filters, see the Intents and Intent Filters document.Declaring application requirementsTher.ar..variet.o.device.powere.b.Androi.an.no.al.o.the.p rovid.th.sam.feature.an.capabilities.I.orde.t.preven.you.app c.feature.neede.b.y ou.application.it'.importan.tha.yo.clearl.defin..pr.th.type. o.device.you.applicatio.support.b.declarin.devic.an.softwar. requirement.i.you.manifes.file.Mos.o.thes.declaration.ar.informationa.onl.an.th.syste.doe.no.rea.them.bu.externa.service er. whe.the.searc.fo.application.fro.thei.device.e.API.int roduce.i.Androi.2..(AP.Level 7).yo.shoul.declar.thes.a.requ irement.i.you.manifes.file.Tha.way.device.tha.do not hav.. camer.an.hav.a.Androi.version lower tha.2..canno.instal.yo u.applicatio.fro.Googl.Play.e.th.camera .bu.doe.not require it.I.tha.case.you.applicatio.mus.perfo r..chec.a.runtim.t.determin.i.th.devic.ha..camer.an.disabl.a .th.camer.i.on.i.no.available.Here are some of the important device characteristics that you should consider as you design and develop your application: Screen size and densityI.orde.t.categoriz.device.b.thei.scree.type.Androi.defin e.tw.characteristic.fo.eac.device.scree.siz.(th.physica.dime nsion.o.th.screen.an.scree.densit.(th.physica.densit.o.th.pi xel.o.th.screen.o.dpi—dot.pe.inch).T.simplif.al.th.differen.type.o.scree.configura tions.th.Androi.syste.generalize.the.int.selec.group.tha.mak .the.easie.t.target.The screen sizes are: small, normal, large, and extra large. The screen densities are: low density, medium density, high density, and extra high density.patibl.wit.al.scree.size.a n.densities.becaus.th.Androi.syste.make.th.appropriat.adjust you.an.imag.resources.However.yo.shoul.creat. yout.fo.certai.scree.size.an.provid.specialize. you.resources.an .b.declarin.i.you.manifes.exactl.whic.scree.size.you.applica tio.support.wit.the <supports-screens> element.For more information, see the Supporting Multiple Screens document.Input configurationse.inpu.mechanism.suc.a.. hardwar.keyboard..trackball.o..five-wa.navigatio.pad.I.you.a pplicatio.require..particula.kin.o.inpu.hardware.the.yo.shou l.declar.i.i.you.manifes.wit.the <uses-configuration> elem ent.However.i.i.rar.tha.a.applicatio.shoul.requir..certai.in pu.configuration.Device featuresTher.ar.man.hardwar.an.softwar.feature.tha.ma.o.ma.no.exis.o ..give.Android-powere.device.suc.a..camera..ligh.sensor.blue tooth..certai.versio.o.OpenGL.o.th.fidelit.o.th.touchscreen.Yo.shoul.neve.assum.tha..certai.featur.i.availabl.o.al.Andro id-powere.device.(othe.tha.th.availabilit.o.th.standar.Andro i.library)e.b.you.applicatio .wit.the <uses-feature> element.Platform VersionDifferen.Android-powere.device.ofte.ru.differen.version.o.th .Androi.platform.suc.a.Androi.1..o.Androi.2.3.Eac.successiv. versio.ofte.include.additiona.API.no.availabl.i.th.previou.v ersion.I.orde.t.indicat.whic.se.o.API.ar.available.eac.platf or.versio.specifie.an AP.Level (fo.example.Androi.1..i.AP. Leve..an.Androi.2..i.AP.Leve.9).an.API.tha.wer.adde. t.th.platfor.afte.versio.1.0.yo.shoul.declar.th.minimu.AP.Le in.the <uses-sdk> eleme nt.It'.importan.tha.yo.declar.al.suc.requirement.fo.you.appl ication.because.whe.yo.distribut.you.applicatio.o.Googl.Play e.thes.declaration.t.filte.whic.application.ar.av ailabl.o.eac.device.A.such.you.applicatio.shoul.b.availabl.o nl.t.device.tha.mee.al.you.applicatio.requirements.For more information about how Google Play filters applications based on these (and other) requirements, see the Filters on Google Play document.Application Resourcespose.o.mor.tha.jus.code—i.require.resource.tha.ar.separat.fro.th.sourc.code.suc.a.im ages.audi.files.an.anythin.relatin.t.th.visua.presentatio.o. th.application.Fo.example.yo.shoul.defin.animations.menus.st e.interface.wit.XM.files .Usin.applicatio.resource.make.i.eas.t.updat.variou.characte ristic.o.you.applicatio.withou.modifyin.cod.and—b.providin.set.o.alternativ.resources—enable.yo.t.optimiz.you.applicatio.fo..variet.o.devic.config uration.(nguage.an.scree.sizes).Fo.ever.resourc.tha.yo.includ.i.you.Androi.project.th.SD. .t.referenc.th .resourc.fro.you.applicatio.cod.o.fro.othe.resource.define.i .XML.Fo.example.i.you.applicatio.contain.a.imag. logo.png (save.i.the res/drawable/ directory).th.SD.tool.generat..r d .t.referenc.th. e.interface.On.o.th.mos.importan.aspect.o.providin.resource.separat.f ro.you.sourc.cod.i.th.abilit.fo.yo.t.provid.alternativ.resou rce.fo.differen.devic.configurations.Fo.example.b.definin.U. nguage.an.snguag.qualifie .tha.yo.appen.t.th.resourc.directory'.nam.(suc.as res/value s-fr/ er'.languag.setting.th. nguag.string.t.you.UI.Androi.support.man.different qualifiers fo.you.alternat iv.resources.Th.qualifie.i..shor.strin.tha.yo.includ.i.th.na m.o.you.resourc.directorie.i.orde.t.defin.th.devic.configura ed.A.anothe.example.yo.s yout.fo.you.activities.dependin.o .th.device'.scree.orientatio.an.size.Fo.example.whe.th.devic .scree.i.i.portrai.orientatio.(tall)you.wit. ndscap.orientatio. (wide)yo yout.a yout'.Th you.dependin .o.th.curren.devic.orientation.For more about the different kinds of resources you can include in your application and how to create alternative resources for various device configurations, see theApplication Resources developer guide.安卓应用基础在Java编程语言编写的Android应用程序的Android的SDK工具编译代码以及及任何数据和到一个Android的包, 一个归档文件档案资源的.apk后缀, 所有的在一个单一的代码.apk文件被认为是一个应用程序, 是Android的文件, 供电设备来安装应用程序。
外文翻译---安卓系统的基本描述

附录二外文文献(原文)The basic of description of android system The mainstream of the next generation of open operating systems will not be on the desktop, but will appear in the phone that we carry every day. Open environment will lead these new applications may be integrated into these online services that already exist, of course, as with growing data services on mobile phones support the security flaws on the phone is also becoming increasingly clear. The nature of the next-generation operating system, whether to provide a complete integrated security platform.By the Open Mobile Alliance (open Handset Alliance led by Google) developed the android system is a widely optimistic about an open source phone system, the system provides a basic operating system, a middle ware application layer, a java development tools and a system Application collector (collection of system applications). The android the SDK since 2007 on the release of the first android phone in October 2008 before the birth. Google opened since then on his own time, Taiwan's HTC, the manufacturer of the T-Mobile G1 estimate G1 shipments have more than one million at the end of 2008. According to industry insiders expect the G1 mobile phone sales in 2009 continue. Many other mobile phone suppliers in the near future plans to support this system.Around an android and a huge developer community has been established, while a lot of new products and applications on the android. Android's main selling point is that it enables developers to seamlessly expand online services to mobile phones. This is the most obvious example is Google's tightly integrated with Gmail, Calendar and Contacts Web applications through the system. Users only need to provide an android user name and password, the phone automatically sync with Google services. The other vendors are quickly adapt their existing instant messaging, social networking and gaming services. Android and many companies find new ways to integrate their existing business to the android.Traditional desktop and server operating system has been working for the integration of security features. These individuals and business applications on a single platform is very good, however a business phone platform like android is not very useful. It gives the hope of many researchers. Android is not parked in the body for other platform application support: the implementation of the application depends on a top-level JA V A middle ware, the middle ware running on the embedded Linux kernel. Therefore, developers should deploy their applications to the Android mustuse a custom user interface environment.In addition, the android system applications limit the application to call each other API collaboration, and the other to authenticate the user application. Although these applications have certain safety features, some of our experienced developers to create Android applications who revealed that the design of security applications is not always straight forward. Android uses a simple permission label distribution mode to restrict access to resources, but the reasons for the necessity and convenience of other applications, the designers have increased the confusion on this system. This paper attempts to explain the complexity of the Android security, and pay attention to some of the possible development defects and application security. We try to draw some lessons learned, and hope that the safety of the future.Android application framework for developers is a mandatory framework. It does not have a main () function function or a single entry point for the implementation of the contrary, the developer must in the design of application components. We developed applications to help the API of the android sdkThe Android system defines four kinds of component type.Activity component that defines the application user interface. Usually, the application developer defines each activity screen. Activity can start, it may pass and return values. Can be handled at a time only a keyboard system Activity, all other Activity will be suspended at this time.Service components perform background processing. The need for some operations when an activity, after the disappearance of the user interface (such as downloading a file or playing music), it usually take such action specially designed services. Developers can also use a special daemon at system startup, the service is usually defined a remote procedure call (RPC), and other system components can be used to send the interface command and retrieve data, as well as to register a callback function.ContentProvider component storage and share data with relational database interfaces. Each Content supplier has an associated "rights" to describe its contents contains. Other components when used as a handle to execute SQL queries (eg SELECT, INSERT, or DELETE content. Content suppliers are typically stored the values on the database records, data retrieval is a special case, the file is also shared by the content provider interface.The components of the broadcast receiver as to send a message from the mailbox to the application. Typically, the broadcast message, the application code implicit destination. Therefore, the radio receiver subscribe to these destinations receive messages sent to it. The application code can also be solved explicitly broadcast receivers, including the name space allocation.The main mechanism of the interaction of the components of the Component Interaction, is an intent, which is a simple message object, which contains a destination address and data components. The Android API defines his approach into intent, and use that information to initiate an activity such as start an activity (startActivity (An intent)) start services (the startService (An intent)) and radio (sendBroadcast (An intent)). Android framework to inform the calls to these methods began to perform in the target application code. This process, the internal components of communication is called an action. Simply put, the Intent object defined in the "Intent to implement the" action ". One of the most powerful features of the Android is allowed a variety of intent addressing mechanism. The developer can solve the space of a target component using its applications, they can also specify an implicit name. In the latter case, the system determines the best components of an action by considering the installed applications and user choice.Implicit name is called the action string because of his special type of the requested action. Such as a view action string, in an intent data field points to an image file, the system will directly referring to the preferred image viewer.Developers can also use the action string a large number of radio to send and receive. Receiver at the receiving end, the developers use an intent filter to customize the special action string. Android Department, including the additional goal of the resolution rules, but an optional string type of data manipulation is the most common.Android applications are written in the Java programming language.The compiled Java code —along with any data and resource files required by the application —is bundled by the apt tool into an Android package,an archive file marked by an .apk suffix.This file is the vehicle for distributing the application and installing it on mobile devices;it's the file users download to their devices.All the code in a single.apk file is considered to be one application.In many ways,each Android application lives in its own world:(1)By default,every application runs in its own Linux process.Android starts the process when any of the application's code needs to be executed,and shuts down the process when it's no longer needed and system resources are required by otherapplications.(2)Each process has its own virtual machine(VM),so application code runs in isolation from the code of all other applications.(3)By default,each application is assigned a unique Linux user ID.Permissions are set so that the application's files are visible only to that user and only to the application itself —altough there are ways to export them to other applications as well.It's possible to arrange for two applications to share the same user ID,in while case they will be able to see each other's files.To conserve system resources,applications with the same ID can also arrange to run in the same Linux process,sharing the same VM.Application ComponentsA central feature of Android is that one application can make use of elements of other application (provided those application permit it).For example,if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others,you can call upon that scroller to do the work,rather than develop your own.Your application doesn't incorporate the code of the other application or link to it.Rather,it simply starts up that piece of the other application when the need arises.For this to work,the system must be able to start an application process when any part of it is needed,and instantiate the Java objects for that part.Therefore,unlike applications on most other systems,Android applications don't have a single entry point for everything in the application(no main()function,for example).Rather,they have essential components that the system can instantiate and run as needed.There are four types of components:ActivitiesAn activity presents a visual user interface for one focused endeavor the user can undertake.For example,an activity might present a list of menu items users can choose from or it might display photographs along with their captions.A text messaging application might have one activity that shows a list of contacts to send messages to,a second activity to write the message to the chosen contact,and other activities to review old messages or change or change settings.Tough they work together to form a cohesive user interface,each activity is independent of the others.Each one is implemented as a subclass of the Activity base class.An application might consist of just one activity or,like the text messaging application just mentioned,it may contain several.What the activities are,and how many there are depends,of course,on the application and its design.Typically,one of the activities is marked as the first one that should be presented to the user when the application is launched.Moving from one activity to another is accomplished by having the current activity start the next one.Each activity is given a default window to draw in.Typically,the window fills the screen,but it might be smaller than the screen and float on top of other windows.An activity can also make use of additional windows —for example,a pop-up dialog that calls for a user response in the midst of the activity,or a window that presents users with vital information when they select a particular item on-screen.The visual content of the window is provided by a hierarchy of views —objects derived from the base View class.Each view controls a particular rectangular space within the window.Parent views contain and organize the layout of their children.Leaf views(those at the bottom of the hierarchy)draw in the rectangles they control and respond to user actions directed at that space.Thus,views are where the activity's interaction with the user takes place.For example,a view might display a small image and initiate an action when the user taps that image.Android has a number of ready-made views that you can use —including buttons,text fields,scroll bars,menu items,check boxes,and more.A view hierarchy is placed within an activity's window by the Activity.setContentView()method.The content view is the View object at the root of the hierarchy.(See the separate User Interface document for more information on views and the hierarchy.)ServicesA service doesn't have a visual user interface,but rather runs in the background for an indefinite period of time.For example,a service might play background music as the user attends to other matters,or it might fetch data over the network or calculate something and provide the result to activities that need it.Each service extends the Service base class.A prime example is a media player songs from a play list.The player application would probably have one or more activities that allow the user to choose songs and start playing them.However,the music playback itself would bot be handled by an activity because users will expect the music to keep the music going,the media player activity could start a service to run in the background.The system would then keep themusic playback service running even after the activity that started it leaves the screen.It's possible to connect to (bind to)an ongoing service(and start the service if it's not already running).While connected,you can communicate with the service through an interface that the service exposes.For the music service,this interface might allow users to pause,rewind,stop,and restart the playback.Like activities and the other components,services run in the main thread of the application process.So that they won't block other components or the user interface,they often spawn another thread for time-consuming tasks(like music playback).See Processes and Thread,later.Broadcast receiversA broadcast receiver is a component that does nothing but receive and react to broadcast announcements.Many broadcasts originate in system code —for example,announcements that the timezone has changed,that the battery is low,that a picture has been taken,or that the user changed a language preference.Applications can also initiate broadcasts —for example,to let other applications know that some data has been downloaded to the device and is available for them to use.An application can have any number of broadcast receivers to respond to respond to respond to any announcements it considers important.All receivers extend the BroadcastReceiver base class.Broadcast receivers do not display a user interface.However,they may start an activity in response to the information they receive,or they may use the NotificationManager to alert the user.Notifications can get the user's attention in various ways —flashing the backlight,vibrating the device,playing a sound,and so on,They typically place a persistent icon in the status bar,which users can open to get the message.Content providersA content provider makes a specific set of the application's data available to other applications.The data can be stored in the file system,in an SQLite database,or in any other manner that makes sense.The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls.However,applications do not call these methods directly.Rather they use a ContentResolver object and call its methods instead.A ContentResolver can talk to any content provider;it cooperates with the provider to manage any interprocess communication that's involved.See the separate Content Providers document for more information on using content providers.Whenever there's a request that should be handled by a particular component,Android makes sure that the application process of the component is running,starting it if necessary,and that an appropriate instance of the component is available,creating the instance if necessary.Activating components:intentsContent providers are activated when they're targeted by a request from a ContentResolver.The other three components —activities,services,and broadcast receivers —are activated by asynchronous messages called intents.An intent is an Intent object that holds the content of the message.For activities and services,it names the action being requested and specifies the URI of the data to act on,among other things.For example,it might convey a request for an activity to present an image t the user or let the user edit some text.For broadcast receivers,the Intent object names the action being announced.For example,it might announce to interested parties that the camera button has been pressed.There are separate methods for activating each type of component:1.An activity is launched(or given something new to do)by passing an Intent object to Context.startActivity() or Activity.startActivityForResult().The responding activity can look at the initial intent that caused it to be launched by calling its getIntent() method.Android calls the activity's onNewIntent()method to pass it any subsequent intents.One activity often starts the next one.If it expects a result back from the activity it's starting,it calls startActivityForResult() instead of startActivity().For example,if it starts an activity that lets the user pick a photo,it might expect to be returned the chosen photo.The result is returned in an Intent object that's passed to the calling activity's onActivityResult() method.2.A service is started(or new instructions are given to an ongoing service)by passing an Intent object to Context.startService().Android calls the service's onStart() method and passes it the Intent object.Similarly,an intent can be passed to Context.bindService() to establish an ongoing connection between the calling component and a target service.The service receives the Intent object in an onBind() call.(If the service is not already running,bindService() can optionally start it.)For example,an activity might establish a connection with the music playback service mentioned earlier so that it can provide the user with the means(a user interface)for controlling the playback.The activity would call bindService() to set up thatconnection,and then call methods defined by the service to affect the playback.A later section,Remote procedure calls,has more details about binding to a service.3.An application can initiate a broadcast by passing an Intent object to methods like Context.sendStickyBroadcast() in any of their variations.Android delivers the intent to all interested broadcast receivers by calling their onReceive() methods.For more on intent messages,see the separate article,Intents and Intent Filters.Shutting down componentsA content provider is active only while it's responding to a request from a ContentResolver.And a broadcast receiver is active only while it's responding to a broadcast message.So there's no need to explicitly shut down these components.Activities,on the other hand,provide the user interface.They're in a long-running conversation with the user and may remain active,even when idle,as long time.So Android has methods to shut down activities and services in an orderly way:1.An activity can be shut down by calling its finish() method.Onte activity can shut down another activity (one it started with startActivityForResult())by calling finishActivity().2.A service can be stopped by calling its stopSelf() method,or by calling Context.stopService().Components might also be shut down by the system when they are no longer being used or when Android must reclaim memory for more active components.A later section,Component Lifecycles,discusses this possibility and its ramifications in more detail.The manifest fileBefore Android can start an application component,it must learn that the component exists.Therefore,applications declare their components in a manifest file that's bundled into the Android package,the .apk file that also holds the application's code,files, and resources.The manifest is a structured XML file and is always named AndroidManifest.xml for all applications.It does a number of things in addition to declaring the application's components,such as naming any libraries the application needs to be linked against(besides the default Android library)and identifying any permissions the application expects to be granted.But the principal task of the manifest is to inform Android about the application's components.For example,an activity might be declared as follows:The name attribute of the <activity>element names the Activity subclass that implements the activity.The icon and label attributes point to resource files containing an icon and label that can be displayed to users to resource files containing an icon and label that can be displayed to users to represent the activity.The other components are declared in a similar way —<service>elements for services,<receiver>elements for broadcast receivers,and<provider>elements for content providers.Activities,services,and content providers that are not declared in the manifest are not visible to the system and are consequently never run.However,broadcast receivers can either be declared in the manifest,or they can be created dynamically i code (as BroadcastReceiver objects)and registered with the system by calling Context.registerReceiber().For more on how to structure a manifest file for your application,see The Android Manifest.xml File.Intent filtersAn Intent object can explicitly name a target component.If it does,Android finds that component(based on the declarations in the manifest file)and activates it.But if a target is not explicitly named,Android must locate the best component to respond to the intent.It does s by comparing the Intent object to the intent filters of potential targets.A component's intent filters inform Android of the kinds of intents the component is able to handle.Like other essential information about the component,they're declared in the manifest.Here's an extension of the previous example that adds two intent filters to the activity:The first filter in the example —the combination of the action "android.intent.action.MAIN"and the category "UNCHER"—is a common one.It marks the activity as one that should be represented in the application launcher,the screen listing applications users can launch on the device.In other words,the activity is the entry point for the application,the initial one users would see when they choose the application in the launcher.The component can have any number of intent filters,each one declaring a different set of capabilities.If it doesn't have any filters,it can be activated only by intents that explicitly name the component as the target.For a broadcast receiver that's created and registered in code,the intent filter is instantiated directly as an IntentFilter object.All other filters are set up in the manifest.For more on intent filters,see a separate document, Intents and Intent Filters.附录三外文文献(译文)安卓系统的基本描述下一代开放操作系统的主流将不会在桌面上,但是将会出现在我们每天携带的手机上。
安卓单词(国外英文资料)

安卓单词(国外英文资料)在当今数字化的时代,安卓操作系统已经成为全球范围内使用最广泛的移动操作系统之一。
安卓不仅为用户提供了丰富的应用和功能,还推动了移动技术的创新和发展。
然而,对于许多人来说,安卓系统中的许多专业术语和概念可能显得有些陌生和难以理解。
为了帮助用户更好地了解安卓系统,本文将介绍一些与安卓相关的常用单词和术语,并提供相关的英文资料,以便读者能够更深入地了解安卓系统的各个方面。
1. Android:安卓操作系统的名称,源自于英文单词“android”,意为“”。
2. APK:安卓应用程序的安装包文件格式,全称为“Android Package”。
3. Dalvik:安卓系统中的一个虚拟机,用于运行安卓应用程序。
4. ROM:安卓系统的固件版本,全称为“ReadOnly Memory”。
5. Root:对安卓系统进行解锁,以获得更高的权限和更广泛的控制。
6. SDK:安卓软件开发工具包,全称为“Software Development Kit”。
7. UI:用户界面,全称为“User Interface”。
8. UX:用户体验,全称为“User Experience”。
9. Widget:安卓系统中的一个小工具,可以显示在主屏幕上,提供快捷的操作和显示信息。
10. Fragment:安卓系统中的一个组件,用于实现用户界面的模块化。
1. Android Developers:安卓开发者官方网站,提供了丰富的文档、教程和资源,适合开发者学习安卓编程。
2. XDA Developers:一个安卓社区,提供了大量的安卓相关资讯、教程和讨论,适合对安卓系统感兴趣的用户。
3. Android Central:一个专注于安卓系统的新闻网站,提供了最新的安卓资讯、评测和教程。
4. Stack Overflow:一个编程问答社区,提供了大量的安卓编程问题解答,适合开发者解决安卓编程中的问题。
5. Reddit:一个社交新闻网站,有一个专门的安卓子版块,提供了大量的安卓相关讨论和分享。
安卓系统权限中英文对照

安卓系统权限中英文对照网上搜集的安卓系统软件的权限中英文对照程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下:android.permission.ACCESS_CHECKIN_PROPERTIES允许读写访问”properties”表在checkin数据库中,改值可以修改上传( Allows read/write access to the “properties” table in the checkin database, to change value s that get uploaded) android.permission.ACCESS_COARSE_LOCA TION允许一个程序访问CellID或WiFi热点来获取粗略的位置(Allows an application to access coarse (e.g., Cell-ID, WiFi) location) copyright dedecmsandroid.permission.ACCESS_FINE_LOCA TION允许一个程序访问精良位置(如GPS) (Allows an application to access fine (e.g., GPS) location) android.permission.ACCESS_LOCA TION_EXTRA_COMMANDS 允许应用程序访问额外的位置提供命令(Allows an application to access extra location provider commands)android.permission.ACCESS_MOCK_LOCA TION允许程序创建模拟位置提供用于测试(Allows an application to create mock location providers for testing)android.permission.ACCESS_NETWORK_STA TE允许程序访问有关GSM网络信息(Allows applications to access information about networks) android.permission.ACCESS_SURFACE_FLINGER允许程序使用SurfaceFlinger底层特性(Allows an application to use SurfaceFlinger’s low level features)android.permission.ACCESS_WIFI_STA TE允许程序访问Wi-Fi网络状态信息(Allows applications to accessinformation about Wi-Fi networks)android.permission.ADD_SYSTEM_SERVICE允许程序发布系统级服务(Allows an application to publish system-level services).android.permission.BA TTERY_STA TS允许程序更新手机电池统计信息(Allows an application to update the collected battery statistics) android.permission.BLUETOOTH允许程序连接到已配对的蓝牙设备(Allows applications to connect to paired bluetooth devices) android.permission.BLUETOOTH_ADMIN允许程序发现和配对蓝牙设备(Allows applications to discover and pair bluetooth devices) android.permission.BRICK 请求能够禁用设备(非常危险)(Required to be able to disable the device (very *erous!).) android.permission.BROADCAST_PACKAGE_REMOVED 允许程序广播一个提示消息在一个应用程序包已经移除后(Allows an application to broadcast a notification that an application package has been removed)android.permission.BROADCAST_STICKY允许一个程序广播常用intents(Allows an application to broadcast sticky intents) /doc/926213707.html,android.permission.CALL_PHONE允许一个程序初始化一个电话拨号不需通过拨号用户界面需要用户确认(Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.)android.permission.CALL_PRIVILEGED允许一个程序拨打任何号码,包含紧急号码无需通过拨号用户界面需要用户确认(Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed) android.permission.CAMERA请求访问使用照相设备(Required to be able to access the camera device. )android.permission.CHANGE_COMPONENT_ENABLED_STA TE允许一个程序是否改变一个组件或其他的启用或禁用(Allows an application to change whether an application component (other than its own) is enabled or not. )android.permission.CHANGE_CONFIGURA TION允许一个程序修改当前设置,如本地化(Allows an application to modify the current configuration, such as locale. )android.permission.CHANGE_NETWORK_STA TE允许程序改变网络连接状态(Allows applications to change network connectivity state) android.permission.CHANGE_WIFI_STA TE允许程序改变Wi-Fi连接状态(Allows applications to change Wi-Fi connectivity state) android.permission.CLEAR_APP_CACHE 允许一个程序清楚缓存从所有安装的程序在设备中(Allows an application to clear the caches of all installed applications on the device. )android.permission.CLEAR_APP_USER_DA TA允许一个程序清除用户设置(Allows an application to clear user data)android.permission.CONTROL_LOCA TION_UPDA TES允许启用禁止位置更新提示从无线模块(Allows enabling/disabling location update notifications from the radio. ) copyright dedecmsandroid.permission.DELETE_CACHE_FILES允许程序删除缓存文件(Allows an application to delete cache files)android.permission.DELETE_PACKAGES允许一个程序删除包(Allows an application to delete packages) android.permission.DEVICE_POWER允许访问底层电源管理(Allows low-level access to power management)android.permission.DIAGNOSTIC允许程序RW诊断资源(Allows applications to RW to diagnostic resources. )android.permission.DISABLE_KEYGUARD允许程序禁用键盘锁(Allows applications to disable the keyguard ) /doc/926213707.html, android.permission.DUMP允许程序返回状态抓取信息从系统服务(Allows an application to retrieve state dump information from system services.) android.permission.EXPAND_STA TUS_BAR允许一个程序扩展收缩在状态栏,android开发网提示应该是一个类似windows mobile中的托盘程序(Allows an application to expand or collapse the status bar. )android.permission.FACTORY_TEST作为一个工厂测试程序,运行在root用户(Run as a manufacturer test application, running as the root user. ) android.permission.FLASHLIGHT访问闪光灯,android开发网提示htc Dream不包含闪光灯(Allows access to the flashlight ) android.permission.FORCE_BACK 允许程序强行一个后退操作是否在顶层activities(Allows an application to force a BACK operation on whatever is the top activity. )android.permission.FOTA_UPDA TE暂时不了解这是做什么使用的,android开发网分析可能是一个预留权限.android.permission.GET_ACCOUNTS访问一个帐户列表在Accounts Service中(Allows access to the list of accounts in the Accounts Service)android.permission.GET_PACKAGE_SIZE允许一个程序获取任何package占用空间容量(Allows an application to find out the space used by any package. ) android.permission.GET_TASKS允许一个程序获取信息有关当前或最近运行的任务,一个缩略的任务状态,是否活动等等(Allows an application to get information about the currently or recently running tasks: a thumbnail representation of the tasks, what activities are running in it, etc.) android.permission.HARDWARE_TEST允许访问硬件(Allows access to hardware peripherals. )android.permission.INJECT_EVENTS允许一个程序截获用户事件如按键、触摸、轨迹球等等到一个时间流,android 开发网提醒算是hook技术吧(Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.)android.permission.INSTALL_PACKAGES允许一个程序安装packages(Allows an application to install packages. )android.permission.INTERNAL_SYSTEM_WINDOW允许打开窗口使用系统用户界面(Allows an application to open windows that are for use by parts of the system user interface. ) android.permission.INTERNET允许程序打开网络套接字(Allows applications to open network sockets)android.permission.MANAGE_APP_TOKENS允许程序管理(创建、催后、z- order默认向z轴推移)程序引用在窗口管理器中(Allows an application to manage (create, destroy, Z-order) application tokens in the window manager. ) android.permission.MASTER_CLEAR目前还没有明确的解释,android开发网分析可能是清除一切数据,类似硬格机android.permission.MODIFY_AUDIO_SETTINGS允许程序修改全局音频设置(Allows an application to modify global audio settings)android.permission.MODIFY_PHONE_STA TE允许修改话机状态,如电源,人机接口等(Allows modification of the telephony state – power on, mmi, etc. )android.permission.MOUNT_UNMOUNT_FILESYSTEMS允许挂载和反挂载文件系统可移动存储(Allows mounting and unmounting file systems for removable storage. )android.permission.PERSISTENT_ACTIVITY允许一个程序设置他的activities显示(Allow an application to make its activities persistent. )android.permission.PROCESS_OUTGOING_CALLS允许程序监视、修改有关播出电话(Allows an application to monitor, modify, or abort outgoing calls) 内容来自dedecms android.permission.READ_CALENDAR允许程序读取用户日历数据(Allows an application to read the user’s calendar data.)android.permission.READ_CONTACTS允许程序读取用户联系人数据(Allows an application to read the user’s contacts data.)android.permission.READ_FRAME_BUFFER允许程序屏幕波或和更多常规的访问帧缓冲数据(Allows an application to take screen shots and more generally get accessto the frame buffer data)android.permission.READ_INPUT_STA TE允许程序返回当前按键状态(Allows an application to retrieve the current state of keys and switches. )android.permission.READ_LOGS允许程序读取底层系统日志文件(Allows an application to read the low-level system log files. ) android.permission.READ_OWNER_DA TA允许程序读取所有者数据(Allows an application to read the owner’s data) /doc/926213707.html, android.permission.READ_SMS允许程序读取短信息(Allows an application to read SMS messages.)android.permission.READ_SYNC_SETTINGS允许程序读取同步设置(Allows applications to read the sync settings)android.permission.READ_SYNC_STA TS允许程序读取同步状态(Allows applications to read the sync stats)android.permission.REBOOT请求能够重新启动设备(Required to be able to reboot the device. )android.permission.RECEIVE_BOOT_COMPLETED允许一个程序接收到ACTION_BOOT_COMPLETED广播在系统完成启动(Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting. )android.permission.RECEIVE_MMS允许一个程序监控将收到MMS彩信,记录或处理(Allows an application to monitor incoming MMS messages, to record orperform processing on them. )android.permission.RECEIVE_SMS允许程序监控一个将收到短信息,记录或处理(Allows an application to monitor incoming SMS messages, to record or perform processing on them.)android.permission.RECEIVE_WAP_PUSH允许程序监控将收到W AP PUSH信息(Allows an application to monitor incoming WAP push messages. )android.permission.RECORD_AUDIO允许程序录制音频(Allows an application to record audio)android.permission.REORDER_TASKS允许程序改变Z轴排列任务(Allows an application to change the Z-order of tasks)android.permission.RESTART_PACKAGES允许程序重新启动其他程序(Allows an application to restart other applications)android.permission.SEND_SMS允许程序发送SMS短信(Allows an application to send SMS messages)android.permission.SET_ACTIVITY_WA TCHER允许程序监控或控制activities已经启动全局系统中Allows an application to watch and control how activities are started globally in the system. 内容来自dedecmsandroid.permission.SET_ALWAYS_FINISH允许程序控制是否活动间接完成在处于后台时Allows an application to control whether activities are immediately finished when put in the background.android.permission.SET_ANIMA TION_SCALE修改全局信息比例(Modify the global animation scaling factor.) android.permission.SET_DEBUG_APP配置一个程序用于调试(Configure an application for debugging.)android.permission.SET_ORIENTA TION允许底层访问设置屏幕方向和实际旋转(Allows low-level access to setting the orientation (actually rotation) of the screen.) android.permission.SET_PREFERRED_APPLICA TIONS允许一个程序修改列表参数PackageManager.addPackageT oPreferred() 和PackageManager.removePackageFromPreferred()方法(Allows an application to modify the list of preferred applications with the PackageManager.addPackageT oPreferred() and PackageManager.removePackageFromPreferred() methods.) android.permission.SET_PROCESS_FOREGROUND允许程序当前运行程序强行到前台(Allows an application to force any currently running process to be in the foreground.) android.permission.SET_PROCESS_LIMIT允许设置最大的运行进程数量(Allows an application to set the maximum number of (not needed) application processes that can be running. ) copyright dedecmsandroid.permission.SET_TIME_ZONE允许程序设置时间区域(Allows applications to set the system time zone)android.permission.SET_WALLPAPER允许程序设置壁纸(Allows applications to set the wallpaper ) android.permission.SET_WALLPAPER_HINTS允许程序设置壁纸hits(Allows applications to set the wallpaper hints)android.permission.SIGNAL_PERSISTENT_PROCESSES允许程序请求发送信号到所有显示的进程中(Allow an application to request that a signal be sent to all persistentprocesses)android.permission.STA TUS_BAR允许程序打开、关闭或禁用状态栏及图标Allows an application to open, close, or disable the status bar and its icons.android.permission.SUBSCRIBED_FEEDS_READ允许一个程序访问订阅RSS Feed内容提供(Allows an application to allow access the subscribed feeds ContentProvider. )android.permission.SUBSCRIBED_FEEDS_WRITE系统暂时保留改设置,android开发网认为未来版本会加入该功能。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
本科毕业设计(论文) 外文翻译(附外文原文)学院:信息科学与工程学院课题名称:基于腾讯微博开放平台的数字教学交流系统专业(方向):计算机科学与技术班级: BCU09-4学生:周杰伦指导教师:方文山日期: 2013/4/19Android API级别当你开发你的Android应用程序时,了解该平台API变更管理的基本方法和概念是很有帮助的。
同样的,知道API级别标识以及该标识如何保障你的应用与实际硬件设备相兼容对于开发及后续的发布、维护都是有益的。
本节内容告诉你API级别的知识,以及它如何影响你开发和使用的应用。
关于如何使用“以API级别进行过滤”来使用API参考手册,从本文末尾的文档过滤(Filtering the documentation)中可以得到更多信息。
API级别是什么?API级别是一个整数值,它唯一标识了一个具体版本的Android平台,及其框架的API的版本。
Android平台提供了一套框架API,使得应用程序可以与系统底层进行交互。
该框架API由以下模块组成:∙一组核心的包和类∙清单(manifest)文件的XML元素和属性声明∙资源文件的XML元素和属性声明及访问形式∙各类意图(Intents)∙应用程序可以请求的各类授权,以及系统中包含的授权执行每个Android平台的后续版本会包括它提供的更新的Android应用程序框架的API。
该框架的API的更新设计,使高版本的API与早期版本兼容。
也就是说,在新版本API中大多数都是新增功能,和引进新的或替代的功能。
作为API的部分升级,老的替换的部分已过时,但不会从新版本中删除,使得已有的应用程序仍然可以使用它们。
在极少数情况下,旧版本API的部分可能被修改或删除,通常这种变化是为了保障API的稳定性及应用程序或系统的安全。
所有其他早期版本的API将不做修改的保留。
一个Android平台提供的框架API,被指定一个整数标识符,称为“API级别”。
每一个版本的Android平台只支持有一个API级别,虽然该支持是隐含地包括了所有早期的API级别(一直到API级别1级)。
Android平台的最初版本提供的框架API级别是1级,随后的版本依次递增。
下表说明了具体平台版本和支持的API级别的对应关系。
在Android中使用API级别API级别标识为保证用户和应用程序开发者的最佳体验,起了关键作用:∙它让Android平台可以描述它支持的框架API的最高版本∙它让应用程序可以描述它需要的框架API版本∙它使得系统可以在硬件设备上安装应用程序时能够检查版本是否匹配,使得版本不兼容的应用程序不会被错误安装在设备之上.每个版本的Android平台都在其内部存储了自己的API级别标识。
应用程序可以用框架API提供的清单文件元素— <uses-sdk> 来描述该应用程序可以运行的最小和最大API级别,以及应用程序开发者设计期望运行的平台版本。
三种属性分别描述如下:∙android:minSdkVersion—指明该应用程序可以运行的API最低版本。
默认是“1”。
∙android:targetSdkVersion—指明该应用程序设计时期望运行的目标API版本。
在某些情况下,这允许应用程序使用目标API级别下定义的清单元素或行为,而不是只限于使用最低API级别定义的内容。
∙android:maxSdkVersion—指明该应用程序可以运行的最高API级别。
重要声明:使用该属性之前请阅读<uses-sdk>文档。
比如,要指明一个应用程序能够运行的最低API级别,应当在该应用程序的清单文件的<uses-sdk>元素中加入android:minSdkVersion属性。
android:minSdkVersion的值是一个正整数,对应的是该应用程序能够运行的最低平台的API级别标识。
用户尝试安装一个应用程序,或者在系统升级后重验证应用程序的时候,Android系统首先会检查应用程序的清单文件中的<uses-sdk>属性,将其与系统内部API级别对比。
系统只有在满足下列情况时才允许进行应用程序安装:∙如果声明了android:minSdkVersion属性,其属性值必须小于或等于该系统的API 级别对应的整数值。
如果未声明,系统会默认该应用程序运行需要的最低API级别是1。
∙如果声明了android:maxSdkVersion属性,其属性值必须等于或大于该系统的API 级对应的整数值。
如果未声明,系统会默认该应用程序没有最高API级别限制。
请通过阅读文档<uses-sdk>以获得系统如何处理该属性的更多信息。
应用程序清单文件中声明该属性后,<uses-sdk>元素看起来应类似于下面的例子:这样做的主要原因是,应用程序会通过android:miniSdkVersion声明的API级别来告知系统——该应用程序使用的API是指定引入的API级别。
假如没有这种属性声明,一个应用程序如果因为某些不知名的原因被安装在低级别API系统之上,那么该应用程序会在运行时因为尝试访问不存在的API而崩溃。
为此,Android 系统通过不允许应用程序被安装在不满足其最低API级别要求的目标硬件上来防止此类结果发生。
例如,android.appwidget类包是在API级别3中开始引入的。
如果一个应用程序使用了这个API,就必须通过指明android:minSdkVersion属性为3来声明运行的最低要求。
于是,该应用程序就可以在Android 1.5(API级别3级)、Android1.6 (API级别4级)等平台上安装,但是在Android 1.1 (API级别2级)和 Android1.0 平台(API级别1级)上却是无法安装的。
欲知关于如何声明应用程序API级别需求的更多信息,请阅读文档中关于清单文件的<uses-sdk>章节。
开发者需要考虑的内容本节属于应用程序开发者需要了解的内容。
应用程序的向前兼容性Android应用程序一般向前兼容于Android平台的新版本。
这是因为几乎所有的框架API变更都是添加性质的,一个以某种版本的API 开发的应用程序是向前兼容与后续Android系统及高版本API。
应用程序应当可以运行于高版本的平台,除非使用了未来因某种原因移除的API。
向前兼容性的特性如此重要,是因为很多的Android驱动的设备能够使用OTA远程下载技术进行系统更新。
用户开始时能够很好的安装和使用你开发的应用程序,后来进行了OTA升级到新版本的Android平台。
一旦升级完毕,你的应用程序将运行在一个新的版本环境下,而这个环境应当包含了你的应用程序所需的API和系统功能。
某些情况下,API背后的变化,例如系统底层的变化,可能会影响到你的应用程序运行在新的环境下。
为此,作为应用程序开发人员,应当了解应用程序在不同系统环境下将会有如何的外观和行为。
Android SDK包含了多个平台版本,开发人员可以下载下来,用于测试自己的应用程序在不同版本下的运行情况。
每个版本的平台都提供了兼容的系统镜像,你可以将应用程序运行在对应的Android虚拟设备(模拟器)上进行测试。
应用程序的向后兼容性Android应用程序不一定向后兼容于那些比这些应用程序开发环境低的平台环境。
Android平台的每个新版本包含了新的框架API,例如新的平台功能,或者替代部分已有的API。
应用程序在新平台上可以访问这些新的API,就像之前提到的,在后续更新的版本中,这些新功能API也是可以继续使用。
相反的,因为早期版本的平台不会包含新的API功能,使用了新API的应用程序在那些旧平台上是无法运行的。
虽然一个Android平台设备不太可能降级到以前的版本,但是需要了解的是:实际生活中可能会有很多设备运行的是较旧的平台版本。
即使在设备接收到OTA 远程下载升级,有些人仍然可能会滞后甚至可能不会收到更新。
平台版本和API级别的选择当你开发应用程序时,你需要选择一个平台用于编译该应用程序。
通常,你应该在你的应用程序可以支持的最低版本的平台上进行编译。
你可以通过寻找最低的可以支持你的应用程序编译的平台方式来决定你将会支持的最低平台版本。
一旦你确定了支持的最低版本后,你就可以创建对应版本的AVD模拟器来全面测试你的应用程序。
你需要注意的是不要忘记在应用程序清单文件中申明android:minSdkVersion属性,并赋上正确的API级别标识。
声明最低API级别如果你开发的应用程序使用了最新平台上引入的API或平台特性,你就需要将android:minSdkVersion属性赋最新平台的API级别标识。
这将保证用户只能在他们的设备与你的应用程序平台版本兼容情况下安装。
反过来说,这样能够保证你的应用程序在他们的设备上表现正常。
如果你用了最新的API或平台特性,但是没有申明android:minSdkVersion属性,那么你的应用程序在最新平台上运行是没有稳定,但是在早期版本的平台上是会出错的。
在后一种情况,应用程序在尝试访问旧平台上不存在的API时会崩溃。
针对高版本的API级别测试编译完你的应用程序,你应当在支持的最低版本平台上详细测试应用程序的表现。
可以通过创建对应平台的AVD模拟器进行测试。
此外,要保证向前兼容性,你应当在你的应用程序可能运行的更高平台版本上进行运行和测试。
Android SDK包含了多个平台版本供开发者使用,其中包括了最新的版本,并且提供了升级工具使得开发者可以获取其他的版本。
要使用升级工具,可以通过Android命令行方式,该工具位于<sdk>/tools路径下。
你可以用敲入android指令运行该升级工具,而不用指定任何参数。
你也可以简单地通过双击Windows下的android.bat或OS X/Linux下的android文件来启动升级工具。
在ADT工具界面,你可以通过菜单的Window > Android SDK and AVD Manager来访问升级工具。
要想将你的应用程序在不同平台版本的模拟器上运行,需要创建对应的AVD 设备。
关于AVD的更多信息,请参见Creating and Managing Virtual Devices。
如果你用物理设备进行测试,确保清楚运行的具体平台版本。
通过本文开始部分的映射表格可以知道平台版本对应的API级别标识。
使用临时的API级别某些情况下,有可能会发布“早期预览(Early Look)”版的Android 平台SDK。
在此平台版本上开发使用的API将不会是最终发布版,平台的API级别标识数字就不会指定。