diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-02 22:54:33 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-02 22:54:33 -0800 |
commit | 3dec7d563a2f3e1eb967ce2054a00b6620e3558c (patch) | |
tree | aa3b0365c47cb3c1607c0dc76c8d32b4046fc287 /docs/html/guide | |
parent | 15ab3eae2ec3d73b3e8aa60b33ae41445bf83f4b (diff) | |
download | frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.zip frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.gz frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.bz2 |
auto import from //depot/cupcake/@137055
Diffstat (limited to 'docs/html/guide')
-rw-r--r-- | docs/html/guide/publishing/app-signing.jd | 2 | ||||
-rw-r--r-- | docs/html/guide/publishing/preparing.jd | 36 | ||||
-rw-r--r-- | docs/html/guide/publishing/publishing.jd | 2 | ||||
-rw-r--r-- | docs/html/guide/topics/manifest/manifest-intro.jd | 2 | ||||
-rw-r--r-- | docs/html/guide/topics/ui/themes.jd | 43 | ||||
-rw-r--r-- | docs/html/guide/tutorials/views/hello-autocomplete.jd | 2 | ||||
-rw-r--r-- | docs/html/guide/tutorials/views/hello-formstuff.jd | 20 | ||||
-rw-r--r-- | docs/html/guide/tutorials/views/hello-gridview.jd | 1 | ||||
-rw-r--r-- | docs/html/guide/tutorials/views/hello-mapview.jd | 34 |
9 files changed, 72 insertions, 70 deletions
diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd index 1862b50..28c927a 100644 --- a/docs/html/guide/publishing/app-signing.jd +++ b/docs/html/guide/publishing/app-signing.jd @@ -94,7 +94,7 @@ you can run Keytool manually to generate your own keystore/key and then sign you application with Jarsigner.</li> </ul> -<h2 id="strategies">Signing Strategies</h3> +<h2 id="strategies">Signing Strategies</h2> <p>Some aspects of application signing may affect how you approach the development of your application, especially if you are planning to release multiple diff --git a/docs/html/guide/publishing/preparing.jd b/docs/html/guide/publishing/preparing.jd index 4db546d..d355265 100644 --- a/docs/html/guide/publishing/preparing.jd +++ b/docs/html/guide/publishing/preparing.jd @@ -18,9 +18,11 @@ page.title=Preparing to Publish: A Checklist <p>Publishing an application means testing it, packaging it appropriately, and making it available to users of Android-powered mobile devices.</p> -<p>If you plan to publish your application for installation on Android-powered devices, -there are several things you need to do, to get your application ready. This document -the significant checkpoints for preparing your application for a successful release. </p> +<p>If you plan to publish your application for installation on +Android-powered devices, there are several things you need to do, to get +your application ready. This document highlights the significant +checkpoints for preparing your application for a successful release. +</p> <p>If you will publish your application on Android Market, please also see <a href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Android Market</a> @@ -67,7 +69,7 @@ testing classes and tools. You can use {@link android.app.Instrumentation Instrumentation} to run JUnit and other test cases, and you can use testing tools such as the <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application -Exerciser Monkey</a>. </p> +Exerciser Monkey</a>. </p> <ul> <li>To ensure that your application will run properly for users, you should make @@ -131,7 +133,7 @@ code.</li> <h2 id="finalcompile">Before you do the final compile of your application</h2> -<h3 id="versionapp">5. Version Your Application</h3> +<h3 id="versionapp">5. Version your application</h3> <p>Before you compile your application, you must make sure that you have defined a version number for your application, specifying an appropriate value for both @@ -147,7 +149,8 @@ increment both the <code>android:versionCode</code> and element in the application's manifest file, using appropriate values. </p> <p>For detailed information about how to define version information for your -application, see <a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>.</p> +application, see <a href="{@docRoot}guide/publishing/versioning.html">Versioning +Your Applications</a>.</p> <h3 id="cryptokey">6. Obtain a suitable cryptographic key</h3> @@ -158,7 +161,8 @@ private data, as described above. </p> <p>Before you sign your application, you need to make sure that you have a suitable private key. For complete information about how to obtain (or generate) -a private key, see <a href="#cert">Obtaining a Private Key</a>.</p> +a private key, see <a href="{@docRoot}guide/publishing/app-signing.html#cert"> +Obtaining a Suitable Private Key</a>.</p> <p>Once you have obtained (or generated) a suitable private key, you will use it to:</p> @@ -166,20 +170,18 @@ to:</p> <ul> <li>Register for a Maps API Key (see below), if your application uses MapView elements.</li> -<li>Sign your application for release</li> +<li>Sign your application for release, later in the preparation process</li> </ul> - <h3 id="mapsApiKey">7. Register for a Maps API Key, if your application is using MapView elements</h3> -<div class="sidebox" style="margin-bottom:.5em;"><p>For complete information -about getting a Maps API Key, see <a +<div class="sidebox" style="margin-bottom:.5em;padding:1em;"><p> +For complete information about getting a Maps API Key, see <a href="{@docRoot}guide/topics/location/geo/mapkey.html">Obtaining a Maps API Key</a>.<br></p></div> -<p>If your application uses one or more -{@link-fixme com.google.android.maps.MapView Mapview} elements, you will need to +<p>If your application uses one or more Mapview elements, you will need to register your application with the Google Maps service and obtain a Maps API Key, before your MapView(s) will be able to retrieve data from Google Maps. To do so, you supply an MD5 fingerprint of your @@ -222,20 +224,20 @@ to download Maps data. </li> href="#signing">Signing Your Applications</a>.</p> -<h2 id="compile">Compile Your Application</h2> +<h2 id="compile">Compile your application</h2> <p>When you've prepared your application as described in the previous sections, you can compile your application for release. </p> -<h2 id="post-compile">After Compiling Your Application</h2> +<h2 id="post-compile">After compiling your application</h2> -<h3 id="signapp">8. Sign Your Application</h3> +<h3 id="signapp">8. Sign your application</h3> <p>Sign your application using your private key. Signing your application correctly is critically important. Please see <a href="#signing">Signing Your Applications</a> for complete information. </p> -<h3 id="testapp">9. Test Your Compiled and Signed Application</h3> +<h3 id="testapp">9. Test your compiled and signed application</h3> <p>Before you release your compiled application, you should thoroughly test it on the target mobile device (and target network, if possible). In particular, diff --git a/docs/html/guide/publishing/publishing.jd b/docs/html/guide/publishing/publishing.jd index aed244e..3aea3cf 100644 --- a/docs/html/guide/publishing/publishing.jd +++ b/docs/html/guide/publishing/publishing.jd @@ -84,7 +84,7 @@ that it meets the requirements listed below, which are enforced by the Market server when you upload the application.</p> <div class="special"> -<p>Requirements enforced by the Android Market server</p> +<p>Requirements enforced by the Android Market server:</p> <ol> <li>Your application must be signed with a cryptographic private key whose validity period ends after <span style="color:red">22 October 2033</span>. </li> diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd index 3c8a34a..aa14308 100644 --- a/docs/html/guide/topics/manifest/manifest-intro.jd +++ b/docs/html/guide/topics/manifest/manifest-intro.jd @@ -51,7 +51,7 @@ profiling and other information as the application is running. These declaratio are present in the manifest only while the application is being developed and tested; they're removed before the application is published.</li> -<li>It declares the minimum version of the Android API that the application +<li>It declares the minimum level of the Android API that the application requires.</li> <li>It lists the libraries that the application must be linked against.</li> diff --git a/docs/html/guide/topics/ui/themes.jd b/docs/html/guide/topics/ui/themes.jd index 956ffe1..41e8563 100644 --- a/docs/html/guide/topics/ui/themes.jd +++ b/docs/html/guide/topics/ui/themes.jd @@ -36,8 +36,8 @@ parent.link=index.html <li>Create a file named <code>styles.xml</code> in the your application's <code>res/values</code> directory. Add a root <code><resources></code> node.</li> <li>For each style or theme, add a <code><style></code> element with a unique <code>name</code> and, optionally, a <code>parent</code> attribute. The name is used for referencing these styles later, and the parent indicates what style resource to inherit from.</li> - <li>Inside the <code>style</code> element, declare format values in one or more <code><item></code> element. - Each <code>item</code> identifies its style property with a <code>name</code> attribute and defines its style value inside the element.</li> + <li>Inside the <code><style></code> element, declare format values in one or more <code><item></code> element(s). + Each <code><item></code> identifies its style property with a <code>name</code> attribute and defines its style value inside the element.</li> <li>You can then reference the custom resources from other XML resources, your manifest or application code.</li> </ol> @@ -60,7 +60,7 @@ parent.link=index.html The <code>name</code> attribute in the <code>item</code> can refer to a standard string, a hex color value, or a reference to any other resource type.</p> -<p>Note the <code>parent</code> attribute in the <code>style</code> element. This attribute lets you specify a resource from which the current style will inherit values. The style can inherit from any type of resource that contains the style(s) you want. In general, your styles should always inherit (directly or indirectly) from a standard Android style resource. This way, you only have to define the values that you want to change.</p> +<p>Notice the <code>parent</code> attribute in the <code><style></code> element. This attribute lets you specify a resource from which the current style will inherit values. The style can inherit from any type of resource that contains the style(s) you want. In general, your styles should always inherit (directly or indirectly) from a standard Android style resource. This way, you only have to define the values that you want to change.</p> <p>Here's how you would reference the custom style from an XML layout, in this case, for an EditText element:</p> @@ -72,14 +72,15 @@ or a reference to any other resource type.</p> android:text="Hello, World!" /> </pre> -<p>Now this EditText widget will be styled as defined by the <code>style</code> example above.</p> +<p>Now this EditText widget will be styled as defined by the XML example above.</p> <h2 id="themes">Themes</h2> <p>Just like styles, themes are also declared in XML <code><style></code> elements, and are referenced in the same manner. -The difference is that you can add a theme style only to <code><application></code> and <code><activity></code> elements — -they cannot be applied to individual views in the layout.</p> +The difference is that you add a theme to an entire application or activity, via the <code><application></code> +and <code><activity></code> elements in the Android Manifest — +themes cannot be applied to individual Views.</p> <p>Here's an example declaration of a theme:</p> @@ -130,32 +131,26 @@ appear like a dialog box. In the manifest, reference an Android theme like so:</ </pre> <p>If you like a theme, but want to slightly tweak it, just add the theme as the <code>parent</code> of your custom theme. -For example, we'll modify the <code>Theme.Dialog</code> theme. First, we need to import the parent of the -<code>Dialog</code> theme: <code>Theme</code>. At the top of the <code>resources</code>, add:</p> -<pre> -<style name="Theme" parent="@android:Theme"> - <!-- no modification --> -</style> -</pre> -<p>Now create a a new theme with <code>Theme.Dialog</code> as the parent:</p> +For example, we'll modify the <code>Theme.Dialog</code> theme. To do so, create a style +with <code>Theme.Dialog</code> as the parent:</p> <pre> <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog"> </pre> -<p>There it is. We've inherited the Dialog theme, so we can adjust its styles as we like. -So, for each item in the Dialog theme that we want to override, we re-define the value under this style and -then use <var>CustomDialogTheme</var> instead of the <var>Theme.Dialog</var>.</p> +<p>There it is. We've inherited the Android Dialog theme so we can adjust its styles as we like. +So, for each item in the Dialog theme that we want to change, we re-define the value here and +use <var>CustomDialogTheme</var> instead of <var>Theme.Dialog</var> inside the Android Manifest.</p> <h3 id="fromTheApp">Set the theme from the application</h3> <p>You can also load a theme for an Activity programmatically, if needed. To do so, use the {@link android.app.Activity#setTheme(int) setTheme()} method. Note that, when doing so, you must be sure to set the theme <em>before</em> instantiating any Views in the context, for example, before calling -setContentView(View) or inflate(int, ViewGroup). This ensures that +<code>setContentView(View)</code> or <code>inflate(int, ViewGroup)</code>. This ensures that the system applies the same theme for all of your UI screens. Here's an example:</p> <pre> - protected void onCreate(Bundle icicle) { - super.onCreate(icicle); + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); ... setTheme(android.R.style.Theme_Light); setContentView(R.layout.linear_layout_3); @@ -164,14 +159,14 @@ the system applies the same theme for all of your UI screens. Here's an example: <p>If you are considering loading a theme programmatically for the main screen of your application, note that the theme would not be applied -in any animations the system would use to show the activity, which -would take place before your application starts. In most cases, if +in any animations the system would use to start the activity, which +would take place before your application opens. In most cases, if you want to apply a theme to your main screen, doing so in XML is a better approach. </p> <p>For detailed information about custom styles and themes and referencing them from your application, see -<a href="{@docRoot}guide/topics/resources/available-resources.html#stylesandthemes">Style -and Theme Resources</a>.</p> +<a href="{@docRoot}guide/topics/resources/available-resources.html#stylesandthemes">Available Resource Types: +Style and Themes</a>.</p> <p>For information about default themes and styles available, see {@link android.R.style}.</p> diff --git a/docs/html/guide/tutorials/views/hello-autocomplete.jd b/docs/html/guide/tutorials/views/hello-autocomplete.jd index de3ba29..fba1ad8 100644 --- a/docs/html/guide/tutorials/views/hello-autocomplete.jd +++ b/docs/html/guide/tutorials/views/hello-autocomplete.jd @@ -40,7 +40,7 @@ protected void onCreate(Bundle savedInstanceState) { AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, - android.R.layout.simple_dropdown_item_1line, R.array.planets); + android.R.layout.simple_dropdown_item_1line, COUNTRIES); textView.setAdapter(adapter); } </pre> diff --git a/docs/html/guide/tutorials/views/hello-formstuff.jd b/docs/html/guide/tutorials/views/hello-formstuff.jd index f858ce3..da4289c 100644 --- a/docs/html/guide/tutorials/views/hello-formstuff.jd +++ b/docs/html/guide/tutorials/views/hello-formstuff.jd @@ -32,7 +32,7 @@ We'll make it display a message when pressed.</p> <ol> <li><img src="images/android.png" align="right"/> Drag the Android image on the right (or your own image) into the - res/drawables/ directory of your project. + res/drawable/ directory of your project. We'll use this for the button.</li> <li>Open the layout file and, inside the LinearLayout, add the {@link android.widget.ImageButton} element: <pre> @@ -43,7 +43,7 @@ We'll make it display a message when pressed.</p> android:src="@drawable/android" /> </pre> <p>The source of the button - is from the res/drawables/ directory, where we've placed the android.png.</p> + is from the res/drawable/ directory, where we've placed the android.png.</p> <p class="note"><strong>Tip:</strong> You can also reference some of the many built-in images from the Android {@link android.R.drawable} resources, like <code>ic_media_play</code>, for a "play" button image. To do so, change the source @@ -52,7 +52,7 @@ We'll make it display a message when pressed.</p> <li>To make the button to actually do something, add the following code at the end of the <code>onCreate()</code> method: <pre> -ImageButton button = (ImageButton) findViewById(R.id.android_button); +final ImageButton button = (ImageButton) findViewById(R.id.android_button); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks @@ -84,12 +84,12 @@ defines the action to be made when the button is clicked. Here, we show a <li>To do something with the text that the user enters, add the following code to the end of the <code>onCreate()</code> method: <pre> -EditText edittext = (EditText) findViewById(R.id.edittext); +final EditText edittext = (EditText) findViewById(R.id.edittext); edittext.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { // Perform action on key press - Toast.makeText(HelloImageButton.this, edittext.getText(), Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, edittext.getText(), Toast.LENGTH_SHORT).show(); return true; } return false; @@ -127,9 +127,9 @@ checkbox.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks if (checkbox.isChecked()) { - Toast.makeText(HelloImageButton.this, "Selected", Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, "Selected", Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(HelloImageButton.this, "Not selected", Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, "Not selected", Toast.LENGTH_SHORT).show(); } } }); @@ -183,7 +183,7 @@ OnClickListener radio_listener = new OnClickListener() { public void onClick(View v) { // Perform action on clicks RadioButton rb = (RadioButton) v; - Toast.makeText(HelloImageButton.this, rb.getText(), Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, rb.getText(), Toast.LENGTH_SHORT).show(); } }; </pre> @@ -225,9 +225,9 @@ togglebutton.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks if (togglebutton.isChecked()) { - Toast.makeText(HelloImageButton.this, "ON", Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, "ON", Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(HelloImageButton.this, "OFF", Toast.LENGTH_SHORT).show(); + Toast.makeText(HelloFormStuff.this, "OFF", Toast.LENGTH_SHORT).show(); } } }); diff --git a/docs/html/guide/tutorials/views/hello-gridview.jd b/docs/html/guide/tutorials/views/hello-gridview.jd index 623a03d..ffb6c93 100644 --- a/docs/html/guide/tutorials/views/hello-gridview.jd +++ b/docs/html/guide/tutorials/views/hello-gridview.jd @@ -25,6 +25,7 @@ are acquired from a {@link android.widget.ListAdapter}.</p> android:stretchMode="columnWidth" android:gravity="center" /> +</pre> </li> <li>Open the HelloGridView Java file. Insert the following for the <code>onCreate()</code> method: <pre> diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd index b0f59de..976b8ab 100644 --- a/docs/html/guide/tutorials/views/hello-mapview.jd +++ b/docs/html/guide/tutorials/views/hello-mapview.jd @@ -16,8 +16,13 @@ First, we'll create a simple Activity that can view and navigate a map. Then we <pre><uses-library android:name="com.google.android.maps" /></pre> </li> - - <li>Open the layout file. Define the layout with a MapView inside a RelativeLayout: + <li>We also need access to the internet in order to retrieve the Google Maps tiles, + so the application must request the {@link android.Manifest.permission#INTERNET INTERNET} permissions. + In the manifest file, add the following as a child of the <code><manifest></code> element: + <pre><uses-permission android:name="android.permission.INTERNET" /></pre> + </li> + <li>Now open the main layout file for your project. Define a layout with a com.google.android.maps.MapView + inside a android.widget.RelativeLayout: <pre> <?xml version="1.0" encoding="utf-8"?> @@ -32,22 +37,21 @@ First, we'll create a simple Activity that can view and navigate a map. Then we android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" - android:apiKey="INSERT YOUR KEY HERE" + android:apiKey="<em>Your Maps API Key</em>" /> -<RelativeLayout> +</RelativeLayout> </pre> - <p>Setting <code>clickable</code> is important. Otherwise, the map does not allow any user interaction.</p> - - <p>The <code>android:apiKey</code> must contain an authentic Android Maps API key. - The API key is generated using the MD5 fingerprint of your application certificate. For the purposes of - this exercise, you should use the fingerprint of your debug certificate (which cannot be used to release - your application for Android devices, but will work while developing). See how to - <a href="{@docRoot}guide/topics/location/geo/mapkey.html#getdebugfingerprint">generate a fingerprint from your - debug certificate</a>, then <a href="http://code.google.com/android/maps-api-signup.html">register the - certificate</a> to retieve an API key. - Insert the API key as the value of the <code>apiKey</code> attribute. If you do not insert a valid - Maps API key, the application will still run, but no map tiles will load.</p></li> + <p>The <code>clickable</code> attribute defines whether you want to allow user-interaction with the map. + In this case, we set it "true" so that the user can navigate.</p> + + <p>The <code>apiKey</code> attribute holds the Google Maps API Key that proves your application and signer + certificate has been registered with the Google Maps service. Because MapView uses Google Maps data, this key is required + in order to receive the map data, even while you are developing. Registration is free and it only takes a couple + minutes to register your certificate and receive a Maps API Key. For instructions on getting a key, read + <a href="{@docRoot}guide/topics/location/geo/mapkey.html">Obtaining a Maps API Key</a>. + (For the purpose of this tutorial, you should register with the fingerprint of the SDK debug certificate.) + Once you've acquired the Maps API Key, insert it for the <code>apiKey</code> value.</p></li> <li>Now open the HelloMapView.java file. For this Activity, we're going to extend the special sub-class of Activity called MapActivity, so change the class declaration to extend |