From 3dec7d563a2f3e1eb967ce2054a00b6620e3558c Mon Sep 17 00:00:00 2001
From: The Android Open Source Project 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
Publishing an application means testing it, packaging it appropriately, and
making it available to users of Android-powered mobile devices. 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. 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.
+ If you will publish your application on Android Market, please also see Publishing on Android Market
@@ -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 UI/Application
-Exerciser Monkey. Signing Strategies
+
Signing Strategies
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 android:versionCode
and
element in the application's manifest file, using appropriate values.
For detailed information about how to define version information for your -application, see Versioning Your Applications.
+application, see Versioning +Your Applications.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 Obtaining a Private Key.
+a private key, see +Obtaining a Suitable Private Key.Once you have obtained (or generated) a suitable private key, you will use it to:
@@ -166,20 +170,18 @@ to:For complete information
-about getting a Maps API Key, see
+For complete information about getting a Maps API Key, see Obtaining a Maps API
Key.
If your application uses one or more -{@link-fixme com.google.android.maps.MapView Mapview} elements, you will need to +
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. href="#signing">Signing Your Applications.
-When you've prepared your application as described in the previous sections, you can compile your application for release.
-Sign your application using your private key. Signing your application correctly is critically important. Please see Signing Your Applications for complete information.
-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.
Requirements enforced by the Android Market server
+Requirements enforced by the Android Market server:
styles.xml
in the your application's res/values
directory. Add a root <resources>
node.<style>
element with a unique name
and, optionally, a parent
attribute.
The name is used for referencing these styles later, and the parent indicates what style resource to inherit from.style
element, declare format values in one or more <item>
element.
- Each item
identifies its style property with a name
attribute and defines its style value inside the element.<style>
element, declare format values in one or more <item>
element(s).
+ Each <item>
identifies its style property with a name
attribute and defines its style value inside the element.name
attribute in the item
can refer to a standard string, a hex color value,
or a reference to any other resource type.
-Note the parent
attribute in the style
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.
Notice the parent
attribute in the <style>
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.
Here's how you would reference the custom style from an XML layout, in this case, for an EditText element:
@@ -72,14 +72,15 @@ or a reference to any other resource type. android:text="Hello, World!" /> -Now this EditText widget will be styled as defined by the style
example above.
Now this EditText widget will be styled as defined by the XML example above.
Just like styles, themes are also declared in XML <style>
elements, and are referenced in the same manner.
-The difference is that you can add a theme style only to <application>
and <activity>
elements —
-they cannot be applied to individual views in the layout.
<application>
+and <activity>
elements in the Android Manifest —
+themes cannot be applied to individual Views.
Here's an example declaration of a theme:
@@ -130,32 +131,26 @@ appear like a dialog box. In the manifest, reference an Android theme like so:If you like a theme, but want to slightly tweak it, just add the theme as the parent
of your custom theme.
-For example, we'll modify the Theme.Dialog
theme. First, we need to import the parent of the
-Dialog
theme: Theme
. At the top of the resources
, add:
-<style name="Theme" parent="@android:Theme"> - <!-- no modification --> -</style> --
Now create a a new theme with Theme.Dialog
as the parent:
Theme.Dialog
theme. To do so, create a style
+with Theme.Dialog
as the parent:
<style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">-
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 CustomDialogTheme instead of the Theme.Dialog.
+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 CustomDialogTheme instead of Theme.Dialog inside the Android Manifest.
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 before
instantiating any Views in the context, for example, before calling
-setContentView(View) or inflate(int, ViewGroup). This ensures that
+setContentView(View)
or inflate(int, ViewGroup)
. This ensures that
the system applies the same theme for all of your UI screens. Here's an example:
- 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: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.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.
For detailed information about custom styles and themes and referencing them from your application, see -Style -and Theme Resources.
+Available Resource Types: +Style and Themes.For information about default themes and styles available, see {@link android.R.style}.
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); ArrayAdapteradapter = new ArrayAdapter (this, - android.R.layout.simple_dropdown_item_1line, R.array.planets); + android.R.layout.simple_dropdown_item_1line, COUNTRIES); textView.setAdapter(adapter); }
@@ -43,7 +43,7 @@ We'll make it display a message when pressed. android:src="@drawable/android" />
The source of the button - is from the res/drawables/ directory, where we've placed the android.png.
+ is from the res/drawable/ directory, where we've placed the android.png.Tip: You can also reference some of the many built-in
images from the Android {@link android.R.drawable} resources,
like ic_media_play
, for a "play" button image. To do so, change the source
@@ -52,7 +52,7 @@ We'll make it display a message when pressed.
onCreate()
method:
-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
onCreate()
method:
-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(); } };@@ -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}. android:stretchMode="columnWidth" android:gravity="center" /> +
onCreate()
method:
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<uses-library android:name="com.google.android.maps" />
<manifest>
element:
+ <uses-permission android:name="android.permission.INTERNET" />+
<?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="Your Maps API Key" /> -<RelativeLayout> +</RelativeLayout>-
Setting clickable
is important. Otherwise, the map does not allow any user interaction.
The android:apiKey
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
- generate a fingerprint from your
- debug certificate, then register the
- certificate to retieve an API key.
- Insert the API key as the value of the apiKey
attribute. If you do not insert a valid
- Maps API key, the application will still run, but no map tiles will load.
The clickable
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.
The apiKey
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
+ Obtaining a Maps API Key.
+ (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 apiKey
value.