Merge "docs: Noted that getAllCellInfo() requires FEATURE_TELEPHONY" into mnc-docs
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index e97e86b..1c6139f 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -9,7 +9,7 @@
excludeFromSuggestions=true
@jd:body
-<section class="dac-expand dac-hero dac-section-light dac-invert" style="background-image: url(/images/tools/walking-threads-bg.jpg)">
+<section class="dac-expand dac-hero dac-section-light">
<div class="wrap">
<div class="cols dac-hero-content">
<div class="col-1of2 col-push-1of2 dac-hero-figure">
diff --git a/docs/html/distribute/essentials/essentials_toc.cs b/docs/html/distribute/essentials/essentials_toc.cs
index 072aa08..a78252d 100644
--- a/docs/html/distribute/essentials/essentials_toc.cs
+++ b/docs/html/distribute/essentials/essentials_toc.cs
@@ -51,7 +51,7 @@
</div>
</li>
<li class="nav-section">
- <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/promote/badges.html" zh-cn-lang="Google Play 徽章生成器">
+ <div class="nav-section empty" style="font-weight:normal"><a href="https://play.google.com/intl/en_us/badges/" zh-cn-lang="Google Play 徽章生成器">
<span class="en">Google Play Badges</span></a>
</div>
</li>
diff --git a/docs/html/distribute/tools/promote/badges.jd b/docs/html/distribute/tools/promote/badges.jd
deleted file mode 100644
index eb09333..0000000
--- a/docs/html/distribute/tools/promote/badges.jd
+++ /dev/null
@@ -1,362 +0,0 @@
-page.title=Google Play Badge Generator
-page.image=/images/gp-badges-set.png
-page.metaDescription=Build badges for your app in just a few clicks, or download hi-res badge assets localized for a variety of languages.
-meta.tags="disttools, promoting, deviceart, marketing, googleplay"
-page.tags="badge, google play"
-
-@jd:body
-
-<p itemprop="description">Google Play badges enable you to promote your apps with
-official branding in your online ads, promotional materials, or anywhere you want
-a link to your apps</p>
-
-<p>In the form below,
-input your app's package name or publisher name, choose the badge style,
-click <em>Build my badge</em>, then paste the HTML into your web content.</p>
-
-<p>If you're creating a promotional web page for your app, you should also use the
-<a href="{@docRoot}distribute/tools/promote/device-art.html">Device Art Generator</a>, which quickly
-wraps your screenshots in real device artwork.</p>
-
-<p>For guidelines when using the Google Play badge and other brand assets,
-see the <a href="{@docRoot}distribute/tools/promote/brand.html#brand-google_play">Brand
-Guidelines</a>.</p>
-
-<style type="text/css">
-
-form.button-form {
- margin-top:2em;
-}
-
-/* the label and input elements are blocks that float left in order to
- keep the left edgets of the input aligned, and IE 6/7 do not fully support "inline-block" */
-label.block {
- display: block;
- float: left;
- width: 100px;
- padding-right: 10px;
-}
-
-input.text {
- display: block;
- float: left;
- width: 250px;
-}
-
-div.button-row {
- white-space:nowrap;
- min-height:80px;
-}
-
-div.button-row input {
- vertical-align:middle;
- margin:0 5px 0 0;
-}
-
-#jd-content div.button-row img {
- margin: 0;
- vertical-align:middle;
-}
-
-</style>
-
-<script type="text/javascript">
-
-// locales for which we have the 'app' badge
-var APP_LANGS = ['it','pt-br','pt-pt','nl','ko','ja','fr','es','es-419','en','de'];
-
-// variables for creating 'try it out' demo button
-var imagePath = "https://developer.android.com/images/brand/"
-var linkStart = "<a href=\"https://play.google.com/store/";
-var imageStart = "\">\n"
- + " <img alt=\"";
- // leaves opening for the alt text value
-var imageSrc = "\"\n src=\"" + imagePath;
- // leaves opening for the image file name
-var imageEnd = ".png\" />\n</a>";
-
-// variables for creating code snippet
-var linkStartCode = "<a href=\"https://play.google.com/store/";
-var imageStartCode = "\">\n"
- + " <img alt=\"";
- // leaves opening for the alt text value
-var imageSrcCode = "\"\n src=\"" + imagePath;
- // leaves opening for the image file name
-var imageEndCode = ".png\" />\n</a>";
-
-/** Generate the HTML snippet and demo based on form values */
-function buildButton(form) {
- var lang = $('#locale option:selected').val();
- var selectedValue = lang + $('form input[type=radio]:checked').val();
- var altText = selectedValue.indexOf("generic") != -1 ? "Get it on Google Play" : "Android app on Google Play";
-
- if (form["package"].value != "com.example.android") {
- $("#preview").show();
- var packageName = escapeHTML(form["package"].value);
- $("#snippet").show().html(linkStartCode + "apps/details?id=" + packageName
- + imageStartCode + altText + imageSrcCode
- + selectedValue + imageEndCode);
- $("#button-preview").html(linkStart + "apps/details?id=" + packageName
- + imageStart + altText + imageSrc
- + selectedValue + imageEnd);
-
- // Send the event to Analytics
- ga('send', 'event', 'Distribute', 'Create Google Play Badge', 'Package ' + selectedValue);
- } else if (form["publisher"].value != "Example, Inc.") {
- $("#preview").show();
- var publisherName = escapeHTML(form["publisher"].value);
- $("#snippet").show().html(linkStartCode + "search?q=pub:" + publisherName
- + imageStartCode + altText + imageSrcCode
- + selectedValue + imageEndCode);
- $("#button-preview").html(linkStart + "search?q=pub:" + publisherName
- + imageStart + altText + imageSrc
- + selectedValue + imageEnd);
-
- // Send the event to Analytics
- ga('send', 'event', 'Distribute', 'Create Google Play Badge', 'Publisher ' + selectedValue);
- } else {
- alert("Please enter your package name or publisher name");
- }
- return false;
-}
-
-/** Listen for Enter key */
-function onTextEntered(event, form, me) {
- // 13 = enter
- if (event.keyCode == 13) {
- buildButton(form);
- }
-}
-
-/** When input is focused, remove example text and disable other input */
-function onInputFocus(object, example) {
- if (object.value == example) {
- $(object).val('').css({'color' : '#000'});
- }
- $('input[type="text"]:not(input[name='+object.name+'])',
- object.parentNode).attr('disabled','true');
- $('#'+object.name+'-clear').show();
-}
-
-/** When input is blured, restore example text if appropriate and enable other input */
-function onInputBlur(object, example) {
- if (object.value.length < 1) {
- $(object).attr('value',example).css({'color':'#ccc'});
- $('input[type="text"]', object.parentNode).removeAttr('disabled');
- $('#'+object.name+'-clear').hide();
- }
-}
-
-/** Clear the form to start over */
-function clearLabel(id, example) {
- $("#preview").hide();
- $('#'+id+'').html('').attr('value',example).css({'color':'#ccc'});
- $('input[type="text"]', $('#'+id+'').parent()).removeAttr('disabled');
- $('#'+id+'-clear').hide();
- return false;
-}
-
-/** Switch the badge urls for selected language */
-function changeBadgeLang() {
- var lang = $('#locale option:selected').val();
-
- // check if we have the 'app' badge for this lang and show notice if not
- $("div.button-row.error").remove(); // remove any existing instance of error message
- if ($.inArray(lang,APP_LANGS) == -1) {
- $("div.button-row.app").hide();
- $("div.button-row.app").after('<div class="button-row error"><p class="note" style="margin:1em 0 -1em">'
- + 'Sorry, we currently don\'t have the '
- + '<em>Android app on Google Play</em> badge translated for '
- + $("select#locale option[value="+lang+"]").attr("title")
- + '.<br>Please check back later or instead use the <em>Get it on Google Play</em> badge below.'
- + '</p></div>');
- } else {
- $("div.button-row.app").show(); // show the 'app' badge row
- }
-
- $('.button-row img').each(function() {
- var id = $(this).parent().attr('for');
- var imgName = lang + $('input#'+id).attr('value') + '.png';
- var lastSlash = $(this).attr('src').lastIndexOf('/');
- var imgPath = $(this).attr('src').substring(0, lastSlash+1);
- $(this).attr('src', imgPath + imgName);
- });
-}
-
-/** When the doc is ready, find the inputs and color the input grey if the value is the example
- text. This is necessary to handle back-navigation, which can auto-fill the form with previous
- values (and text should not be grey) */
-$(document).ready(function() {
- $(".button-form input.text").each(function(index) {
- if ($(this).val() == $(this).attr("default")) {
- $(this).css("color","#ccc");
- } else {
- /* This is necessary to handle back-navigation to the page after form was filled */
- $('input[type="text"]:not(input[name='+this.name+'])',
- this.parentNode).attr('disabled','true');
- $('#'+this.name+'-clear').show();
- }
- });
-});
-
-</script>
-
-<form class="button-form">
- <label class="block" for="locale">Language:</label>
- <select id="locale" style="display:block;float:left;margin:0"
- onchange="changeBadgeLang()">
- <option title="Afrikaans"
- value="af">Afrikaans</option>
- <option title="Arabic"
- value="ar">العربية</option>
- <option title="Belarusian"
- value="be">Беларуская</option>
- <option title="Bulgarian"
- value="bg">Български</option>
- <option title="Catalan"
- value="ca">Català</option>
- <option title="Chinese (China)"
- value="zh-cn">中文 (中国)</option>
- <option title="Chinese (Hong Kong)"
- value="zh-hk">中文(香港)</option>
- <option title="Chinese (Taiwan)"
- value="zh-tw">中文 (台灣)</option>
- <option title="Croatian"
- value="hr">Hrvatski</option>
- <option title="Czech"
- value="cs">Česky</option>
- <option title="Danish"
- value="da">Dansk</option>
- <option title="Dutch"
- value="nl">Nederlands</option>
- <option title="Estonian"
- value="et">Eesti</option>
- <option title="Farsi - Persian"
- value="fa">فارسی</option>
- <option title="Filipino"
- value="fil">Tagalog</option>
- <option title="Finnish"
- value="fi">Suomi</option>
- <option title="French"
- value="fr">Français</option>
- <option title="German"
- value="de">Deutsch</option>
- <option title="Greek"
- value="el">Ελληνικά</option>
- <option title="English"
- value="en" selected="true">English</option>
-<!--
- <option title="Hebrew"
- value="iw-he">עברית</option>
--->
- <option title="Hungarian"
- value="hu">Magyar</option>
- <option title="Indonesian"
- value="id-in">Bahasa Indonesia</option>
- <option title="Italian"
- value="it">Italiano</option>
- <option title="Japanese"
- value="ja">日本語</option>
- <option title="Korean"
- value="ko">한국어</option>
- <option title="Latvian"
- value="lv">Latviešu</option>
- <option title="Lithuanian"
- value="lt">Lietuviškai</option>
- <option title="Malay"
- value="ms">Bahasa Melayu</option>
- <option title="Norwegian"
- value="no">Norsk (bokmål)</option>
- <option title="Polish"
- value="pl">Polski</option>
- <option title="Portuguese (Brazil)"
- value="pt-br">Português (Brasil)</option>
- <option title="Portuguese (Portugal)"
- value="pt-pt">Português (Portugal)</option>
- <option title="Romanian"
- value="ro">Română</option>
- <option title="Russian"
- value="ru">Русский</option>
- <option title="Serbian"
- value="sr">Српски / srpski</option>
- <option title="Slovak"
- value="sk">Slovenčina</option>
- <option title="Slovenian"
- value="sl">Slovenščina</option>
- <option title="Spanish (Spain)"
- value="es">Español (España)</option>
- <option title="Spanish (Latin America)"
- value="es-419">Español (Latinoamérica)</option>
- <option title="Swedish"
- value="sv">Svenska</option>
- <option title="Swahili"
- value="sw">Kiswahili</option>
- <option title="Thai"
- value="th">ไทย</option>
- <option title="Turkish"
- value="tr">Türkçe</option>
- <option title="Ukrainian"
- value="uk">Українська</option>
- <option title="Vietnamese"
- value="vi">Tiếng Việt</option>
- <option title="Zulu"
- value="zu">isiZulu</option>
- </select>
- <p style="clear:both;margin:0"> </p>
- <label class="block" for="package" style="clear:left">Package name:</label>
- <input class="text" type="text" id="package" name="package"
- value="com.example.android"
- default="com.example.android"
- onfocus="onInputFocus(this, 'com.example.android')"
- onblur="onInputBlur(this, 'com.example.android')"
- onkeyup="return onTextEntered(event, this.parentNode, this)"/>
- <a id="package-clear" style="display:none" href="#"
- onclick="return clearLabel('package','com.example.android');">clear</a>
- <p style="clear:both;margin:0"> <em>or</em></p>
- <label class="block" style="margin-top:5px" for="publisher">Publisher name:</label>
- <input class="text" type="text" id="publisher" name="publisher"
- value="Example, Inc."
- default="Example, Inc."
- onfocus="onInputFocus(this, 'Example, Inc.')"
- onblur="onInputBlur(this, 'Example, Inc.')"
- onkeyup="return onTextEntered(event, this.parentNode, this)"/>
- <a id="publisher-clear" style="display:none" href="#"
- onclick="return clearLabel('publisher','Example, Inc.');">clear</a>
- <br/><br/>
-
-
-<div class="button-row app">
- <input type="radio" name="buttonStyle" value="_app_rgb_wo_45" id="ws" />
- <label for="ws"><img src="{@docRoot}images/brand/en_app_rgb_wo_45.png"
-alt="Android app on Google Play (small)" /></label>
-
- <input type="radio" name="buttonStyle" value="_app_rgb_wo_60" id="wm" />
- <label for="wm"><img src="{@docRoot}images/brand/en_app_rgb_wo_60.png"
-alt="Android app on Google Play (large)" /></label>
-</div>
-
-<div class="button-row">
- <input type="radio" name="buttonStyle" value="_generic_rgb_wo_45" id="ns" checked="checked" />
- <label for="ns"><img src="{@docRoot}images/brand/en_generic_rgb_wo_45.png"
-alt="Get it on Google Play (small)" /></label>
-
- <input type="radio" name="buttonStyle" value="_generic_rgb_wo_60" id="nm" />
- <label for="nm"><img src="{@docRoot}images/brand/en_generic_rgb_wo_60.png"
-alt="Get it on Google Play (large)" /></label>
-</div>
-
- <input class="button" onclick="return buildButton(this.parentNode);"
- type="button" value="Build my badge" style="padding:10px" />
- <br/>
-</form>
-
-<div id="preview" style="display:none">
- <p>Copy and paste this HTML into your web site:</p>
- <textarea id="snippet" cols="100" rows="5" onclick="this.select()"
-style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em">
- </textarea >
-
-<p>Test your badge:</p>
-<div id="button-preview" style="margin-top:1em"></div>
-</div>
-
diff --git a/docs/html/google/play/billing/billing_admin.jd b/docs/html/google/play/billing/billing_admin.jd
index 00aa08d..383ef5d 100644
--- a/docs/html/google/play/billing/billing_admin.jd
+++ b/docs/html/google/play/billing/billing_admin.jd
@@ -130,9 +130,10 @@
a product ID.</p>
</li>
<li><strong>Product Type</strong>
- <p>The product type can be <strong>Managed per user account</strong>, <strong>Unmanaged</strong>,
- or <strong>Subscription</strong>. You can never change an item's product type after you set it. For more
- information, see <a href="#billing-purchase-type">Choosing a product type</a> later in this
+ <p>The product type can be <strong>Managed per user account</strong>,
+ <strong>Unmanaged</strong>, or <strong>Subscription</strong>. You can never
+ change an item's product type after you set it. For more information, see
+ <a href="#billing-purchase-type">Choosing a product type</a> later in this
document.</p>
</li>
<li><strong>Publishing State</strong>
@@ -161,7 +162,8 @@
</li>
<li><strong>Description</strong>
<p>The description is a long descriptor for the item. For example, "Instantly puts creatures to
- sleep. Does not work on angry elves." Every item must have a description. Descriptions can be up to 80 characters in length.</p>
+ sleep. Does not work on angry elves." Every item must have a description. Descriptions can be
+ up to 80 characters in length.</p>
</li>
<li><strong>Price</strong>
<p>You must provide a default price in your home currency. You can also provide prices in other
@@ -171,22 +173,25 @@
<p>To specify prices in other currencies, you can manually enter the price for each
currency or you can click <strong>Auto Fill</strong> and let Google Play do a one-time
conversion from your home currency to the currencies you are targeting (see figure 3).</p>
- <p>For subscription items, note that you can not change the item's price once you have published it. </p>
+ <p>For subscription items, note that you can not change the item's price once you have published
+ it.</p>
</li>
</ul>
<div style="margin:1em;">
-<img style="border:1px solid #ddd;padding-bottom:.5em" src="{@docRoot}images/in-app-billing/billing_list_form_2.png" xheight="1226" id="figure3" />
+<img style="border:1px solid #ddd;padding-bottom:.5em"
+ src="{@docRoot}images/in-app-billing/billing_list_form_2.png"
+ xheight="1226" id="figure3" />
<p class="img-caption" style="padding-left:.5em;">
<strong>Figure 3.</strong> Specifying additional currencies for an in-app product.
</p>
</div>
<p>For more information about product IDs and product lists, see <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1072599">Creating In-App Product
-IDs</a>. For more information about pricing, see <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">In-App Billing
-Pricing</a>.</p>
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1072599">
+Creating In-App Product IDs</a>. For more information about pricing, see <a
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">
+In-App Billing Pricing</a>.</p>
<p class="note"><strong>Note</strong>: Be sure to plan your product ID namespace. You cannot reuse
or modify product IDs after you save them.</p>
@@ -203,7 +208,8 @@
tax-exclusive default price and tax-inclusive prices will be auto-filled. If you
do not use auto-fill, prices you provide must include tax.</p>
-<p class="note"><strong>Note:</strong> Batch upload of product lists containing subscriptions is not yet supported.</p>
+<p class="note"><strong>Note:</strong> Batch upload of product lists containing
+subscriptions is not yet supported.</p>
The CSV file uses commas (,) and semi-colons (;) to separate data values.
Commas are used to separate primary data values, and semi-colons are used to separate subvalues. For
@@ -287,7 +293,8 @@
</li>
<li><em>price</em>
<p>This is equivalent to the Price in the In-app Products UI. The price must be specified in
- micro-units. To convert a currency value to micro-units, you multiply the real value by 1,000,000.
+ micro-units. To convert a currency value to micro-units, you multiply the real value by
+ 1,000,000.
For example, if you want to sell an in-app item for $1.99 you specify 1990000 in the
<em>price</em> field.</p>
</li>
@@ -413,8 +420,8 @@
application. For more information, see <a
href="{@docRoot}google/play/billing/v2/api.html#billing-action-notify">Handling
IN_APP_NOTIFY messages</a> and <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">In-app Billing
-Pricing</a>.</p>
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">
+In-app Billing Pricing</a>.</p>
<p class="caution"><strong>Important:</strong> You cannot use the API to issue
refunds or cancel In-app Billing transactions. You must do this manually through your Google
@@ -453,10 +460,11 @@
<h2 id="billing-testing-setup">Setting Up Test Accounts</h2>
-<p>The Google Play Developer Console lets you set up one or more test accounts. A test account is a
-regular Google account that you register on the Developer Console as a test account. Test accounts are
-authorized to make in-app purchases from applications that you have uploaded to the Google Play
-Developer Console but have not yet published.</p>
+<p>The Google Play Developer Console lets you set up one or more test accounts.
+A test account is a regular Google account that you register on the Developer
+Console as a test account. Test accounts are authorized to make in-app purchases
+from applications that you have uploaded to the Google Play Developer Console
+but have not yet published.</p>
<p>You can use any Google account as a test account. Test accounts are useful if you want to let
multiple people test In-app Billing on applications without giving them access to your publisher
@@ -547,6 +555,3 @@
<p>For general information about how to post to the groups listed above, see <a
href="{@docRoot}resources/community-groups.html">Developer Forums</a> document in the Resources
tab.</p>
-
-
-
diff --git a/docs/html/google/play/billing/billing_best_practices.jd b/docs/html/google/play/billing/billing_best_practices.jd
index 015e7c3..9476ffb 100644
--- a/docs/html/google/play/billing/billing_best_practices.jd
+++ b/docs/html/google/play/billing/billing_best_practices.jd
@@ -72,7 +72,7 @@
line to your Proguard configuration file:</p>
<p><code>-keep class com.android.vending.billing.**</code></p>
</div>
-
+
<h3 id="sample">Modify all sample application code</h3>
<p>The In-app Billing sample application is publicly distributed and can be downloaded by anyone,
which means it is relatively easy for an attacker to reverse engineer your application if you use
@@ -90,16 +90,27 @@
nonces on the server.</p>
<h3 id="payload">Set the developer payload string when making purchase requests</h3>
-<p>With the In-app Billing Version 3 API, you can include a 'developer payload' string token when sending your purchase request to Google Play. Typically, this is used to pass in a string token that uniquely identifies this purchase request. If you specify a string value, Google Play returns this string along with the purchase response. Subsequently, when you make queries about this purchase, Google Play returns this string together with the purchase details.</p>
-<p>You should pass in a string token that helps your application to identify the user who made the purchase, so that you can later verify that this is a legitimate purchase by that user. For consumable items, you can use a randomly generated string, but for non-consumable items you should use a string that uniquely identifies the user.</p>
-<p>When you get back the response from Google Play, make sure to verify that the developer payload string matches the token that you sent previously with the purchase request. As a further security precaution, you should perform the verification on your own secure server.</p>
+<p>With the In-app Billing Version 3 API, you can include a 'developer payload'
+string token when sending your purchase request to Google Play. Typically, this
+is used to pass in a string token that uniquely identifies this purchase request.
+If you specify a string value, Google Play returns this string along with the
+purchase response. Subsequently, when you make queries about this purchase,
+Google Play returns this string together with the purchase details.</p>
+<p>You should pass in a string token that helps your application to identify the user who
+made the purchase, so that you can later verify that this is a legitimate purchase by
+that user. For consumable items, you can use a randomly generated string, but for non-
+consumable items you should use a string that uniquely identifies the user.</p>
+<p>When you get back the response from Google Play, make sure to verify that the
+developer payload string matches the token that you sent previously with the purchase
+request. As a further security precaution, you should perform the verification on your
+own secure server.</p>
<h3 id="trademark">Take action against trademark and copyright infringement</h3>
<p>If you see your content being redistributed on Google Play, act quickly and decisively. File a
-<a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=141511">trademark notice
-of infringement</a> or a <a href="http://www.google.com/android_dmca.html">copyright notice of
-infringement</a>.</p>
+<a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=141511">
+trademark notice of infringement</a> or a <a href="http://www.google.com/android_dmca.html">
+copyright notice of infringement</a>.</p>
<h3 id="revocable">Implement a revocability scheme for unlocked content</h3>
<p>If you are using a remote server to deliver or manage content, have your application verify the
@@ -112,4 +123,3 @@
example, XOR with some other string) to hide the actual key. The key itself is not secret
information, but you do not want to make it easy for a hacker or malicious user to replace the
public key with another key.</p>
-
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index ce1f50e..4249885 100644
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -222,9 +222,11 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
+ Intent serviceIntent =
+ new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
+}
</pre>
<p>
@@ -509,7 +511,11 @@
products that are owned by the user has been sent to your app.
</p>
-<p>For more information about the data returned by {@code getPurchases}, see <a href="{@docRoot}google/play/billing/billing_reference.html#getPurchases">In-app Billing Reference</a>. The following example shows how you can retrieve this data from the response.</p>
+<p>For more information about the data returned by {@code getPurchases}, see
+ <a href="{@docRoot}google/play/billing/billing_reference.html#getPurchases">
+ In-app Billing Reference</a>. The following example shows how you can
+ retrieve this data from the response.
+</p>
<pre>
int response = ownedItems.getInt("RESPONSE_CODE");
@@ -656,4 +662,5 @@
verification on that server.</p>
<p>For more information about best practices for security and design, see <a
-href="{@docRoot}google/play/billing/billing_best_practices.html">Security and Design</a>.</p>
+href="{@docRoot}google/play/billing/billing_best_practices.html">Security and
+Design</a>.</p>
diff --git a/docs/html/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd
index 5ff3e92..4ec4946 100644
--- a/docs/html/google/play/billing/billing_overview.jd
+++ b/docs/html/google/play/billing/billing_overview.jd
@@ -29,7 +29,8 @@
</ol>
<h2>Related Samples</h2>
<ol>
- <li><a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">Sample Application (V3)</a></li>
+ <li><a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">Sample
+ Application (V3)</a></li>
</ol>
</div>
</div>
@@ -40,12 +41,13 @@
<p class="note"><b>Note</b>: Ensure that you comply with applicable laws in the countries where you
distribute apps. For example, in EU countries, laws based on the
-<a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2005:149:0022:0039:EN:PDF">Unfair
-Commercial Practices Directive</a> prohibit direct exhortations to children to buy advertised
+<a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2005:149:0022:0039:EN:PDF">
+Unfair Commercial Practices Directive</a> prohibit direct exhortations to children to buy advertised
products or to persuade their parents or other adults to buy advertised products for them.
See the
-<a href="http://ec.europa.eu/consumers/enforcement/docs/common_position_on_online_games_en.pdf">position
-of the EU consumer protection authorities</a> for more information on this and other topics.
+<a href="http://ec.europa.eu/consumers/enforcement/docs/common_position_on_online_games_en.pdf">
+position of the EU consumer protection authorities</a> for more information on this and other
+topics.
</p>
<h2 id="api">In-app Billing API</h2>
@@ -65,7 +67,9 @@
<p>In-app billing Version 3 is the latest version, and maintains very broad
compatibility across the range of Android devices. In-app Billing Version 3 is
supported on devices running Android 2.2 or higher that have the latest version
-of the Google Play store installed (<a href="{@docRoot}about/dashboards/index.html">a vast majority</a> of active devices).</p>
+of the Google Play store installed (<a
+href="{@docRoot}about/dashboards/index.html">a vast majority</a> of active
+devices).</p>
<h4>Version 3 features</h4>
<ul>
@@ -107,7 +111,9 @@
<p>You can specify these types of products for your In-app Billing application
— <em>managed in-app products</em> and <em>subscriptions</em>. Google Play
handles and tracks ownership for in-app products and subscriptions on your
-application on a per user account basis. <a href="{@docRoot}google/play/billing/api.html#producttypes">Learn more about the product types supported by In-app Billing Version 3</a>.</p>
+application on a per user account basis.
+<a href="{@docRoot}google/play/billing/api.html#producttypes">Learn more about
+the product types supported by In-app Billing Version 3</a>.</p>
<h2 id="console">Google Play Developer Console</h2>
<p>The Developer Console is where you can publish your
@@ -146,7 +152,9 @@
provides a sample application that demonstrates how to sell in-app products and subscriptions
from inside an app.</p>
-<p>The <a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">TrivialDrive sample for the Version 3 API</a> sample shows how to use the In-app Billing Version 3 API
+<p>The <a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">
+TrivialDrive sample for the Version 3 API</a> sample shows how to use the In-app
+Billing Version 3 API
to implement in-app product and subscription purchases for a driving game. The
application demonstrates how to send In-app Billing requests, and handle
synchronous responses from Google Play. The application also shows how to record
@@ -175,8 +183,3 @@
Console for these items, and you can use the same product IDs to purchase these
items.
</ul>
-
-
-
-
-
diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
index b06d874..e9e04a3 100644
--- a/docs/html/google/play/billing/billing_reference.jd
+++ b/docs/html/google/play/billing/billing_reference.jd
@@ -29,11 +29,17 @@
</ol>
</div>
</div>
-<p>This documentation provides technical reference information for using the In-app Billing Version 3 API. </p>
+<p>This documentation provides technical reference information for using the
+In-app Billing Version 3 API. </p>
<h2 id="billing-codes">Server Response Codes</h2>
-<p>The following table lists all of the server response codes that are sent from Google Play to your application. Google Play sends the response code synchronously as an integer mapped to the {@code RESPONSE_CODE} key in the response {@code Bundle}. Your application must handle all of these response codes.</p>
-
+<p>
+ The following table lists all of the server response codes that are sent from
+ Google Play to your application. Google Play sends the response code
+ synchronously as an integer mapped to the {@code RESPONSE_CODE} key in the
+ response {@code Bundle}. Your application must handle all of these response
+ codes.
+</p>
<p class="table-caption" id="response-codes-table">
<strong>Table 1.</strong> Summary of response codes for In-app Billing Version 3 API calls.</p>
<table>
@@ -70,7 +76,10 @@
<tr>
<td>{@code BILLING_RESPONSE_RESULT_DEVELOPER_ERROR}</td>
<td>5</td>
- <td>Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest</td>
+ <td>Invalid arguments provided to the API. This error can also indicate that
+ the application was not correctly signed or properly set up for In-app
+ Billing in Google Play, or does not have the necessary permissions in its
+ manifest</td>
</tr>
<tr>
<td>{@code BILLING_RESPONSE_RESULT_ERROR}</td>
@@ -90,13 +99,23 @@
</table>
<h2 id="billing-interface">API Reference</h2>
-<p>The In-app Billing Version 3 API is defined in the {@code IInAppBillingService.aidl} file, which is included with the Version 3 <a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">sample application</a>.</p>
+<p>The In-app Billing Version 3 API is defined in the {@code
+ IInAppBillingService.aidl} file, which is included with the Version 3
+ <a href="{@docRoot}training/in-app-billing/preparing-iab-app.html#GetSample">
+ sample application</a>.</p>
<h3 id="getSkuDetails">The getSkuDetails() method</h3>
-<p>This method returns product details for a list of product IDs. In the response {@code Bundle} sent by Google Play, the query results are stored in a String {@code ArrayList} mapped to the {@code DETAILS_LIST} key. Each String in the details list contains product details for a single product in JSON format. The fields in the JSON string with the product details are summarized in table 2.</p>
-
+<p>
+ This method returns product details for a list of product IDs. In the
+ response {@code Bundle} sent by Google Play, the query results are stored in
+ a String {@code ArrayList} mapped to the {@code DETAILS_LIST} key. Each
+ String in the details list contains product details for a single product in
+ JSON format. The fields in the JSON string with the product details are
+ summarized in table 2.
+</p>
<p class="table-caption" id="product-details-table">
-<strong>Table 2.</strong> Description of JSON fields with product item details returned from a {@code getSkuDetails} request.</p>
+<strong>Table 2.</strong> Description of JSON fields with product item details
+returned from a {@code getSkuDetails} request.</p>
<table>
<tr>
<th scope="col">Key</th>
@@ -179,7 +198,8 @@
</table>
</p>
-<p>Table 4 describes the JSON fields that are returned in the response data for a purchase order.</p>
+<p>Table 4 describes the JSON fields that are returned in the response data for
+a purchase order.</p>
<p class="table-caption" id="purchase-data-table">
<strong>Table 4.</strong> Descriptions of the JSON fields for {@code INAPP_PURCHASE_DATA}.</p>
<table>
@@ -216,7 +236,9 @@
</tr>
<tr>
<td>{@code productId}</td>
- <td>The item's product identifier. Every item has a product ID, which you must specify in the application's product list on the Google Play Developer Console.</td>
+ <td>The item's product identifier. Every item has a product ID, which you
+ must specify in the application's product list on the Google Play
+ Developer Console.</td>
</tr>
<tr>
<td>{@code purchaseTime}</td>
@@ -330,8 +352,13 @@
</tr>
<tr>
<td>{@code INAPP_CONTINUATION_TOKEN}</td>
- <td>String containing a continuation token to retrieve the next set of in-app products owned by the user. This is only set by the Google Play service if the number of products owned by the user is very large. When a continuation token is present in the response, you must make another call to {@code getPurchases} and pass in the continuation token that you received. The subsequent {@code getPurchases} call returns more purchases and possibly another continuation token.</td>
+ <td>String containing a continuation token to retrieve the next set of
+ in-app products owned by the user. This is only set by the Google Play
+ service if the number of products owned by the user is very large. When a
+ continuation token is present in the response, you must make another call
+ to {@code getPurchases} and pass in the continuation token that you
+ received. The subsequent {@code getPurchases} call returns more purchases
+ and possibly another continuation token.</td>
</tr>
</table>
</p>
-
diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd
index bfca3a9..da9eafd 100644
--- a/docs/html/google/play/billing/billing_subscriptions.jd
+++ b/docs/html/google/play/billing/billing_subscriptions.jd
@@ -21,8 +21,10 @@
</ol>
<h2>See also</h2>
<ol>
- <li><a href="{@docRoot}google/play/billing/billing_integrate.html#Subs">Implementing Subscriptions (V3)</a></li>
- <li><a href="https://developers.google.com/android-publisher/">Google Play Developer API</a></li>
+ <li><a href="{@docRoot}google/play/billing/billing_integrate.html#Subs">Implementing
+ Subscriptions (V3)</a></li>
+ <li><a href="https://developers.google.com/android-publisher/">Google Play
+ Developer API</a></li>
</ol>
</div>
</div>
@@ -109,11 +111,12 @@
<p>In general the same basic policies and terms apply to subscriptions as to
standard in-app products, however there are some differences. For complete
information about the current policies and terms, please read the <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en
-&answer=140504">policies document</a>.</p>
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">
+policies document</a>.</p>
<p>To learn about the minimum system requirements for
-subscriptions, see the <a href="{@docRoot}google/play/billing/versions.html#Subs">Version Notes</a>.</p>
+subscriptions, see the <a href="{@docRoot}google/play/billing/versions.html#Subs">
+Version Notes</a>.</p>
<h2 id="administering">Configuring Subscription Items</h2>
@@ -310,7 +313,8 @@
try your subscription content before buying it. The trial period runs for the
period of time that you set and then automatically converts to a full
subscription managed according to the subscription's billing interval and
-price. Free trials are supported for monthly and annual subscriptions only, and are not supported for seasonal subscriptions.</p>
+price. Free trials are supported for monthly and annual subscriptions only, and
+are not supported for seasonal subscriptions.</p>
<p>To take advantage of a free trial, a user must "purchase" the full
subscription through the standard In-app Billing flow, providing a valid form of
@@ -396,7 +400,8 @@
refund their subscription payments.
Removing content that any subscriber is entitled to access
will result in penalties. Please see the <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies document</a> for more information. </p>
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">
+policies document</a> for more information. </p>
<h3 id="uninstall">App uninstallation</h3>
@@ -441,8 +446,8 @@
outside of the app and Google Play (such as to a web site).</p>
<p>For complete details about terms and policies, see the <a
-href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies
-document</a>.</p>
+href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">
+policies document</a>.</p>
<h3 id="orderId">Subscription order numbers</h3>
@@ -451,7 +456,8 @@
subscription and denotes
each recurring transaction by appending an integer as follows: </p>
-<p><span style="color:#777"><code style="color:#777">GPA.1234-5678-9012-34567</code> (base order number)</span><br />
+<p><span style="color:#777"><code style="color:#777">GPA.1234-5678-9012-34567</code>
+(base order number)</span><br />
<code>GPA.1234-5678-9012-34567..0</code> (first recurrence orderID)<br />
<code>GPA.1234-5678-9012-34567..1</code> (second recurrence orderID)<br />
<code>GPA.1234-5678-9012-34567..2</code> (third recurrence orderID)<br />
diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
index 0c64ee4..939f9a5 100644
--- a/docs/html/google/play/billing/billing_testing.jd
+++ b/docs/html/google/play/billing/billing_testing.jd
@@ -30,7 +30,7 @@
<li>Static billing responses from Google Play, for testing in early development</p>
</ul>
-<p>To test in-app billing, you need to publish your app to an <a
+<p>To test in-app billing, you need to publish your app to an <a
href="https://support.google.com/googleplay/android-developer/answer/3131213">alpha
or beta channel in Google Play.</a></p>
@@ -42,7 +42,7 @@
purchases in your alpha or beta channel app, each tester
needs to <a href="https://support.google.com/googleplay/android-developer/answer/3131213">opt-in
to your app’s alpha or beta test</a>. On your test’s opt-in URL, your
-testers will get an explanation of what it means to be a tester and a link to opt-in.</p>
+testers will get an explanation of what it means to be a tester and a link to opt-in.</p>
<p>You can test on any Android-powered hardware device running Android 1.6 or higher.
The most current version of the Google Play application must be installed on the device.
@@ -54,12 +54,12 @@
<p>When your In-app Billing implementation is ready, you can test purchasing of your in-app SKUs in two ways:</p>
-<ul> <li><strong>Test purchases</strong>, which let your selected license-test
+<ul>
+<li><strong>Test purchases</strong>, which let your selected license-test
users purchase your in-app products without any resulting charges to the user.
Test purchases can be used in alpha/beta releases only. </li>
<li><strong>Real purchases</strong>, which let regular users make real purchases
of your in-app products with actual charges to the user’s payment instruments.</li>
-
</ul>
<p>In either case, you need to publish your app to Google Play's
@@ -201,8 +201,8 @@
<p>We recommend that you first test your In-app Billing implementation using static responses from
Google Play. This enables you to verify that your application is handling the primary Google
-Play responses correctly and that your application is able to verify signatures correctly. You can do this
-even if the app hasn't been published yet.</p>
+Play responses correctly and that your application is able to verify signatures correctly. You can
+do this even if the app hasn't been published yet.</p>
<p>To test your implementation with static responses, you make an In-app Billing request using a
special item that has a reserved product ID. Each reserved product ID returns a specific static
@@ -250,9 +250,11 @@
billing service. Refunds must be initiated by you (the merchant). After you process a refund
request through your Google payments merchant account, a refund message is sent to your application by
Google Play. This occurs only when Google Play gets notification from Google payments that
- a refund has been made. For more information about refunds, see <a href="{@docRoot}google/play/billing/v2/api.html#billing-action-notify">Handling
-IN_APP_NOTIFY messages</a> and <a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">In-app Billing
-Pricing</a>.</p>
+ a refund has been made. For more information about refunds, see <a
+ href="{@docRoot}google/play/billing/v2/api.html#billing-action-notify">Handling
+ IN_APP_NOTIFY messages</a> and <a
+ href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485"
+ >In-app Billing Pricing</a>.</p>
</li>
<li><strong>android.test.item_unavailable</strong>
<p>When you make an In-app Billing request with this product ID, Google Play responds as
diff --git a/docs/html/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd
index c53100e..a964449 100644
--- a/docs/html/google/play/billing/index.jd
+++ b/docs/html/google/play/billing/index.jd
@@ -68,14 +68,17 @@
provides a sample application that demonstrates how to sell standard in-app
products and subscriptions from inside an app.</p>
-<p>To get started, read the documents below or take the <a href="{@docRoot}training/in-app-billing/index.html">Selling
- In-app Products</a> training class.</p>
+<p>To get started, read the documents below or take the
+<a href="{@docRoot}training/in-app-billing/index.html">Selling In-app
+Products</a> training class.</p>
<dl>
- <dt><strong><a href="{@docRoot}google/play/billing/billing_overview.html">Overview</a></strong></dt>
+ <dt><strong><a href="{@docRoot}google/play/billing/billing_overview.html">
+ Overview</a></strong></dt>
<dd>Read this document for a description of the underlying concepts in In-app Billing.</dd>
<dt><strong><a href="{@docRoot}google/play/billing/api.html">Version 3 API</a></strong></dt>
- <dd>Read the documents in this section for an overview of the latest version of In-app Billing, as well as implementation details and API reference.</dd>
+ <dd>Read the documents in this section for an overview of the latest version of In-app Billing,
+ as well as implementation details and API reference.</dd>
<dt><strong><a href="{@docRoot}google/play/billing/billing_best_practices.html">Security
and Design</a></strong></dt>
<dd>Review these best practices to help ensure that your In-app Billing implementation is
diff --git a/docs/html/google/play/billing/versions.jd b/docs/html/google/play/billing/versions.jd
index aa35501..1b15b2d 100644
--- a/docs/html/google/play/billing/versions.jd
+++ b/docs/html/google/play/billing/versions.jd
@@ -2,13 +2,21 @@
page.title=In-app Billing Version Notes
@jd:body
-<p>The In-app Billing API is versioned, with each version offering additional features to your app. API support is provided by the Google Play Store app. On most devices, the Google Play Store app is updated automatically to support newer versions of the API.
+<p>
+ The In-app Billing API is versioned, with each version offering additional
+ features to your app. API support is provided by the Google Play Store app.
+ On most devices, the Google Play Store app is updated automatically to
+ support newer versions of the API.
+</p>
<p>The sections below list the supported versions of the In-app Billing API.</p>
<p id="api_check"><strong><em>How to check for In-app Billing version</em></strong></p>
-<p>At run time, your app can query the Google Play Store app to determine what version of the API it supports and what features are available. </p>
+<p>
+ At run time, your app can query the Google Play Store app to determine what
+ version of the API it supports and what features are available.
+</p>
<ul>
@@ -17,7 +25,12 @@
supports the version of the In-app Billing API that you are using by sending an
{@code isBillingSupported} request.</li>
-<li>If the In-app Billing API version that you are using is earlier than version 3, the version information is returned in the <code>API_VERSION</code> key of the Bundle object passed in the {@code sendBillingRequest} method. For more information, see <a href="{@docRoot}google/play/billing/v2/billing_reference.html#billing-interface-v2">In-app Billing Service Interface</a>.</li>
+<li>If the In-app Billing API version that you are using is earlier than version
+3, the version information is returned in the <code>API_VERSION</code> key of
+the Bundle object passed in the {@code sendBillingRequest} method. For more
+information, see
+<a href="{@docRoot}google/play/billing/v2/billing_reference.html#billing-interface-v2">
+In-app Billing Service Interface</a>.</li>
</ul>
<h3 id="version_5">In-app Billing version 5</h3>
@@ -38,17 +51,23 @@
<h3 id="version_3">In-app Billing version 3</h3>
<p><em>February 2013</em></p>
<ul>
-<li>Purchasing and querying managed in-app items requires Google Play client
+<li>Purchasing and querying managed in-app items requires Google Play client
version 3.9.16 or higher.</li>
-<li>Purchasing and querying subscription items requires Google Play client
+<li>Purchasing and querying subscription items requires Google Play client
version 3.10.10 or higher.</li>
-<li>Provides a new Android Interface Definition Language (AIDL) file named {@code IInAppBillingService.aidl}. The new interface offers these features:
+<li>Provides a new Android Interface Definition Language (AIDL) file named
+ {@code IInAppBillingService.aidl}. The new interface offers these features:
<ul>
-<li>Provides a new API to get details of in-app items published for the app including price, type, title and description.</li>
-<li>The purchase flow is synchronous and purchase information is available immediately after it completes.</li>
-<li>Purchase information of in-app purchases is maintained within the Google Play system till the purchase is consumed.</li>
-<li>An API to consume a purchase of an inapp item. All purchases of one-time in-app items are consumable and thereafter can be purchased again.</li>
-<li>An API to get current purchases of the user immediately. This list will not contain any consumed purchases.</li>
+<li>Provides a new API to get details of in-app items published for the app including price, type,
+ title and description.</li>
+<li>The purchase flow is synchronous and purchase information is available immediately after it
+ completes.</li>
+<li>Purchase information of in-app purchases is maintained within the Google Play system till the
+ purchase is consumed.</li>
+<li>An API to consume a purchase of an inapp item. All purchases of one-time in-app items are
+ consumable and thereafter can be purchased again.</li>
+<li>An API to get current purchases of the user immediately. This list will not contain any consumed
+ purchases.</li>
</ul>
</li>
</ul>
@@ -57,9 +76,13 @@
<p><em>May 2012</em></p>
<ul>
<li>Adds support for subscriptions, including free trial period.</li>
- <li>Adds a new supported string value, "2", for the <code>API_VERSION</code> key of the Bundle object passed in the <code>sendBillingRequest()</code>.</li>
- <li>Adds a new JSON field, <code>purchaseToken</code>, to the <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code> intent. </li>
- <li>Adds a new <code>purchaseState</code> value, <code>3</code> (expired), to the <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code> intent. The value indicates that a subscription has expired and is no longer valid.</li>
+ <li>Adds a new supported string value, "2", for the <code>API_VERSION</code> key of the Bundle
+ object passed in the <code>sendBillingRequest()</code>.</li>
+ <li>Adds a new JSON field, <code>purchaseToken</code>, to the <code>orders</code> list returned in
+ a <code>PURCHASE_STATE_CHANGED</code> intent. </li>
+ <li>Adds a new <code>purchaseState</code> value, <code>3</code> (expired), to the
+ <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code> intent. The value
+ indicates that a subscription has expired and is no longer valid.</li>
<li>Requires Google Play (Play Store) version 3.5 or higher.</li>
</ul>
@@ -69,5 +92,3 @@
<li>Initial release.</li>
<li>Requires Google Play/Android Market 2.3.4 or higher.</li>
</ul>
-
-
diff --git a/docs/html/images/tools/walking-threads-bg.jpg b/docs/html/images/tools/walking-threads-bg.jpg
deleted file mode 100644
index b521d9d..0000000
--- a/docs/html/images/tools/walking-threads-bg.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/html/training/location/geofencing.jd b/docs/html/training/location/geofencing.jd
index 59fc4c6..13dd790 100644
--- a/docs/html/training/location/geofencing.jd
+++ b/docs/html/training/location/geofencing.jd
@@ -13,7 +13,8 @@
<li><a href="#CreateAdd">Create and Add Geofences</a></li>
<li><a href="#HandleGeofenceTransitions">Handle Geofence Transitions</a></li>
<li><a href="#StopGeofenceMonitoring">Stop Geofence Monitoring</a></li>
-
+ <li><a href="#BestPractices">Use Best Practices for Geofencing</a></li>
+ <li><a href="#Troubleshooting">Troubleshoot the Geofence Entrance Event</a></li>
</ol>
<h2>You should also read</h2>
@@ -56,6 +57,16 @@
This lesson shows you how to add and remove geofences, and then listen for geofence transitions
using an {@link android.app.IntentService}.</p>
+<p>We recommend upgrading existing apps to use the
+<a href="{@docRoot}reference/com/google/android/gms/location/LocationServices.html">
+LocationServices</a> class, which contains the
+<a href="{@docRoot}reference/com/google/android/gms/location/GeofencingApi.html">
+GeofencingApi</a> interface. The
+<a href="{@docRoot}reference/com/google/android/gms/location/LocationServices.html">
+LocationServices</a> class replaces the
+<a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html">
+LocationClient</a> (deprecated).</p>
+
<h2 id="RequestGeofences">Set up for Geofence Monitoring</h2>
<p>
The first step in requesting geofence monitoring is to request the necessary permission.
@@ -97,6 +108,8 @@
{@link android.app.PendingIntent} as shown in this section.
</p>
+<p class="note"><strong>Note:</strong> On single-user devices, there is a limit of 100 geofences per app. For multi-user devices, the limit is 100 geofences per app per device user.</p>
+
<h3>Create geofence objects</h3>
<p>
@@ -145,25 +158,30 @@
</pre>
<p>
- This example shows the use of two geofence triggers. The <code><a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
+ This example shows the use of two geofence triggers. The <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
GEOFENCE_TRANSITION_ENTER</a></code>
- transition triggers when a device enters a geofence, and the <code><a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_EXIT">
+ transition triggers when a device enters a geofence, and the <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_EXIT">
GEOFENCE_TRANSITION_EXIT</a></code>
transition triggers when a device exits a geofence. Specifying
- <code><a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest.html#INITIAL_TRIGGER_ENTER">
+ <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest.html#INITIAL_TRIGGER_ENTER">
INITIAL_TRIGGER_ENTER</a></code> tells Location services that
- <code><a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
+ <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
GEOFENCE_TRANSITION_ENTER</a></code>
should be triggered if the the device is already inside the geofence.</p>
</p>
-<p>In many cases, it may be preferable to use instead <code><a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest.html#INITIAL_TRIGGER_DWELL">
+<p>In many cases, it may be preferable to use instead <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest.html#INITIAL_TRIGGER_DWELL">
INITIAL_TRIGGER_DWELL</a></code>,
which triggers events only when the user stops for a defined duration within a geofence.
This approach can help reduce "alert spam" resulting from large numbers notifications when a
device briefly enters and exits geofences. Another strategy for getting best results from your
geofences is to set a minimum radius of 100 meters. This helps account for the location accuracy
- of typical WiFi networks, and also helps reduce device power consumption.
+ of typical Wi-Fi networks, and also helps reduce device power consumption.
</p>
<h3>Define an Intent for geofence transitions</h3>
@@ -195,11 +213,15 @@
<h3>Add geofences</h3>
<p>
- To add geofences, use the <code><a href="{@docRoot}reference/com/google/android/gms/location/GeofencingApi.html#addGeofences(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.GeofencingRequest, android.app.PendingIntent)">{@code GeoencingApi.addGeofences()}</a></code> method.
- Provide the Google API client, the <code><a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest">
+ To add geofences, use the <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/GeofencingApi.html#addGeofences(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.GeofencingRequest, android.app.PendingIntent)">{@code GeoencingApi.addGeofences()}</a></code> method.
+ Provide the Google API client, the <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/GeofencingRequest">
GeofencingRequest</a></code> object, and the {@link android.app.PendingIntent}.
- The following snippet, which processes the results in <code><a href="{@docRoot}reference/com/google/android/gms/common/api/ResultCallback.html#onResult(R)">
- onResult()</a></code>, assumes that the main activity implements <code><a href="{@docRoot}reference/com/google/android/gms/common/api/ResultCallback.html">
+ The following snippet, which processes the results in <code>
+<a href="{@docRoot}reference/com/google/android/gms/common/api/ResultCallback.html#onResult(R)">
+ onResult()</a></code>, assumes that the main activity implements <code>
+<a href="{@docRoot}reference/com/google/android/gms/common/api/ResultCallback.html">
ResultCallback</a></code>:
</p>
<pre>
@@ -304,3 +326,112 @@
You can combine geofencing with other location-aware features, such as periodic location updates.
For more information, see the other lessons in this class.
</p>
+
+<h2 id="BestPractices">Use Best Practices for Geofencing</h2>
+
+<p>This section outlines recommendations for using geofencing with the location
+APIs for Android.</p>
+
+<h3>Reduce power consumption</h3>
+
+<p>You can use the following techniques to optimize power consumption in your apps that use geofencing:</p>
+
+<ul>
+<li><p>Set the <a href="{@docRoot}android/reference/com/google/android/gms/location/Geofence.Builder.html#setNotificationResponsiveness(int)">
+notification responsiveness</a> to a higher value. Doing so improves power consumption by
+increasing the latency of geofence alerts. For example, if you set a responsiveness value of five
+minutes your app only checks for an entrance or exit alert once every five minutes.
+Setting lower values does not necessarily mean that users will be notified within that time period
+(for example, if you set a value of 5 seconds it may take a bit longer than that to receive the
+alert).</p></li>
+<li><p>Use a larger geofence radius for locations where a user spends a significant amount of time,
+such as home or work. While a larger radius doesn't directly reduce power consumption, it reduces
+the frequency at which the app checks for entrance or exit, effectively lowering overall power
+consumption.</p></li>
+</ul>
+
+<h3>Choose the optimal radius for your geofence</h3>
+<p>For best results, the minimium radius of the geofence should be set between 100 - 150 meters.
+When Wi-Fi is available location accuracy is usually between 20 - 50 meters. When indoor
+location is available, the accuracy range can be as small as 5 meters. Unless you know indoor
+location is available inside the geofence, assume that Wi-Fi location accuracy is about
+50 meters.</p>
+
+<p>When Wi-Fi location is not available (for example, when you are driving in rural areas) the
+location accuracy degrades. The accuracy range can be as large as several hundred meters to
+several kilometers. In cases like this, you should create geofences using a larger radius.</p>
+
+<h3>Use the dwell transition type to reduce alert spam</h3>
+
+<p>If you receive a large number of alerts when driving briefly past a geofence, the best way to
+reduce the alerts is to use a transition type of <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_DWELL">
+GEOFENCE_TRANSITION_DWELL</a></code> instead of <code>
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
+GEOFENCE_TRANSITION_ENTER</a></code>. This way, the dwelling alert is sent only when the user stops
+inside a geofence for a given period of time. You can choose the duration by setting a
+<a href="{@docRoot}reference/com/google/android/gms/location/Geofence.Builder.html#setLoiteringDelay(int)">
+loitering delay</a>.</p>
+
+<h3>Re-register geofences only when required</h3>
+
+<p>Registered geofences are kept in the <code>com.google.process.location</code> process owned by
+the <code>com.google.android.gms</code> package.
+The app doesn’t need to do anything to handle the following events, because the system
+restores geofences after these events:</p>
+<ul>
+<li>Google Play services is upgraded.</li>
+<li>Google Play services is killed and restarted by the system due resource restriction.</li>
+<li>The location process crashes.</li>
+</ul>
+<p>The app must re-register geofences if they're still needed after the following events, since
+the system cannot recover the geofences in the following cases:</p>
+
+<ul>
+<li>The device is rebooted. The app should listen for the device's boot complete action, and then re-
+register the geofences required.</li>
+<li>The app is uninstalled and re-installed.</li>
+<li>The app's data is cleared.</li>
+<li>Google Play services data is cleared.</li>
+<li>The app has received a <code><a href="{@docRoot}reference/com/google/android/gms/location/LocationStatusCodes.html#GEOFENCE_NOT_AVAILABLE">GEOFENCE_NOT_AVAILABLE</a></code>
+alert. This typically happens
+after NLP (Android's Network Location Provider) is disabled.</li>
+</ul>
+
+<h2 id="Troubleshooting">Troubleshoot the Geofence Entrance Event</h2>
+
+<p>If geofences are not being triggered when the device enters a geofence
+(the <code><a href="{@docRoot}reference/com/google/android/gms/location/Geofence.html#GEOFENCE_TRANSITION_ENTER">
+GEOFENCE_TRANSITION_ENTER</a></code> alert isn’t triggered), first ensure that your geofences are
+registered properly as described in this guide.</p>
+
+<p>Here are some possible reasons for alerts not working as expected:</p>
+
+<ul>
+<li><strong>Accurate location is not available inside your geofence or your geofence is too
+small.</strong> On most devices, the geofence service uses only network location for geofence
+triggering. The service uses this approach because network location consumes much less
+power, it takes less time to get discrete locations, and most importantly it’s available indoors.
+Starting with Google Play services 3.2, the geofence service calculates the overlapping ratio of
+the location circle and the geofence circle and only generates the entrance alert when the ratio
+is at least 85% for a bigger geofence or 75% for a smaller geofence. For an exit alert, the ratio
+threshold used is 15% or 25%. Any ratio between these thresholds makes the geofence service mark
+the geofence state as <code>INSIDE_LOW_CONFIDENCE</code> or <code>OUTSIDE_LOW_CONFIDENCE</code> and
+no alert is sent.</li>
+<li><strong>Wi-Fi is turned off on the device.</strong> Having Wi-Fi on can significantly improve
+the location accuracy, so if Wi-Fi is turned off, your application might never get geofence alerts
+depending on several settings including the radius of the geofence, the device model, or the
+Android version. Starting from Android 4.3 (API level 18), we added the capability of “Wi-Fi scan
+only mode” which allows users to disable Wi-Fi but still get good network location. It’s good
+practice to prompt the user and provide a shortcut for the user to enable Wi-Fi or Wi-Fi scan only
+mode if both of them are disabled. Use <a href="{@docRoot}reference/com/google/android/gms/location/SettingsApi">
+SettingsApi</a> to ensure that the device's system settings are properly configured for optimal
+location detection.</li>
+<li><strong>There is no reliable network connectivity inside your geofence.</strong> If there is
+no reliable data connection, alerts might not be generated. This is because the geofence service
+depends on the network location provider which in turn requires a data connection.</li>
+<li><strong>Alerts can be late.</strong> The geofence service does not continuously query for
+location, so expect some latency when receiving alerts. Usually the latency is less than 2
+minutes, even less when the device has been moving. If the device has been stationary for a
+significant period of time, the latency may increase (up to 6 minutes).</li>
+</ul>
diff --git a/docs/html/training/material/index.jd b/docs/html/training/material/index.jd
index 6e07860..4001e6b 100644
--- a/docs/html/training/material/index.jd
+++ b/docs/html/training/material/index.jd
@@ -59,3 +59,22 @@
<dt><a href="{@docRoot}training/material/compatibility.html">Maintaining Compatibility</a></dt>
<dd>Learn how to maintain compatibility with platform versions earlier than Android 5.0.</dd>
</dl>
+
+<h2>Video Training</h2>
+
+<div class="wrap">
+ <div class="cols">
+ <div class="col-1of2">
+ <p>If you prefer to learn through interactive video training, check out this online course
+ about material design for Android developers.</p>
+ <p><a href="https://www.udacity.com/course/ud862" class="button">
+ Start the video course</a>
+ </p>
+ </div>
+ <div class="col-1of2">
+ <iframe width="300" height="169"
+ src="//www.youtube.com/embed/eKJ3aMGM-WM?autohide=1&showinfo=0"
+ frameborder="0" allowfullscreen="" style="float: right; margin: 0 0 20px 20px;"></iframe>
+ </div>
+ </div>
+</div>