Lines Matching full:application
1 page.title=Application Fundamentals
9 <li>Android applications are composed of one or more application components (activities,
11 <li>Each component performs a different role in the overall application behavior, and each
13 <li>The manifest file must declare all components in the application and should also declare
14 all application requirements, such as the minimum version of Android required and any hardware
16 <li>Non-code application resources (images, strings, layout files, etc.) should include
24 <li><a href="#Components">Application Components</a>
32 <li><a href="#DeclaringRequirements">Declaring application requirements</a></li>
35 <li><a href="#Resources">Application Resources</a></li>
43 to be one application and is the file that Android-powered devices use to install the
44 application.</p>
46 <p>Once installed on a device, each Android application lives in its own security sandbox: </p>
49 <li>The Android operating system is a multi-user Linux system in which each application is a
52 <li>By default, the system assigns each application a unique Linux user ID (the ID is used only by
53 the system and is unknown to the application). The system sets permissions for all the files in an
54 application so that only the user ID assigned to that application can access them. </li>
56 <li>Each process has its own virtual machine (VM), so an application's code runs in isolation from
59 <li>By default, every application runs in its own Linux process. Android starts the process when any
60 of the application's components need to be executed, then shuts down the process when it's no longer
65 each application, by default, has access only to the components that it requires to do its work and
66 no more. This creates a very secure environment in which an application cannot access parts of
69 <p>However, there are ways for an application to share data with other applications and for an
70 application to access system services:</p>
77 <li>An application can request permission to access device data such as the user's
79 application permissions must be granted by the user at install time.</li>
82 <p>That covers the basics regarding how an Android application exists within the system. The rest of
85 <li>The core framework components that define your application.</li>
87 application.</li>
88 <li>Resources that are separate from the application code and allow your application to
94 follow the Beginner's Path link at the bottom of this page. For each document in the Application
100 <h2 id="Components">Application Components</h2>
102 <p>Application components are the essential building blocks of an Android application. Each
103 component is a different point through which the system can enter your application. Not all
106 helps define your application's overall behavior.</p>
108 <p>There are four different types of application components. Each type serves a distinct purpose
111 <p>Here are the four types of application components:</p>
118 an email application might have one activity that shows a list of new
120 the activities work together to form a cohesive user experience in the email application, each one
121 is independent of the others. As such, a different application can start any one of these
122 activities (if the email application allows it). For example, a camera application can start the
123 activity in the email application that composes new mail, in order for the user to share a picture.
136 the user is in a different application, or it might fetch data over the network without
148 <dd>A <i>content provider</i> manages a shared set of application data. You can store the data in
150 application can access. Through the content provider, other applications can query or even modify
152 provider that manages the user's contact information. As such, any application with the proper
157 application and not shared. For example, the <a
158 href="{@docRoot}resources/samples/NotePad/index.html">Note Pad</a> sample application uses a
191 <p>A unique aspect of the Android system design is that any application can start another
192 application?s component. For example, if you want the user to capture a
193 photo with the device camera, there's probably another application that does that and your
194 application can use it, instead of developing an activity to capture a photo yourself. You don't
195 need to incorporate or even link to the code from the camera application.
196 Instead, you can simply start the activity in the camera application that captures a
197 photo. When complete, the photo is even returned to your application so you can use it. To the user,
198 it seems as if the camera is actually a part of your application.</p>
200 <p>When the system starts a component, it starts the process for that application (if it's not
202 application starts the activity in the camera application that captures a photo, that activity
203 runs in the process that belongs to the camera application, not in your application's process.
207 <p>Because the system runs each application in a separate process with file permissions that
208 restrict access to other applications, your application cannot directly activate a component from
209 another application. The Android system, however, can. So, to activate a component in
210 another application, you must deliver a message to the system that specifies your <em>intent</em> to
220 to your application or another.</p>
276 <p>Before the Android system can start an application component, the system must know that the
277 component exists by reading the application's {@code AndroidManifest.xml} file (the "manifest"
278 file). Your application must declare all its components in this file, which must be at the root of
279 the application project directory.</p>
281 <p>The manifest does a number of things in addition to declaring the application's components,
284 <li>Identify any user permissions the application requires, such as Internet access or
287 required by the application, based on which APIs the application uses.</li>
288 <li>Declare hardware and software features used or required by the application, such as a camera,
290 <li>API libraries the application needs to be linked against (other than the Android framework
300 <p>The primary task of the manifest is to inform the system about the application
306 <application android:icon="@drawable/app_icon.png" ... >
311 </application>
315 href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code>
317 application.</p>
325 <p>You must declare all application components this way:</p>
348 <p>For more about how to structure the manifest file for your application, see <a
369 <p>When you declare a component in your application's manifest, you can optionally include
375 <p>For example, an email application with an activity for composing a new email might declare an
377 activity in your application can then create an intent with the ?send? action ({@link
378 android.content.Intent#ACTION_SEND}), which the system matches to the email application?s ?send?
388 <h3 id="DeclaringRequirements">Declaring application requirements</h3>
391 same features and capabilities. In order to prevent your application from being installed on devices
392 that lack features needed by your application, it's important that you clearly define a profile for
393 the types of devices your application supports by declaring device and software requirements in your
398 <p>For example, if your application requires a camera and uses APIs introduced in Android 2.1 (<a
401 Android version <em>lower</em> than 2.1 cannot install your application from Google Play.</p>
403 <p>However, you can also declare that your application uses the camera, but does not
404 <em>require</em> it. In that case, your application must perform a check at runtime to determine
408 develop your application:</p>
420 <p>By default, your application is compatible with all screen sizes and densities,
424 your manifest exactly which screen sizes your application supports with the <a
433 trackball, or a five-way navigation pad. If your application requires a particular kind of input
436 <uses-configuration>}</a> element. However, it is rare that an application should require
444 Android library), so you should declare any features used by your application with the <a
460 <p>It's important that you declare all such requirements for your application, because, when you
461 distribute your application on Google Play, the store uses these declarations to filter which
462 applications are available on each device. As such, your application should be available only to
463 devices that meet all your application requirements.</p>
471 <h2 id="Resources">Application Resources</h2>
473 <p>An Android application is composed of more than just code—it requires resources that are
475 presentation of the application. For example, you should define animations, menus, styles, colors,
476 and the layout of activity user interfaces with XML files. Using application resources makes it easy
477 to update various characteristics of your application without modifying code and—by providing
478 sets of alternative resources—enables you to optimize your application for a variety of
482 integer ID, which you can use to reference the resource from your application code or from
483 other resources defined in XML. For example, if your application contains an image file named {@code
507 <p>For more about the different kinds of resources you can include in your application and how
509 href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> developer guide.</p>
516 interact with your application—continue with the <b><a