Android毕设外文资料和译文

合集下载

外文文献-The basic of description of android system对Android系统的基本描诉

外文文献-The basic of description of android system对Android系统的基本描诉

外文文献-The basic of description of android system对Android系统的基本描诉毕业设计外文文献原文及译文The basic of description of android system对Android系统的基本描诉学生姓名: 学号:电子与计算机科学技术系系别:计算机科学与技术专业:指导教师:2015年 5 月2015届毕业设计外文文献原文及译文The basic of description of android systemBy 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 supportthis 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. 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 JAVA middle ware, the middle ware running on the embeddedLinux kernel. Therefore, developers should deploy their applications to the Android must use a custom user interface environment.In addition, the android system applications limit the applicationto call each other API .Although these applications have certain safety features, some ofour experienced developers to create Android applications who revealed that the design of security2015届毕业设计外文文献原文及译文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 SDK .The 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 start up, 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.Content Provider 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 (for example 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.2015届毕业设计外文文献原文及译文Therefore, the radio receiver subscribe to these destinationsreceive 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 start Service (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.Android applications are written in the Java programminglanguage.The compiled Java code — along with any data and resource files required by the application — is bundled bythe apt tool into an Android package,an archive file marked by an .A 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 Linuxprocess.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.2015届毕业设计外文文献原文及译文(3) By default,each application is assigned a unique Linux userID.Permissions are set so that the application's files are visible only to that user and only to the application itself there are ways to export them to other applications as well.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 and made it available to others,you can call upon that 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 isneeded,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(nomain()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.Moving2015届毕业设计外文文献原文及译文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 andfloat on top of other windows.An activity can also make use ofadditional windows — for example,a pop-up dialog that calls for a user response in the midst of the activity,or a window that presentsusers 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 thatimage.Android has a number of ready-made views that you can use —including buttons,text fields,scroll bars,menu items,check boxes,and more.ServicesA service doesn't have a visual user interface,but rather runs inthe 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 theuser 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 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 startthe service if it's not2015届毕业设计外文文献原文及译文already running).While connected,you can communicate with theservice through an interface that the service exposes.For the music service,this interface might allow users to pause,rewind,stop,andrestart 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 fortime-consuming tasks(like music playback).See Processes and Thread,later.Broadcast receiversA broadcast receiver is a component that does nothing but receiveand react to broadcast announcements.Many broadcasts originate in system code — for example,announcements thatthe 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 letother 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 Broadcast Receiver 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 Notification Manager to alert the user.Notifications can get the user's attention in various ways — flashing the back light,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 database,or in any other manner that makes sense.The content provider extends the Content Provider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it2015届毕业设计外文文献原文及译文controls.However,applications do not call these methodsdirectly.Rather they use a Content Resolver object and call its methods instead.A Content Resolver can talk to any content provider;it cooperates with the provider to manage any inter process 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.2015届毕业设计外文文献原文及译文The basic of description of android system对Android系统的基本描诉由开放手机联盟(Open Handset Alliance LED通过谷歌)开发的安卓系统是一个开源的手机系统被广泛看好,该系统提供了一个基本的操作系统,中间件的应用层,一个Java开发工具和应用系统集热器(系统应用收集)。

Android应用基础毕设论文外文翻译

Android应用基础毕设论文外文翻译

Android应用基础毕设论文外文翻译Android ns are developed using the Java programming language。

The Android SDK tools are used to compile the code。

data。

and resource files into an Android package。

which is an archive file with an。

apk n。

A single。

apk file contains all the code for an n and is used by Android-powered devices to install the n.After n。

each Android n XXX。

The Android operating system is a multi-user Linux system。

and each n is treated as a separate user。

By default。

the system assigns a unique Linux user ID to each n。

which is only known to the system and not to the n。

The system sets ns for all files in an n。

so that only the user ID assigned to that n can access them.Furthermore。

each process has its own virtual machine (VM)。

which means that an n's code XXX that an n's code cannot interfere with the code of other ns.By default。

Android外文文献翻译

Android外文文献翻译

An droid Applicati on Fun dame ntalsAn droid applicatio ns are writte n in the Java program ming Ian guage. The An droid SDK tools compile the code— along with any data and resource file—into an An droid package, an archive file with an .apk suffix. All the code in a single .apk file is considered to be one applicatio n and is the file that An droid-powered devices use to in stall the applicatio n.Once in stalled on a device, each An droid applicati on lives in its own security san dbox:The An droid operati ng system is a multi-user Linux system in which each applicatio n is a differe nt 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 applicati ons.By default, every applicatio n runs in its own Linux process. An droid starts the process whe n any of the applicati on's comp onents n eed to be executed, the n shuts dow n the process whe n it's no Ion ger n eeded or whe n the system must recover memory for other applicati ons. In this way, the An droid system impleme nts thepri nciple 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 en vir onment in which an applicati on cannot access parts of the system for which it is not give n permissi on.However, there are ways for an applicati on to share data with other applicati ons and for an applicati on to access system services:It's possible to arrange for two applicati ons to share the same Linux user ID, in which case they are able to access each other's files. To con serve system resources, applicati ons 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 applicatio n can request permissi on to access device data such as the user's con tacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All applicatio n permissi ons must be gran ted by the user at in stall time.That covers the basics regardi ng how an An droid applicati on exists withi n the system. The rest of this docume nt in troduces 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 applicati on.3、Resources that are separate from the application code and allow your application to gracefully optimize its behavior for a variety of device con figurati ons.Applicati on Comp onentsApplicatio n comp onents are the esse ntial build ing blocks of an An droid applicati on. Each comp onent is a differe nt point through which the system can en ter your applicati on. Not all comp onents are actual entry points for the user and some depe nd on each other, but each one exists as its own entity and plays a specific ro—each one is a unique building block that helps define your application's overall behavior.There are four differe nt types of applicati on comp onen ts. Each type serves a disti net purpose and has a distinct lifecycle that defines how the component is created and destroyed.Here are the four types of applicati on comp onen ts:ActivitiesAn activity represe nts a sin gle scree n with a user in terface. 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 experie nee in the email applicati on, each one is in depe ndent 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 applicati on that composes new mail, in order for the user to share a picture.An activity is implemented as a subclass oActivity and you can leann more about it in the Activities developer guide.ServicesA serviceis a comp onent that runs in the backgro und to perform long-running operatio nsor to perform work for remote processes.A service does not provide a user in terface. Forexample, 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 in teract 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 man ages a shared set of applicati on 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 even modify the data (if the content provider allows it). For example, the An droid system provides a content provider that man ages the user's con tact in formati on. As such, any applicati on with the proper permissi ons can query part of the content provider (such a Con tactsC on tract.Data) to read and write in formati on about a particular pers on.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 no tes.A content provider is implemented as a subclass o ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions. For more in formati on, see the Co ntent Providers developer guide.Broadcast receiversA broadcast receiver is a component that responds to system-wide broadcast announ ceme nts. Many broadcasts orig in ate 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 in terface, they may reate a status bar notificati on to alert the user whe n a broadcast eve nt occurs. More com monly, though, a broadcast receiver is just a "gateway" to other comp onents and is inten ded to do a very mini mal amount of work. For in sta nee, it might in itiate a service to perform some work based on the eve nt.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.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 itin 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 even modify 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 a C s ontactsContract.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.。

Android外文文献翻译

Android外文文献翻译

A n d r o i d外文文献翻译 Company number:【0089WT-8898YT-W8CCB-BUUT-202108】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.apksuffix. All the code in a single.apkfile 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 one exists 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 ofand you can learn more about it in thedeveloper 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 and you can learn more about it in thedeveloper 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 even modify 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 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 sample application uses a content provider to save notes.A content provider is implemented as a subclass ofand must implement a standard set of APIs that enable other applications to perform transactions. For more information, see the developer guide.Broadcast receiversAbroadcast receiveris 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 mayto 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 and each broadcast is delivered as an object. For more information, see the class.A unique aspect of the Android system design is that any application can start another application’s component. For example, i f 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 nomain()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 messengersthat request an action from other components), whether the component belongs to your application or another.An intent is created with an 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(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. 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 on the 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 passing antoor(when you want the activity to return a result).You can start a service (or give new instructions to an ongoing service) by passing anto. Or you can bind to the service by passing an to.You can initiate a broadcast by passing anto methods like,, or.You can perform a query to a content provider by calling on a.For more information about using intents, see the document. More information about activating specific components is also provided in the following documents:,,and.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?element, the android:icon attribute points to resources for an icon that identifies the application.In theelement, theandroid:name at tribute specifies the fu lly qualified class name of the subclass and theandroid:label attributes specifies a string to use as the user-visible label for the activity.You must declare all application components this way:1、elements for activities2、elements for services3、elements for broadcast receivers4、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 objects) and registered with the system by calling.Declaring component capabilitiesAs discussed above, in, you can use anto 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 whi ch 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 adding an 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(), which the system matches to the email application’s “send” activity and launches it when you invoke the intent with.For more about creating intent filters, see thedocument.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 (7), 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 cannot install your application from Google Play.However, you can also declare that your application uses the camera, but does not 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 with the?element.For more information, see the?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 withthe?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 with theelement.Platform VersionDifferent Android-powered devices often run different versions of the Android platform, such as Android or Android . 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(for example, Android is API Level 1 and Android is API Level 9). If you use any APIs that were added to the platform after version , you should declare the minimum API Level in which those APIs were introduced using theelement.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 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 ofyour 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? (saved in the res/drawable/ directory), the SDK tools generate a resource IDOne 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 thedeveloper guide.安卓应用基础在Java编程语言编写的Android应用程序的Android的SDK工具编译代码以及与任何数据和到一个Android的包,一个归档文件档案资源的.apk后缀,所有的在一个单一的代码.apk文件被认为是一个应用程序,是Android的文件,供电设备来安装应用程序。

基于Android开发的外文文献

基于Android开发的外文文献

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-party applications—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 embedded system apps a greater execution priority than the thread priority available to apps created by third-party developers. Also, each application is executed within its own thread using a very lightweight virtual machine.Aside from the very generous SDK and the well-formed libraries that are available to us to develop with, the most exciting feature for Androiddevelopers is that we now have access to anything the operating system has access to. In other words, if you want to create an application that dials the phone, you have access to the phone’s dialer; if you want to create an application that utilizes the phone’s internal GPS if equipped, you have access to it. The potential for developers to create dynamic and intriguing applications is now wide open.On top of all the features that are available from the Android side of the equation, Google has thrown in some 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 is emanating from, or you want to be able to store common search results with your contacts; the doors of possibility 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 usin g specific development environments or integrated development environments IDE, and you will download and install the Java IDE Eclipse.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. 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 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 responsein 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 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.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 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.Key Skills & Concepts● Creating new Android projects● Working with Views● Using a TextView● Modifying the main.xml fileCreating Your First Android Project in EclipseTo start your first Android project, open Eclipse. When you open Eclipse for the first time, it opens to an empty development environment see Figure 5-1, which is where you want to begin. Your first task is to set up and name the workspace for your application. Choose File | New | Android Project, which will launch 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.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 into the Android Emulator. This allows you to code using all of the Android libraries and packages, and also lets 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 blocks upon which you will be building your programs. In much the same way as creating a Microsoft application 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. In addition, the New Android Projectwizard 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 title HelloWorldText. This name sufficiently distinguishes this Hello World project from the others that you will be creating in this chapter.In the Contents area, keep the default selections: the Create New Project in Workspace 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 of keeping 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-based environment, this path points to your $HOME directory.If you are working in a Microsoft Windows environment, the workspace path will be C:/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.。

Android外文文献翻译

Android外文文献翻译

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。

Android应用基础毕设论文外文翻译

Android应用基础毕设论文外文翻译

英文文献原文:Android Application Fundamentals Androidapplicationsare written in the Java programming language. The Android SDK tools compile the code—along with any data and resource files—into an Android package, anarchive filewith 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). Thesystem 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:∙The core framework components that define your application.∙The manifest file in which you declare components and required device features for your application.∙Resources that are separate from the application code and allow your application to gracefully optimize its behavior for a variety of deviceconfigurations.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 one exists 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, adifferent application can start any one of these activities (if the emailapplication 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 sharea 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-runningoperations or to perform work for remote processes. A service does notprovide a user interface. For example, a service might play music in thebackground 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 moreabout it in the Services developer guide.Content providersA content provider manages a shared set of application data. You can storethe data in the file system, an SQLite database, on the web, or any otherpersistent storage location your application can access. Through the content provider, other applications can query or even modify the data (if the content provider allows it). For example, the Android system provides a contentprovider 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 particularperson.Content providers are also useful for reading and writing data that is private to your application and not shared. For example, the Note Pad sampleapplication uses a content provider to save notes.A content provider is implemented as a subclass of ContentProvider and mustimplement a standard set of APIs that enable other applications to perform transactions. For more information, see the Content Providers developerguide.Broadcast receiversA broadcast receiver is a component that responds to system-wide broadcastannouncements. 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 thedevice 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 andeach 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 applicat ion’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 canissue 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. The 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 on the 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 passing an Intent to startActivity() or startActivityForResult() (when you want theactivity to return a result).∙You can start a service (or give new instructions to an ongoing service) by passing an 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 methods like 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.中文翻译Android应用基础用Java编程语言编写的Android应用程序,被Android的SDK工具将它和数据以及资源文件编译到一个以.apk为后缀的Android程序包。

毕业设计--基于Android的电子词典软件的设计与实现 (含外文翻译)

毕业设计--基于Android的电子词典软件的设计与实现 (含外文翻译)

LANZHOU UNIVERSITY OF TECHNOLOGY毕业设计基于Android的电子词典软件的设计与实现学生姓名学号专业班级指导教师学院计算机与通信学院摘要本文设计了基于Android平台的电子词典软件。

此英文词典包括两部分,一部分是离线的英文词典,一部分是在线的英文词典。

离线的英文词典主要是使用Android自带的轻量级数据库SQLite来保存单词信息,系统通过SQLite数据库的query方法来查找到与指定英文相对应的单词的中文释义。

在线的英文词典是利用oracle数据库来保存单词信息,然后利用Http 协议解析出单词信息显示到手机界面上,同时还能够增加、删除、更新单词信息。

当然,对于查询到的生疏的单词可以添加到单词本以便于随时复习。

关键词:Android,oracle数据库,SQLite数据库,英文单词AbstractIn this paper, we design and implementation about electronic dictionary software which is based on the Android platform. English dictionary mainly include two parts, and one is to realize the offline English dictionary, the other is to realize the online English dictionary. Offline English dictionary is mainly used a lightweight database SQLite that belongs to Android to preserve words information, we find the specified English word corresponding to the Chinese interpretation by using query method of SQLite database. Offline English dictionary use an oracle database to save the word information, and then parse out the word information to display in the mobile phone interface by Http protocol, at the same time there have the functions that is used to increase, delete, update word information. Of course, we can add unfamiliar word to the note of word in order to review at any time.Keywords: Android; oracle database; SQLite database; English words目录第1章绪论 (1)第2章系统需求分析 (3)2.1 软件的功能要求 (3)2.2 需求分析 (3)2.3 功能需求(用例图分析) (4)2.3.1 基本功能需求例图 (4)2.3.2 离线词典的例图 (6)2.3.3 在线查询用例图 (7)2.3.4 添加到单词本的用例图 (8)2.4 系统结构图和流程图 (10)2.5 系统界面需求 (14)2.6 运行环境 (15)2.6.1 关键技术 (15)2.6.2 运行环境 (16)第3章数据库的设计 (16)3.1 在线词典的服务器端的数据库设计 (16)3.1.1 数据库中数据表的设计 (16)3.1.2 在线词典的客户端的数据库设计 (17)3.1.3 离线时的数据库的设计 (18)3.1.4 软件数据模型 (19)3.2 连接数据库 (20)3.2.1 数据库的创建 (20)3.2.2.数据库的操作 (20)3.2.3 数据的查看 (21)3.2.4 服务器和客户端的连接 (21)第4章环境的搭建 (23)4.1关于Android的简单介绍 (23)4.1.1 Android环境的搭建 (23)4.1.2Android命令行的使用 (24)4.1.3 Android工程的简单介绍 (25)4.2 Java Web环境的搭建 (28)第5章具体功能模块的设计 (31)5.1 查询模块的设计 (32)5.1.1 离线查询 (32)5.1.2 在线查询 (33)5.2 添加单词模块 (35)5.3 删除单词模块 (36)5.4 修改单词模块 (37)5.5 菜单模块的实现 (38)5.6 生词本模块的设计 (42)第6章系统测试与性能分析 (44)6.1测试 (44)6.2 性能测试及分析 (45)总结 (46)参考文献 (47)附录一:英文翻译原文 (48)附录二:英文翻译译文 (56)附录三:程序清单 (63)致谢 (70)第1章绪论如今,英语在人们的工作、学习中显得越来越重要,而手机词典软件的出现无疑带来了极大的便利,遇到遇到生疏的英语单词,现在拿起手机就能轻松解决。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

东北大学东软信息学院外文资料和译文专业:计算机科学与技术(嵌入式软件开发方向)班级:计嵌入式000000姓名:XXXX学号:08111XXXXX指导教师:XXXX教授2011 年 12 月 18 日译文这篇文档主要讲述Android应用框架的核心原则。

站在高层来说,以用户为中心来设计良好的交互程序,对于应用设计者或是开发者来说是非常重要的。

下面用例子来阐述了activities和tasks的一些底层原则和机制,例如导航,多任务,activity重用,意图和activity栈。

这篇文档也着重讨论了一些设计决策,针对如何利用好它们去设计你的应用程序UI。

这篇文档中的例子均是Android应用程序,包括默认应用程序(比如拨号器)、Google 应用程序(比如地图)。

你可以自己在Android模拟器上或是Android手机上去试验这些例子。

如果你使用Android手机试验时,可能未提供本文档中的某些例子。

Applications, Activities, Activity Stack and Tasks 理解Android系统中的四个基本概念对你是很有帮助的,它们分别是:Applications(应用)Activities(活动)Activity Stack(活动堆栈)Tasks(任务)Applications一个Android应用程序其实就是由一个或者多个Activity组成。

它们被捆绑在一起并存放进.apk文件中,这就是Android应用程序。

Android中有着丰富的应用程序,比如邮件、日历、地图定位、文本消息、联系人、照相机、打电话、音乐播放器,系统设置等应用。

一般情况下,桌面上都会有Android应用程序快捷图标,用户可以选择某一个图标来启动应用程序。

ActivitiesActivity是Android应用程序的主要组成部分,activity可以是你自己创建的,当然,还可以是其它应用程序中的activity。

它们都是在运行时绑定上的,以便于应用程序扩展其自身的功能,它们一旦组合在一起,就会如同一个应用程序一样。

每个activity都有其独特的UI、明确的功能,诸如打电话、看照片、听音乐等。

任何一个应用程序都应至少有一个activity。

当使用Android手机时,用户在屏幕上一个接一个地滑动或是点击图标启动activity,完全不会注意到底层的行为——他们体验是无缝的。

activity后面有activity,task后面还会有task。

Activity可以处理特定的数据类型和接受一相关的动作。

每个activity都有其各自的生命周期,互不干扰;并且它们都可以被用户或者系统独立启动、运行、暂停、恢复运行、停止、重新开始。

正因为这个独立性,activity可以以不同的方式被其它的activity 进行替换。

Activity是Android应用中最为突出的组件,其余组件分别为:service、content provider、broadcast receiver。

Activity Stack用户之所以能够从一个activity转到下一个activity,是因为Android系统针对activity而设计了一个线性的导航历史以供用户追溯访问,这就是activity栈,也称为back stack。

当用户启动了一个新的activity,它就被添加进activity栈,以便按BACK 键时能够返回到上一个activity。

然而,用户不能按BACK键就直接返回到桌面(除非activity的前一个是桌面才可以)。

activity栈里面存放的只能是activity,而视图、窗体、菜单和对话框则不能。

也就是说,如果你可以让用户从屏幕A跳转到屏幕B,当用户按BACK键时,他就应该会回到屏幕A,那屏幕A必须是一个activity。

有个例外情况就是,你的应用程序需要利用BACK键控制自身的导航,那就要自己重新设定BACK键的导航功能。

Tasks任务则是一系列的activity集合,它能使用户完成既定的操作,而又不用去关心这些activity是哪个应用程序里面的,除明确指定一个新任务之外(参见“中断任务”小段),那么其他activity都属于当前任务的一部分。

再次注意的是,这些activity可是任意应用程序中的其中一个,也就是说不管它们所属的应用程序是否相同。

举个例子,用户打开了联系人的程序,任务随之也会启动,他选择了email地址准备发邮件,这时跳转到了email activity,之后他要添加附件,需要在相册中挑选图片。

这里面,联系人,email,图片相册都是不同的应用程序。

当一个activity启动时,任务也随之启动的话,那个activity就是根activity。

启动activity一般有这么几种方式,应用程序发射器、桌面快捷方式、最近任务切换器。

Android系统内部一旦有任务,那么按BACK键就可以回到上一个activity。

Activity栈可以是多个任务的组成部分。

下面是关于任务的例子,以供参考:发送文本消息并含有附件观看YouTube视频并以邮件的方式向其他人分享。

中断任务——任务中有一个重要特性就是能使用户中断当前正在做的操作(他们的任务)而去执行其它操作,当然他们也可以回到之前的任务上,也就是说支持同时运行多任务并且来回切换它们。

这里有两种情况来开始其它任务,并且都可以返回到原先的任务上。

打开通知:用户接收到通知并打开查看它。

用户转去做其它操作:用户在桌面启动。

当然,也有例外的。

除了刚才提到的两种方式,另外还有一种打开新任务的情况,就在其内部开启一个activity。

例如,在邮件中以新任务的方式打开地图activity或是打开一个浏览器activity,当按BACK键时就又会回到邮件activity中。

Activities和Tasks之旅下面的例子阐述了应用程序的基本原则,主要有activities,activity栈,回退键,任务和意图;并展示了系统是如何响应用户请求的,例如用户开始了一个应用程序,用户不断的切换UI,程序内部就是利用在不同任务之间切换activities的。

下面的许多例子你都可以在Android手机上运行起来。

在桌面上开始一个Activity桌面是启动应用程序的主要地方,比如在桌面上点击应用程序图标就能将其打开,用户第一眼看到的就是应用程序中的主activity。

用BACK和HOME键进行导航Activity保持或者丢掉其状态完全取决于用户是怎样离开这个activity的——使用HOME键还是BACK键。

默认情况下,按下BACK键来结束(销毁)当前activity并为用户显示上一个activity。

此外,也不是所有activity都是当按下BACK键之后销毁掉的。

例如用户开始播放音乐,接着按下BACK键,却不会影响音乐的播放。

即使它的activity不再可见,音乐应用程序依然会在状态栏上提示着用户。

注意:你也可以让activity不再可见时停止掉或是继续在后台运行,但后者更适合像音乐这样的应用程序。

重用activity有两个应用程序中,它们分别也有两个activity:activity A 和activity B。

A的部分功能需要调用B的已实现功能,那么B就叫被重用。

联系人重用相册来获取图片—联系人activity中会有联系人的照片,但是照片一般存放在相册里面,所以联系人要重用相册的功能来获取图片,相册activity就是重用的绝佳例子。

替换activity这个例子描述的是不用应用程序中的两个activity互相替换,activity A替换activity B。

这种一般发生在activity A比activity B的功能更为强大一些。

换句话来说,A和B妥妥得等价,当然就可以实现A替换B。

这个例子中的联系人应用程序重用了activity,A和B虽然是完全不同的activity,但是它们两个彼此形成了互补,使程序更加的强大。

多任务如前所述,当一个activity启动后,用户还可以回到桌面启动第二个activity,第一个activity则不会被销毁还是继续运行着,我们换个例子来说明这一小节——地图应用程序。

状态1:用户打开了地图应用程序并查询一个地址。

这时,用户该说了,网络太慢了!因为地图定位是需要一些时间的。

状态2:用户准备做些其它事情,按下HOME键,不过这样做不会干扰地图应用程序,还是保持其加载地图的状态。

状态3:地图activity现在是在后台运行着,桌面在来到了前台。

这时用户打开了日历activity,比如查看今天是星期几。

状态4:用户回到桌面,重新打开Map,这时地图已经全部加载完毕了。

以上两个应用程序“地图”和“日历”是两个不同的任务,因此Android支持多任务模式。

切换任务下面的例子描述的是用户如何在两个任务之间进行切换。

1.开始第一个任务。

你想要发送一条短消息并附加一张图片。

你会这样操作:桌面 > 短消息 > 新的短信息 > 菜单 > 附件 > 图片。

最后一步启动了相册activity来选择一张照片。

注意相册是另外的一个应用程序。

在选择照片之前,可以先去桌面打开日历,目的是为了开始第二个任务。

2.开始第二个任务。

你会这样操作:桌面 > 查看日历。

从桌面上打开日历,就等于是开始一个新任务了。

3.切换到第一个任务并完成后面的操作。

查看完日历之后,继续回到先前的任务上:桌面 > 短消息,此时进入的并不是短消息activity,而是相册activity,也就是之前离开的activity。

然后你就可以选择图片并发送短消息出去了,也就完成了第一个任务。

设计小贴士下面的提示和指导都是针对应用设计者和开发者而提出的。

使用显式意图来防止外部应用调用你的activity如果你不想自己的activity被外部使用,就别在manifest.xml里面配置intent-filter。

这样的话,你的activity就只会在应用程序内部来启动了,同样也避免了安全漏洞。

反之,创建一个意图并指定明确要启动的组件,这就是显示意图,在这个例子中,就不需要intent filters。

Intent filters可以发布所有的应用程序,当你创建了一个intent filter时,其它应用程序就可以访问到你的activity了,至于它们怎么用,你就不知道了,这意味着不经意间形成了安全隐患。

思考:以怎样的方式来启动activity做为Android设计者或开发者,完全取决于用户如何启动你的应用程序,而应用程序则是由一系列的activity组成,用户会从Home或是其他应用程序中启动这些activity。

相关文档
最新文档