diff options
Diffstat (limited to 'docs/html')
43 files changed, 1184 insertions, 326 deletions
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd index 2397dfe..e04940b 100644 --- a/docs/html/about/dashboards/index.jd +++ b/docs/html/about/dashboards/index.jd @@ -57,7 +57,7 @@ Platform Versions</a>.</p> </div> -<p style="clear:both"><em>Data collected during a 7-day period ending on June 1, 2015. +<p style="clear:both"><em>Data collected during a 7-day period ending on August 3, 2015. <br/>Any versions with less than 0.1% distribution are not shown.</em> </p> @@ -88,7 +88,7 @@ Screens</a>.</p> </div> -<p style="clear:both"><em>Data collected during a 7-day period ending on June 1, 2015. +<p style="clear:both"><em>Data collected during a 7-day period ending on August 3, 2015. <br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p> @@ -108,7 +108,7 @@ support for any lower version (for example, support for version 2.0 also implies <img alt="" style="float:right" -src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0%7CGL%203.1&chf=bg%2Cs%2C00000000&chd=t%3A63.0%2C35.0%2C2.0&chco=c4df9b%2C6fad0c&cht=p&chs=400x250"> +src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0%7CGL%203.1&chf=bg%2Cs%2C00000000&chd=t%3A59.8%2C36.8%2C3.4&chco=c4df9b%2C6fad0c&cht=p&chs=400x250"> <p>To declare which version of OpenGL ES your application requires, you should use the {@code android:glEsVersion} attribute of the <a @@ -126,39 +126,64 @@ uses.</p> </tr> <tr> <td>2.0</td> -<td>63.0%</td> +<td>59.8%</td> </tr> <tr> <td>3.0</td> -<td>35.0%</td> +<td>36.8%</td> </tr> <tr> <td>3.1</td> -<td>2.0%</td> +<td>3.4%</td> </tr> </table> -<p style="clear:both"><em>Data collected during a 7-day period ending on June 1, 2015</em></p> - - - - - - +<p style="clear:both"><em>Data collected during a 7-day period ending on August 3, 2015</em></p> +<script> +var SCREEN_DATA = +[ + { + "data": { + "Large": { + "hdpi": "0.6", + "ldpi": "0.3", + "mdpi": "4.9", + "tvdpi": "2.3", + "xhdpi": "0.6" + }, + "Normal": { + "hdpi": "40.6", + "mdpi": "6.9", + "tvdpi": "0.1", + "xhdpi": "20.4", + "xxhdpi": "15.8" + }, + "Small": { + "ldpi": "3.6" + }, + "Xlarge": { + "hdpi": "0.3", + "mdpi": "3.0", + "xhdpi": "0.6" + } + }, + "densitychart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A3.9%2C14.8%2C2.4%2C41.5%2C21.6%2C15.8&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi", + "layoutchart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A3.9%2C8.7%2C83.8%2C3.6&chl=Xlarge%7CLarge%7CNormal%7CSmall" + } +]; -<script> var VERSION_DATA = [ { - "chart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=500x250&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat%7CLollipop&chd=t%3A0.3%2C5.6%2C5.1%2C37.4%2C39.2%2C12.4&chf=bg%2Cs%2C00000000", + "chart": "//chart.googleapis.com/chart?chs=500x250&cht=p&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A0.3%2C4.6%2C4.1%2C33.6%2C39.3%2C18.1&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat%7CLollipop", "data": [ { "api": 8, @@ -168,82 +193,48 @@ var VERSION_DATA = { "api": 10, "name": "Gingerbread", - "perc": "5.6" + "perc": "4.6" }, { "api": 15, "name": "Ice Cream Sandwich", - "perc": "5.1" + "perc": "4.1" }, { "api": 16, "name": "Jelly Bean", - "perc": "14.7" + "perc": "13.0" }, { "api": 17, "name": "Jelly Bean", - "perc": "17.5" + "perc": "15.9" }, { "api": 18, "name": "Jelly Bean", - "perc": "5.2" + "perc": "4.7" }, { "api": 19, "name": "KitKat", - "perc": "39.2" + "perc": "39.3" }, { "api": 21, "name": "Lollipop", - "perc": "11.6" + "perc": "15.5" }, { "api": 22, "name": "Lollipop", - "perc": "0.8" + "perc": "2.6" } ] } ]; -var SCREEN_DATA = -[ - { - "data": { - "Large": { - "hdpi": "0.6", - "ldpi": "0.4", - "mdpi": "4.8", - "tvdpi": "2.2", - "xhdpi": "0.6" - }, - "Normal": { - "hdpi": "39.9", - "mdpi": "7.6", - "tvdpi": "0.1", - "xhdpi": "19.8", - "xxhdpi": "15.9" - }, - "Small": { - "ldpi": "4.1" - }, - "Xlarge": { - "hdpi": "0.3", - "mdpi": "3.1", - "xhdpi": "0.6" - } - }, - "densitychart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=400x250&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A4.5%2C15.5%2C2.3%2C40.8%2C21.0%2C15.9&chf=bg%2Cs%2C00000000", - "layoutchart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=400x250&chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.0%2C8.6%2C83.3%2C4.1&chf=bg%2Cs%2C00000000" - } -]; - - - var VERSION_NAMES = [ {"api":0},{"api":1},{"api":2},{"api":3}, diff --git a/docs/html/auto/images/logos/auto/buick.png b/docs/html/auto/images/logos/auto/buick.png Binary files differnew file mode 100644 index 0000000..206b907 --- /dev/null +++ b/docs/html/auto/images/logos/auto/buick.png diff --git a/docs/html/auto/images/logos/auto/cadillac.png b/docs/html/auto/images/logos/auto/cadillac.png Binary files differnew file mode 100644 index 0000000..3990f70 --- /dev/null +++ b/docs/html/auto/images/logos/auto/cadillac.png diff --git a/docs/html/auto/images/logos/auto/citroen.png b/docs/html/auto/images/logos/auto/citroen.png Binary files differnew file mode 100644 index 0000000..913db78 --- /dev/null +++ b/docs/html/auto/images/logos/auto/citroen.png diff --git a/docs/html/auto/images/logos/auto/citroen_ds.png b/docs/html/auto/images/logos/auto/citroen_ds.png Binary files differnew file mode 100644 index 0000000..159a150 --- /dev/null +++ b/docs/html/auto/images/logos/auto/citroen_ds.png diff --git a/docs/html/auto/images/logos/auto/gmc.png b/docs/html/auto/images/logos/auto/gmc.png Binary files differnew file mode 100644 index 0000000..ab36da1 --- /dev/null +++ b/docs/html/auto/images/logos/auto/gmc.png diff --git a/docs/html/auto/images/logos/auto/holden.png b/docs/html/auto/images/logos/auto/holden.png Binary files differnew file mode 100644 index 0000000..e331857 --- /dev/null +++ b/docs/html/auto/images/logos/auto/holden.png diff --git a/docs/html/auto/images/logos/auto/mahindra.png b/docs/html/auto/images/logos/auto/mahindra.png Binary files differnew file mode 100644 index 0000000..bd3957a --- /dev/null +++ b/docs/html/auto/images/logos/auto/mahindra.png diff --git a/docs/html/auto/images/logos/auto/peugeot.png b/docs/html/auto/images/logos/auto/peugeot.png Binary files differnew file mode 100644 index 0000000..d76a4bc --- /dev/null +++ b/docs/html/auto/images/logos/auto/peugeot.png diff --git a/docs/html/auto/images/logos/auto/ssangyong.png b/docs/html/auto/images/logos/auto/ssangyong.png Binary files differnew file mode 100644 index 0000000..9e0f117 --- /dev/null +++ b/docs/html/auto/images/logos/auto/ssangyong.png diff --git a/docs/html/auto/images/logos/auto/vauxhall.png b/docs/html/auto/images/logos/auto/vauxhall.png Binary files differnew file mode 100644 index 0000000..9fe691f --- /dev/null +++ b/docs/html/auto/images/logos/auto/vauxhall.png diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd index bf36995..2f0ffd5 100644 --- a/docs/html/auto/index.jd +++ b/docs/html/auto/index.jd @@ -334,132 +334,267 @@ page.image=/images/cards/android-auto_2x.png Android Auto is coming soon to new cars from these manufacturers </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/abarth.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.abarth.com/"> + <img src="{@docRoot}auto/images/logos/auto/abarth.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/alpharomeo.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.acura.com/"> + <img src="{@docRoot}auto/images/logos/auto/acura.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/acura.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.alfaromeo.com/"> + <img src="{@docRoot}auto/images/logos/auto/alpharomeo.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/audi.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.audi.com/"> + <img src="{@docRoot}auto/images/logos/auto/audi.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/bentley.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.bentleymotors.com/"> + <img src="{@docRoot}auto/images/logos/auto/bentley.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/chevrolet.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.buick.com/"> + <img src="{@docRoot}auto/images/logos/auto/buick.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/chrysler.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.cadillac.com/"> + <img src="{@docRoot}auto/images/logos/auto/cadillac.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/dodge.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.chevrolet.com/"> + <img src="{@docRoot}auto/images/logos/auto/chevrolet.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/fiat.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.chrysler.com/"> + <img src="{@docRoot}auto/images/logos/auto/chrysler.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/ford.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.citroen.com/"> + <img src="{@docRoot}auto/images/logos/auto/citroen.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/honda.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.dodge.com/"> + <img src="{@docRoot}auto/images/logos/auto/dodge.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/hyundai.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.driveds.com/"> + <img src="{@docRoot}auto/images/logos/auto/citroen_ds.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/infinity.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.fiat.com/"> + <img src="{@docRoot}auto/images/logos/auto/fiat.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/jeep.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.ford.com/"> + <img src="{@docRoot}auto/images/logos/auto/ford.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/kia.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.gmc.com/"> + <img src="{@docRoot}auto/images/logos/auto/gmc.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/maserati.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.holden.com/"> + <img src="{@docRoot}auto/images/logos/auto/holden.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/mazda.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.honda.com/"> + <img src="{@docRoot}auto/images/logos/auto/honda.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/mitsubishi.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.hyundai.com"> + <img src="{@docRoot}auto/images/logos/auto/hyundai.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/nissan.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.infiniti.com/"> + <img src="{@docRoot}auto/images/logos/auto/infinity.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/opel.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.jeep.com/"> + <img src="{@docRoot}auto/images/logos/auto/jeep.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/ram.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.kia.com/worldwide/"> + <img src="{@docRoot}auto/images/logos/auto/kia.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/renault.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.mahindra.com/"> + <img src="{@docRoot}auto/images/logos/auto/mahindra.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/seat.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.maserati.com/"> + <img src="{@docRoot}auto/images/logos/auto/maserati.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/skoda.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.mazda.com/"> + <img src="{@docRoot}auto/images/logos/auto/mazda.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + <div class="cols cols-leftp"> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/subaru.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.mitsubishi-motors.com/"> + <img src="{@docRoot}auto/images/logos/auto/mitsubishi.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/suzuki.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.nissan-global.com/"> + <img src="{@docRoot}auto/images/logos/auto/nissan.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/volkswagen.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.opel.com/"> + <img src="{@docRoot}auto/images/logos/auto/opel.png" + width="120" height="120" class="img-logo" /> + </a> </div> <div class="col-5"> - <img src="{@docRoot}auto/images/logos/auto/volvo.png" - width="120" height="120" class="img-logo" /> + <a href="http://www.peugeot.com/"> + <img src="{@docRoot}auto/images/logos/auto/peugeot.png" + width="120" height="120" class="img-logo" /> + </a> </div> </div> + + <div class="cols cols-leftp"> + <div class="col-5"> + <a href="http://www.ramtrucks.com/"> + <img src="{@docRoot}auto/images/logos/auto/ram.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.renault.com/"> + <img src="{@docRoot}auto/images/logos/auto/renault.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.seat.com/"> + <img src="{@docRoot}auto/images/logos/auto/seat.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.skoda-auto.com/"> + <img src="{@docRoot}auto/images/logos/auto/skoda.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + </div> + + <div class="cols cols-leftp"> + <div class="col-5"> + <a href="http://www.smotor.com/"> + <img src="{@docRoot}auto/images/logos/auto/ssangyong.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.subaru-global.com/"> + <img src="{@docRoot}auto/images/logos/auto/subaru.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.globalsuzuki.com/automobile/"> + <img src="{@docRoot}auto/images/logos/auto/suzuki.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.vauxhall.co.uk/"> + <img src="{@docRoot}auto/images/logos/auto/vauxhall.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + </div> + + <div class="cols cols-leftp"> + <div class="col-5"></div> + <div class="col-5"> + <a href="http://www.volkswagen.com/"> + <img src="{@docRoot}auto/images/logos/auto/volkswagen.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"> + <a href="http://www.volvocars.com/intl"> + <img src="{@docRoot}auto/images/logos/auto/volvo.png" + width="120" height="120" class="img-logo" /> + </a> + </div> + <div class="col-5"></div> + + </div> </div> </div> diff --git a/docs/html/distribute/essentials/quality/auto.jd b/docs/html/distribute/essentials/quality/auto.jd index ae9aac5..f547616 100644 --- a/docs/html/distribute/essentials/quality/auto.jd +++ b/docs/html/distribute/essentials/quality/auto.jd @@ -396,7 +396,8 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - Media apps do not autoplay or take over media focus when launched. + Media apps do not autoplay on startup of Android Auto or without user initiated action to + select the app or app media. (<a href="{@docRoot}training/auto/audio/index.html#playback-commands">Learn How</a>) </p> </td> diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd index 05ab185..13660b0 100644 --- a/docs/html/google/play/billing/billing_subscriptions.jd +++ b/docs/html/google/play/billing/billing_subscriptions.jd @@ -211,7 +211,7 @@ to query and update your records and follow up with customers directly, if neede <h3 id="manual-renewal">Manual Renewal</h3> -<p>With version 5 of the In-app Billing API, users can renew a subscription +<p>With version 3 of the In-app Billing API, users can renew a subscription during its active period even if the subscription is not set to automatically renew. If the user purchases a subscription while the subscription is active, it is extended by the appropriate period at the current rate.</p> @@ -230,7 +230,7 @@ say <strong>renew</strong>.</p> <h3 id="upgrade">Subscription Upgrade/Downgrade</h3> <p> - With version 5 of the In-app Billing API, users can upgrade or downgrade a + With version 3 of the In-app Billing API, users can upgrade or downgrade a subscription during its active period. When the user does this, the active subscription is canceled and a new subscription is created. The unused balance of the old subscription is applied on a pro-rated basis to the new diff --git a/docs/html/images/tools/studio-allocation-tracker-icon.png b/docs/html/images/tools/studio-allocation-tracker-icon.png Binary files differnew file mode 100644 index 0000000..3b6e5ba --- /dev/null +++ b/docs/html/images/tools/studio-allocation-tracker-icon.png diff --git a/docs/html/images/tools/studio-allocation-tracker.png b/docs/html/images/tools/studio-allocation-tracker.png Binary files differnew file mode 100644 index 0000000..058a099 --- /dev/null +++ b/docs/html/images/tools/studio-allocation-tracker.png diff --git a/docs/html/images/tools/studio-dump-heap-icon.png b/docs/html/images/tools/studio-dump-heap-icon.png Binary files differnew file mode 100644 index 0000000..0e4985c --- /dev/null +++ b/docs/html/images/tools/studio-dump-heap-icon.png diff --git a/docs/html/images/tools/studio-fingerprint.png b/docs/html/images/tools/studio-fingerprint.png Binary files differnew file mode 100644 index 0000000..f4e4581 --- /dev/null +++ b/docs/html/images/tools/studio-fingerprint.png diff --git a/docs/html/images/tools/studio-garbage-collect.png b/docs/html/images/tools/studio-garbage-collect.png Binary files differnew file mode 100644 index 0000000..05bb9ca --- /dev/null +++ b/docs/html/images/tools/studio-garbage-collect.png diff --git a/docs/html/images/tools/studio-hprof-viewer.png b/docs/html/images/tools/studio-hprof-viewer.png Binary files differnew file mode 100644 index 0000000..226f3b0 --- /dev/null +++ b/docs/html/images/tools/studio-hprof-viewer.png diff --git a/docs/html/images/tools/studio-sdk-dwnld-icon.png b/docs/html/images/tools/studio-sdk-dwnld-icon.png Binary files differnew file mode 100644 index 0000000..89eb057 --- /dev/null +++ b/docs/html/images/tools/studio-sdk-dwnld-icon.png diff --git a/docs/html/images/tools/studio-sdk-manager-packages.png b/docs/html/images/tools/studio-sdk-manager-packages.png Binary files differnew file mode 100644 index 0000000..356073e --- /dev/null +++ b/docs/html/images/tools/studio-sdk-manager-packages.png diff --git a/docs/html/images/tools/studio-sdk-removal-icon.png b/docs/html/images/tools/studio-sdk-removal-icon.png Binary files differnew file mode 100644 index 0000000..9b5e9f7 --- /dev/null +++ b/docs/html/images/tools/studio-sdk-removal-icon.png diff --git a/docs/html/images/tools/studio-test-module.png b/docs/html/images/tools/studio-test-module.png Binary files differnew file mode 100644 index 0000000..c0aa58f --- /dev/null +++ b/docs/html/images/tools/studio-test-module.png diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd index c05edb9..dbc0f35 100644 --- a/docs/html/sdk/index.jd +++ b/docs/html/sdk/index.jd @@ -5,28 +5,29 @@ page.image=images/cards/android-studio_2x.png header.hide=1 page.metaDescription=Download the official Android IDE and developer tools to build apps for Android phones, tablets, wearables, TVs, and more. -studio.version=1.2.2.0 +studio.version=1.3.1.0 -studio.linux_bundle_download=android-studio-ide-141.1980579-linux.zip -studio.linux_bundle_bytes=258628239 -studio.linux_bundle_checksum=1fcb226bcf71760296b07dc0db74216563ce83f7 +studio.linux_bundle_download=android-studio-ide-141.2135290-linux.zip +studio.linux_bundle_bytes=351992670 +studio.linux_bundle_checksum=51e5f5de2b82883d87f85ee38cf7b7b8b2e7debf -studio.mac_bundle_download=android-studio-ide-141.1980579-mac.dmg -studio.mac_bundle_bytes=260363204 -studio.mac_bundle_checksum=811a868958f8799a1c86a3acfab0fc5dc8de2f41 +studio.mac_bundle_download=android-studio-ide-141.2135290-mac.dmg +studio.mac_bundle_bytes=368321249 +studio.mac_bundle_checksum=9fc12b5657ff52c761b7e7c115feade2a9728386 -studio.win_bundle_download=android-studio-ide-141.1980579-windows.zip -studio.win_bundle_bytes=261036618 -studio.win_bundle_checksum=e61c9c27a92eff943f6bfdcdec3827199dd0c63d +studio.win_bundle_download=android-studio-ide-141.2135290-windows.zip +studio.win_bundle_bytes=344406793 +studio.win_bundle_checksum=3b4c4924cb9495e56db61ca0e8c8d2bf588c4b97 -studio.win_bundle_exe_download=android-studio-bundle-141.1980579-windows.exe -studio.win_bundle_exe_bytes=930456592 -studio.win_bundle_exe_checksum=964959e5165e90aaf693e868d5d1c2f7b38e8754 +studio.win_bundle_exe_download=android-studio-bundle-141.2135290-windows.exe +studio.win_bundle_exe_bytes=1008506096 +studio.win_bundle_exe_checksum=8cff590f2e08e339f8c2491b287a840ae87c7383 + +studio.win_notools_exe_download=android-studio-ide-141.2135290-windows.exe +studio.win_notools_exe_bytes=321791312 +studio.win_notools_exe_checksum=d70fb49d03db9dded19c891a92452601e39272f4 -studio.win_notools_exe_download=android-studio-ide-141.1980579-windows.exe -studio.win_notools_exe_bytes=243741776 -studio.win_notools_exe_checksum=ae09797db2537afb572a00b7eacc292bb66d539e diff --git a/docs/html/sdk/installing/studio-tips.jd b/docs/html/sdk/installing/studio-tips.jd index 7d37b1d..b8511a4 100644 --- a/docs/html/sdk/installing/studio-tips.jd +++ b/docs/html/sdk/installing/studio-tips.jd @@ -131,11 +131,42 @@ a class, method, or field from a library for which you do not have source file a build and run code prototypes. Together with Android Studio coding assistance, scratch files allow you to quickly run and debug code updates with the support of all file operations. By embedding code created with scripting languages, you can run your code from within the - scratch file.</p> + scratch file.</p> </li> </ul> +<h3 id="live-template">Live templates</h3> +<p>Live templates allow you to enter code snippets for fast insertion and completion of small chunks +of code. To insert a live template, type the template abbreviations and press the +Tab key. Android Studio inserts the code snippet associated with the template into +your code. </p> + +<p>For example, entering the <code>newInstance</code> abbreviation followed by the +Tab key inserts the code for a new fragment instance with argument placeholders. </p> + +<pre> +public static $fragment$ newInstance($args$) { + $nullChecks$ + Bundle args = new Bundle(); + $addArgs$ + $fragment$ fragment = new $fragment$(); + fragment.setArguments(args); + return fragment; +} +</pre> + +<p>Similarly, the <code>fbc</code> abbreviation inserts a <code>findViewById</code> call along +with cast and resource id syntax. </p> + +<pre> +() findViewById(R.id.); +</pre> + +<p>Use the <strong>File > Settings > Editor > Live Templates</strong> menu option to +display the full list of supported live templates and customize the inserted code. </p> + + <h2 id="intellij">Working with IntelliJ-based Coding Practices</h3> diff --git a/docs/html/tools/building/manifest-merge.jd b/docs/html/tools/building/manifest-merge.jd index 54166ec..2253584 100644 --- a/docs/html/tools/building/manifest-merge.jd +++ b/docs/html/tools/building/manifest-merge.jd @@ -303,7 +303,12 @@ attribute value. </p> <p class="note"><strong>Note:</strong> Android Studio provides a default <code>${applicationId}</code> placeholder for the <code>build.gradle</code> -<code>applicationId</code> value that is not shown in the build file.</p> +<code>applicationId</code> value that is not shown in the build file. +When building an AAR (Android ARchive) package for library modules, do not provide an +automatic <code>@{applicationId}</code> placeholder in the +<a href="{@docRoot}tools/building/manifest-merge.html">manifest merge</a> settings. +Instead, use a different placeholder, such as <code>@{libApplicationId}</code> and +provide a value for it if you want to include application Ids in the archive library. </p> <p>Manifest entry:</p> diff --git a/docs/html/tools/building/plugin-for-gradle.jd b/docs/html/tools/building/plugin-for-gradle.jd index a497c1b..c1ec425 100644 --- a/docs/html/tools/building/plugin-for-gradle.jd +++ b/docs/html/tools/building/plugin-for-gradle.jd @@ -1,4 +1,4 @@ -page.title=Android Plug-in for Gradle +page.title=Android Plugin for Gradle @jd:body diff --git a/docs/html/tools/debugging/annotations.jd b/docs/html/tools/debugging/annotations.jd index fe9f9cc..b0d5a22 100644 --- a/docs/html/tools/debugging/annotations.jd +++ b/docs/html/tools/debugging/annotations.jd @@ -7,7 +7,12 @@ page.title=Improving Code Inspection with Annotations <h2>In this document</h2> <ol> <li><a href="#adding-nullness">Adding Nullness Annotations</a></li> - <li><a href="#res-annotations">Adding Resource Annotation</a></li> + <li><a href="#res-annotations">Adding Resource Annotations</a></li> + <li><a href="#thread-annotations">Adding Thread Annotations</a></li> + <li><a href="#value-constraint">Adding Value Constraint Annotations</a></li> + <li><a href="#permissions">Adding Permission Annotations</a></li> + <li><a href="#check-result">Adding CheckResult Annotations</a></li> + <li><a href="#call-super">Adding CallSuper Annotations</a></li> <li><a href="#enum-annotations">Creating Enumerated Annotations</a></li> </ol> @@ -70,6 +75,10 @@ values in your code, for example:</p> <dt>{@link android.support.annotation.AnyRes @AnyRes}</dt> <dd>References any type of <a href="{@docRoot}reference/android/R.html"><code>R.</code></a> resource. </dd> + + <dt><code>@UiThread</code></dt> + <dd>Calls from a UI + <a href="{@docRoot}guide/components/processes-and-threads.html">thread</a>. </dd> </dl> <p>For a complete list of the supported annotations, either examine the contents of the @@ -85,11 +94,14 @@ development tools.</p> <p>To add annotations to your code, first add a dependency to the {@link android.support.annotation Support-Annotations} library. In Android Studio, -add the dependency to your <code>build.gradle</code> file. </p> +add the dependency using the <strong>File > Project Structure > Dependencies</strong> menu +option or your <code>build.gradle</code> file. The following example shows how to add the +{@link android.support.annotation Support-Annotations} library dependency in the +<code>build.gradle</code> file: </p> <pre> dependencies { - compile 'com.android.support:support-annotations:22.0.0' + compile 'com.android.support:support-annotations:22.2.0' } </pre> @@ -143,18 +155,20 @@ inferring nullability in Android Studio, see <h2 id="res-annotations">Adding Resource Annotations</h2> -<p>Add {@link android.support.annotation.StringRes @StringRes} annotations to check that -a resource parameter contains a +<p>Validating resource types can be useful as Android references to resources, such as +<a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>Drawables</code></a> and +<a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> resources, are +passed as integers. Code that expects a parameter to reference a specific type of resource, for +example <a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>Drawables</code></a>, +can be passed the expected reference type of <code>int</code>, but actually reference a different +type of resource, such as a <code>R.string</code></a> resource. </p> + +<p>For example, add {@link android.support.annotation.StringRes @StringRes} annotations to check +that a resource parameter contains a <a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> reference. During code inspection, the annotation generates a warning if a <code>R.string</code> reference is not passed in the parameter.</p> -<p>Validating resource types can be useful as Android references to -<a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>Drawables</code></a> and -<a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> resources are both -passed as integers. Code that expects a parameter to reference a <code>Drawable</code> can be passed -the expected reference type of int, but actually reference a <code>R.string</code></a> resource. </p> - <p>This example attaches the {@link android.support.annotation.StringRes @StringRes} annotation to the <code>resId</code> parameter to validate that it is really a string resource. </p> @@ -168,11 +182,135 @@ import android.support.annotation.StringRes; <p>Annotations for the other resource types, such as {@link android.support.annotation.DrawableRes @DrawableRes}, +{@link android.support.annotation.DimenRes @DimenRes}, {@link android.support.annotation.ColorRes @ColorRes}, and {@link android.support.annotation.InterpolatorRes @InterpolatorRes} can be added using the same annotation format and run during the code inspection. </p> + + +<h2 id="thread-annotations">Adding Thread Annotations</h2> +<p>Thread annotations check if a method is called from a specific type of +<a href="{@docRoot}guide/components/processes-and-threads.html">thread</a>. The following thread +annotations are supported: </p> +<ul> + <li><code>@UiThread</code> </li> + <li><code>@MainThread</code> </li> + <li><code>@WorkerThread</code> </li> + <li><code>@BinderThread</code> +</ul> + +<p class="note"><strong>Note:</strong> The <code>@MainThread</code> +and the <code>@UiThread</code> annotations are interchangeable so +methods calls from either thread type are allowed for these annotations. </p> + + +<p>If all methods in a class share the same threading requirement, you can add a single +<a href="{@docRoot}guide/components/processes-and-threads.html">thread</a> +annotation to the class to verify that all methods in the class are called from the same type of +<a href="{@docRoot}guide/components/processes-and-threads.html">thread</a>. </p> + +<p>A common use of the <a href="{@docRoot}guide/components/processes-and-threads.html">thread</a> +annotation is to validate method overrides in the +<a href="{@docRoot}reference/android/os/AsyncTask.html">AsyncTask</a> class as this class performs +background operations and publishes results only on the UI +<a href="{@docRoot}guide/components/processes-and-threads.html">thread</a>. </p> + + + +<h2 id="value-constraint">Adding Value Constraint Annotations</h2> +<p>Use the <code>@IntRange</code>, +<code>@FloatRange</code>, and +<code>@Size</code> annotations to validate the values of passed +parameters. </p> + +<p>The <code>@IntRange</code> annotation validates that the parameter +value is within a specified range. The following example ensures that the <code>alpha</code> +parameter contains an integer value from 0 to 255: </p> + +<pre> +public void setAlpha(@IntRange(from=0,to=255) int alpha) { … } +</pre> + +<p>The <code>@FloatRange</code> annotation checks that the parameter +value is within a specified range of floating point values. The following example ensures that the +<code>alpha</code> parameter contains a float value from 0.0 to 1.0: </p> + +<pre> +public void setAlpha(@FloatRange(from=0.0, to=1.0) float alpha) {...} +</pre> + +<p>The <code>@Size</code> annotation checks the size of a collection or +array, as well as the length of a string. For example, use the <code>@Size(min=1)</code> +annotation to check if a collection is not empty, and the <code>@Size(2)</code> annotation to +validate that an array contains exactly two values. The following example ensures that the +<code>location</code> array contains at least one element: </p> + +<pre> +int[] location = new int[3]; +button.getLocationOnScreen(@Size(min=1) location); +</pre> + + +<h2 id="permissions">Adding Permission Annotations</h2> +<p>Use the <code>@RequiresPermission</code> annotation to +validate the permissions of the caller of a method. To check for a single permission from a +list the valid permissions, use the <code>anyOf</code> attribute. To check for a set of +permissions, use the <code>allOf</code> attribute. The following example annotates the +<code>setWallpaper</code> method to ensure that the caller of the method has the +<code>permission.SET_WALLPAPERS</code> permission. </p> + +<pre> +@RequiresPermission(Manifest.permission.SET_WALLPAPER) +public abstract void setWallpaper(Bitmap bitmap) throws IOException; +</pre> + +<p>This example requires the caller of the +<code>updateVisitedHistory</code> method to have both read and write bookmark history permissions. </p> + +<pre> +@RequiresPermission(allOf = { + Manifest.permission.READ_HISTORY_BOOKMARKS, + Manifest.permission.WRITE_HISTORY_BOOKMARKS}) +public static final void updateVisitedHistory(ContentResolver cr, String url, boolean real) { + ... +} +</pre> + + +<h2 id="check-result">Adding CheckResults Annotations</h2> +<p>Use the <code>@CheckResults</code> annotation to +validate that a method's result or return value is actually used. The following example annotates +the <code>checkPermissions</code> method to ensure the return value of the method is actually +referenced. It also names the +<a href="{@docRoot}reference/android/content/ContextWrapper.html#enforcePermission">enforcePermission</a> +method as a method to be suggested to the developer as a replacement. </p> + + + +<pre> +@CheckResult(suggest="#enforcePermission(String,int,int,String)") +public abstract int checkPermission(@NonNull String permission, int pid, int uid); +</pre> + +{@link android.support.annotation.StringDef @StringDef} + + +<h2 id="call-super">Adding CallSuper Annotations</h2> +<p>Use the <code>@CallSuper</code> annotation to validate that an +overriding method calls the super implementation of the method. The following example annotates +the <code>onCreate</code> method to ensure that any overriding method implementations call +<code>super.onCreate()</code>. </p> + +<pre> +@CallSuper +protected void onCreate(Bundle savedInstanceState) { +} +</pre> + + + <h2 id="enum-annotations">Creating Enumerated Annotations</h2> <p>Use the {@link android.support.annotation.IntDef @IntDef} and {@link android.support.annotation.StringDef @StringDef} annotations diff --git a/docs/html/tools/debugging/debugging-memory.jd b/docs/html/tools/debugging/debugging-memory.jd index 5893ad1..fc4f4be 100644 --- a/docs/html/tools/debugging/debugging-memory.jd +++ b/docs/html/tools/debugging/debugging-memory.jd @@ -24,22 +24,22 @@ page.tags=memory,OutOfMemoryError <p>Because Android is designed for mobile devices, you should always be careful about how much -random-access memory (RAM) your application uses. Although Dalvik and ART perform -routine garbage collection (GC), this doesn’t mean you can ignore when and where your application allocates and +random-access memory (RAM) your app uses. Although Dalvik and ART perform +routine garbage collection (GC), this doesn’t mean you can ignore when and where your app allocates and releases memory. In order to provide a stable user experience that allows the system to quickly -switch between apps, it is important that your application does not needlessly consume memory when the user +switch between apps, it is important that your app does not needlessly consume memory when the user is not interacting with it.</p> <p>Even if you follow all the best practices for <a href="{@docRoot}training/articles/memory.html" >Managing Your App Memory</a> during development (which you should), you still might leak objects or introduce other memory bugs. The -only way to be certain your application is using as little memory as possible is to analyze your app’s +only way to be certain your app is using as little memory as possible is to analyze your app’s memory usage with tools. This guide shows you how to do that.</p> <h2 id="LogMessages">Interpreting Log Messages</h2> -<p>The simplest place to begin investigating your application’s memory usage is the runtime log messages. +<p>The simplest place to begin investigating your app’s memory usage is the runtime log messages. Sometimes when a GC occurs, a message is printed to <a href="{@docRoot}tools/help/logcat.html">logcat</a>. The logcat output is also available in the Device Monitor or directly in IDEs such as Eclipse and Android Studio.</p> @@ -68,8 +68,8 @@ include: <dd>A concurrent GC that frees up memory as your heap begins to fill up.</dd> <dt><code>GC_FOR_MALLOC</code></dt> -<dd>A GC caused because your application attempted to allocate memory when your heap was -already full, so the system had to stop your application and reclaim memory.</dd> +<dd>A GC caused because your app attempted to allocate memory when your heap was +already full, so the system had to stop your app and reclaim memory.</dd> <dt><code>GC_HPROF_DUMP_HEAP</code></dt> <dd>A GC that occurs when you request to create an HPROF file to analyze your heap.</dd> @@ -107,9 +107,9 @@ a memory leak.</p> <h3 id="ARTLogMessages">ART Log Messages</h3> -<p>Unlike Dalvik, ART doesn't log messqages for GCs that were not explicity requested. GCs are only +<p>Unlike Dalvik, ART doesn't log messqages for GCs that were not explicitly requested. GCs are only printed when they are they are deemed slow. More precisely, if the GC pause exceeds than 5ms or -the GC duration exceeds 100ms. If the application is not in a pause perceptible process state, +the GC duration exceeds 100ms. If the app is not in a pause perceptible process state, then none of its GCs are deemed slow. Explicit GCs are always logged.</p> <p>ART includes the following information in its garbage collection log messages:</p> @@ -131,15 +131,15 @@ What triggered the GC and what kind of collection it is. Reasons that may appear include: <dl> <dt><code>Concurrent</code></dt> -<dd>A concurrent GC which does not suspend application threads. This GC runs in a background thread +<dd>A concurrent GC which does not suspend app threads. This GC runs in a background thread and does not prevent allocations.</dd> <dt><code>Alloc</code></dt> -<dd>The GC was initiated because your application attempted to allocate memory when your heap +<dd>The GC was initiated because your app attempted to allocate memory when your heap was already full. In this case, the garbage collection occurred in the allocating thread.</dd> <dt><code>Explicit</code> -<dd>The garbage collection was explicitly requested by an application, for instance, by +<dd>The garbage collection was explicitly requested by an app, for instance, by calling {@link java.lang.System#gc()} or {@link java.lang.Runtime#gc()}. As with Dalvik, in ART it is recommended that you trust the GC and avoid requesting explicit GCs if possible. Explicit GCs are discouraged since they block the allocating thread and unnecessarily was CPU cycles. Explicit GCs @@ -153,13 +153,13 @@ RenderScript allocation objects.</dd> <dd>The collection was caused by a heap transition; this is caused by switching the GC at run time. Collector transitions consist of copying all the objects from a free-list backed space to a bump pointer space (or visa versa). Currently collector transitions only occur when an -application changes process states from a pause perceptible state to a non pause perceptible state +app changes process states from a pause perceptible state to a non pause perceptible state (or visa versa) on low RAM devices. </dd> <dt><code>HomogeneousSpaceCompact</code></dt> <dd>Homogeneous space compaction is free-list space to free-list space compaction which usually -occurs when an application is moved to a pause imperceptible process state. The main reasons for doing +occurs when an app is moved to a pause imperceptible process state. The main reasons for doing this are reducing RAM usage and defragmenting the heap. </dd> @@ -230,13 +230,39 @@ The moving GCs have a long pause which lasts for the majority of the GC duration {@code 25MB/38MB} value in the above example). If this value continues to increase and doesn't ever seem to get smaller, you could have a memory leak. Alternatively, if you are seeing GC which are for the reason "Alloc", then you are already operating near your heap capacity and can expect -OOM exceptios in the near future. </p> +OOM exceptions in the near future. </p> <h2 id="ViewHeap">Viewing Heap Updates</h2> -<p>To get a little information about what kind of memory your application is using and when, you can view -real-time updates to your app's heap in the Device Monitor:</p> +<p>To get a little information about what kind of memory your app is using and when, you +can view real-time updates to your app's heap in Android Studio's +<a href="{@docRoot}tools/studio/index.html#heap-dump">HPROF viewer</a> or in the Device Monitor:</p> +<h3>Memory Monitor in Android Studio</h3> +<p>Use Android Studio to view your app's memory use: </p> +<ul> + <li>Start your app on a connected device or emulator.</li> + <li>Open the Android run-time window, and view the free and allocated memory in the Memory + Monitor. </li> + <li>Click the Dump Java Heap icon + (<img src="{@docRoot}images/tools/studio-dump-heap-icon.png" style="vertical-align:bottom;margin:0;height:21px"/>) + in the Memory Monitor toolbar. + <p>Android Studio creates the heap snapshot file with the filename + <code>Snapshot-yyyy.mm.dd-hh.mm.ss.hprof</code> in the <em>Captures</em> tab. </p> + </li> + <li>Double-click the heap snapshot file to open the HPROF viewer. + <p class="note"><strong>Note:</strong> To convert a heap dump to standard HPROF format in + Android Studio, right-click a heap snapshot in the <em>Captures</em> view and select + <strong>Export to standard .hprof</strong>.</p> </li> + <li>Interact with your app and click the + (<img src="{@docRoot}images/tools/studio-garbage-collect.png" style="vertical-align:bottom;margin:0;height:17px"/>) + icon to cause heap allocation. + </li> + <li>Identify which actions in your app are likely causing too much allocation and determine where + in your app you should try to reduce allocations and release resources. +</ul> + +<h3>Device Monitor </h3> <ol> <li>Open the Device Monitor. <p>From your <code><sdk>/tools/</code> directory, launch the <code>monitor</code> tool.</p> @@ -254,8 +280,9 @@ GC. To see the first update, click the <strong>Cause GC</strong> button.</p> showing the <strong>[1] Update Heap</strong> and <strong>[2] Cause GC</strong> buttons. The Heap tab on the right shows the heap results.</p> -<p>Continue interacting with your application to watch your heap allocation update with each garbage -collection. This can help you identify which actions in your application are likely causing too much + +<p>Continue interacting with your app to watch your heap allocation update with each garbage +collection. This can help you identify which actions in your app are likely causing too much allocation and where you should try to reduce allocations and release resources.</p> @@ -266,14 +293,40 @@ resources.</p> <p>As you start narrowing down memory issues, you should also use the Allocation Tracker to get a better understanding of where your memory-hogging objects are allocated. The Allocation Tracker can be useful not only for looking at specific uses of memory, but also to analyze critical -code paths in an application such as scrolling.</p> +code paths in an app such as scrolling.</p> -<p>For example, tracking allocations when flinging a list in your application allows you to see all the +<p>For example, tracking allocations when flinging a list in your app allows you to see all the allocations that need to be done for that behavior, what thread they are on, and where they came from. This is extremely valuable for tightening up these paths to reduce the work they need and improve the overall smoothness of the UI.</p> -<p>To use Allocation Tracker:</p> +<p>To use the Allocation Tracker, open the Memory Monitor in Android Studio and click the +<a href="{@docRoot}tools/studio/index.html#alloc-tracker" style="vertical-align:bottom;margin:0;height:21px"> +Allocation Tracker</a> icon. You can also track allocations in the Android Device Monitor:</p> + + +<h3>Android Studio </h3> +<p>To use the <a href="{@docRoot}tools/studio/index.html#alloc-tracker">Allocation Tracker</a> in +Android Studio: </p> + +<ol> + <li>Start your app on a connected device or emulator</li> + <li>Open the Android run-tme window, and view the free and allocated memory in the Memory + Monitor. </li> + <li>Click the Allocation Tracker icon + (<img src="{@docRoot}images/tools/studio-allocation-tracker-icon.png" style="vertical-align:bottom;margin:0;height:21px"/>) in the Memory Monitor tool bar to start and stop memory + allocations. + <p>Android Studio creates the allocation file with the filename + <code>Allocations-yyyy.mm.dd-hh.mm.ss.alloc</code> in the <em>Captures</em> tab. </p> + </li> + <li>Double-click the allocation file to open the Allocation viewer. </li> + <li>Identify which actions in your app are likely causing too much allocation and determine where + in your app you should try to reduce allocations and release resources. +</ol> + + + +<h3>Device Monitor</h3> <ol> <li>Open the Device Monitor. <p>From your <code><sdk>/tools/</code> directory, launch the <code>monitor</code> tool.</p> @@ -281,7 +334,7 @@ improve the overall smoothness of the UI.</p> <li>In the DDMS window, select your app's process in the left-side panel.</li> <li>In the right-side panel, select the <strong>Allocation Tracker</strong> tab.</li> <li>Click <strong>Start Tracking</strong>.</li> -<li>Interact with your application to execute the code paths you want to analyze.</li> +<li>Interact with your app to execute the code paths you want to analyze.</li> <li>Click <strong>Get Allocations</strong> every time you want to update the list of allocations.</li> </ol> @@ -293,7 +346,7 @@ thread, in which class, in which file and at which line.</p> <img src="{@docRoot}images/tools/monitor-tracker@2x.png" width="760" alt="" /> <p class="img-caption"><strong>Figure 2.</strong> The Device Monitor tool, -showing recent application allocations and stack traces in the Allocation Tracker.</p> +showing recent app allocations and stack traces in the Allocation Tracker.</p> <p class="note"><strong>Note:</strong> You will always see some allocations from {@code @@ -458,7 +511,7 @@ with all the others.</p> </dd> <dt><code>.so mmap</code> and <code>.dex mmap</code></dt> -<dd>The RAM being used for mmapped <code>.so</code> (native) and <code>.dex</code> (Dalvik or ART) +<dd>The RAM being used for mapped <code>.so</code> (native) and <code>.dex</code> (Dalvik or ART) code. The <code>Pss Total</code> number includes platform code shared across apps; the <code>Private Clean</code> is your app’s own code. Generally, the actual mapped size will be much larger—the RAM here is only what currently needs to be in RAM for code that has been executed by @@ -544,7 +597,7 @@ window, so this can help you identify memory leaks involving dialogs or other wi </dd> <dt><code>AppContexts</code> and <code>Activities</code></dt> -<dd>The number of application {@link android.content.Context} and {@link android.app.Activity} objects that +<dd>The number of app {@link android.content.Context} and {@link android.app.Activity} objects that currently live in your process. This can be useful to quickly identify leaked {@link android.app.Activity} objects that can’t be garbage collected due to static references on them, which is common. These objects often have a lot of other allocations associated with them and so @@ -553,7 +606,7 @@ are a good way to track large memory leaks.</dd> <p class="note"><strong>Note:</strong> A {@link android.view.View} or {@link android.graphics.drawable.Drawable} object also holds a reference to the {@link android.app.Activity} that it's from, so holding a {@link android.view.View} or {@link -android.graphics.drawable.Drawable} object can also lead to your application leaking an {@link +android.graphics.drawable.Drawable} object can also lead to your app leaking an {@link android.app.Activity}.</p> </dd> @@ -573,7 +626,12 @@ android.app.Activity}.</p> HPROF. Your app's heap dump provides information about the overall state of your app's heap so you can track down problems you might have identified while viewing heap updates.</p> -<p>To retrieve your heap dump:</p> + +<p>To retrieve your heap dump from within Android Studio, use the +<a href="{@docRoot}tools/studio/index.html#me-cpu">Memory Monitor</a> and +<a href="{@docRoot}tools/studio/index.html#heap-dump">HPROF viewer</a>. + +<p>You can also still perform these procedures in the Android monitor:</p> <ol> <li>Open the Device Monitor. <p>From your <code><sdk>/tools/</code> directory, launch the <code>monitor</code> tool.</p> @@ -589,13 +647,13 @@ then click <strong>Save</strong>.</li> showing the <strong>[1] Dump HPROF file</strong> button.</p> <p>If you need to be more precise about when the dump is created, you can also create a heap dump -at the critical point in your application code by calling {@link android.os.Debug#dumpHprofData +at the critical point in your app code by calling {@link android.os.Debug#dumpHprofData dumpHprofData()}.</p> <p>The heap dump is provided in a format that's similar to, but not identical to one from the Java HPROF tool. The major difference in an Android heap dump is due to the fact that there are a large number of allocations in the Zygote process. But because the Zygote allocations are shared across -all application processes, they don’t matter very much to your own heap analysis.</p> +all app processes, they don’t matter very much to your own heap analysis.</p> <p>To analyze your heap dump, you can use a standard tool like jhat or the <a href= "http://www.eclipse.org/mat/downloads.php">Eclipse Memory Analyzer Tool</a> (MAT). However, first @@ -609,7 +667,7 @@ hprof-conv heap-original.hprof heap-converted.hprof </pre> <p class="note"><strong>Note:</strong> If you're using the version of DDMS that's integrated into -Eclipse, you do not need to perform the HPROF converstion—it performs the conversion by +Eclipse, you do not need to perform the HPROF conversation—it performs the conversion by default.</p> <p>You can now load the converted file in MAT or another heap analysis tool that understands @@ -660,7 +718,7 @@ showing what your largest objects are. Below this chart, are links to couple of <p class="note"><strong>Note:</strong> Most apps will show an instance of {@link android.content.res.Resources} near the top with a good chunk of heap, but this is - usually expected when your application uses lots of resources from your {@code res/} directory.</p> + usually expected when your app uses lots of resources from your {@code res/} directory.</p> </li> </ul> @@ -699,19 +757,19 @@ to inspect the changes in memory allocation. To compare two heap dumps using MAT <h2 id="TriggerLeaks">Triggering Memory Leaks</h2> -<p>While using the tools described above, you should aggressively stress your application code and try -forcing memory leaks. One way to provoke memory leaks in your application is to let it +<p>While using the tools described above, you should aggressively stress your app code and try +forcing memory leaks. One way to provoke memory leaks in your app is to let it run for a while before inspecting the heap. Leaks will trickle up to the top of the allocations in -the heap. However, the smaller the leak, the longer you need to run the application in order to see it.</p> +the heap. However, the smaller the leak, the longer you need to run the app in order to see it.</p> <p>You can also trigger a memory leak in one of the following ways:</p> <ol> <li>Rotate the device from portrait to landscape and back again multiple times while in different -activity states. Rotating the device can often cause an application to leak an {@link android.app.Activity}, +activity states. Rotating the device can often cause an app to leak an {@link android.app.Activity}, {@link android.content.Context}, or {@link android.view.View} object because the system -recreates the {@link android.app.Activity} and if your application holds a reference +recreates the {@link android.app.Activity} and if your app holds a reference to one of those objects somewhere else, the system can't garbage collect it.</li> -<li>Switch between your application and another application while in different activity states (navigate to +<li>Switch between your app and another app while in different activity states (navigate to the Home screen, then return to your app).</li> </ol> diff --git a/docs/html/tools/help/hprof-conv.jd b/docs/html/tools/help/hprof-conv.jd index 982f337..89d6a68 100644 --- a/docs/html/tools/help/hprof-conv.jd +++ b/docs/html/tools/help/hprof-conv.jd @@ -18,3 +18,9 @@ to specify stdin or stdout. <p> You can use "-z" to filter out zygote allocations shared by all applications. </p> + +<p class="note"><strong>Note:</strong> Android Studio provides integrated access to this conversion +process. To convert a heap dump to standard HPROF format in Android Studio, right-click a heap +snapshot in the <em>Captures</em> view and select <strong>Export to standard .hprof</strong>. </p> + + diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd index 0c77395..cc95edf 100644 --- a/docs/html/tools/help/sdk-manager.jd +++ b/docs/html/tools/help/sdk-manager.jd @@ -2,30 +2,59 @@ page.title=SDK Manager @jd:body -<p>The Android SDK separates tools, platforms, and other components into packages you can - download using the SDK Manager. For example, when the SDK Tools are updated or a new version of -the Android platform is released, you can use the SDK Manager to quickly download them to -your environment.</p> +<p>The Android SDK Manager separates the SDK tools, platforms, and other components into packages +for easy access and management. You can also customize which sites the SDK Manager checks for new +or updated SDK packages and add-on tools. For example, you can configure the SDK Manager +to automatically check for updates and notify you when an installed SDK Tools package is updated. +When you receive such a notification, you can then quickly decide whether to download the changes. </p> + +<p>By default, Android Studio does not check for Android SDK updates. To enable automatic Android +SDK checking: </p> +<ol> + <li>Choose <strong>File</strong> > <strong>Settings</strong> + > <strong>Appearance & Behavior</strong> > <strong>System Settings</strong> + > <strong>Updates</strong>. </li> + <li>Check the <strong>Automatically check updates for Android SDK</strong> checkbox and select an + <ahref="{@docRoot}tools/studio/studio-config.html#update-channel">update channel</a>.</li> + + + <li>Click <strong>OK</strong> or <strong>Apply</strong> to enable the update checking. </li> +</ol> <p>You can launch the SDK Manager in one of the following ways:</p> <ul> - <li>From Eclipse (with <a href="{@docRoot}tools/help/adt.html">ADT</a>), - select <strong>Window</strong> > <strong>Android SDK Manager</strong>.</li> - <li>From Android Studio, select <strong>Tools</strong> > <strong>Android</strong> - > <strong>SDK Manager</strong>.</li> - <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android -SDK directory.</li> - <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the -location where the Android SDK is installed, then execute <code>android sdk</code>.</li> + <li>From the Android Studio <strong>File</strong> menu: <strong>File</strong> > + <strong>Settings</strong> > <strong>Appearance & Behavior</strong> > + <strong>System Settings</strong> > <strong>Android SDK</strong>.</li> + <li>From the Android Studio <strong>Tools</strong> menu: <strong>Tools</strong> > + <strong>Android</strong> > <strong>SDK Manager</strong>.</li> + <li>From the SDK Manager icon + (<img src="{@docRoot}images/tools/sdk-manager-studio.png" style="vertical-align:sub;margin:0;height:17px" alt="" />) + in the menu bar. </li> </ul> -<p>You can select which packages you want to download by toggling the checkboxes on the left, then -click <strong>Install</strong> to install the selected packages.</p> +<p class="note"><strong>Tip:</strong> The standalone SDK Manager is still available from the +command line, but we recommend it only for use with Eclipse ADT and standalone SDK installations.</p> -<img src="{@docRoot}images/sdk_manager_packages.png" alt="" /> -<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager shows the -SDK packages that are available, already installed, or for which an update is available.</p> +<p>By default, the SDK Manager installs the latest packages and tools. Click the checkbox next to +each additional SDK platform and tool that you want to install. Clear the +checkbox to uninstall a SDK platform or tool. Click <strong>Apply</strong> or <strong>OK</strong> +to update the packages and tools. </p> +<p class="note"><strong>Tip:</strong> When an update is available for an installed +package, a hyphen (-) appears in the checkbox next to the package. A download icon +(<img src="{@docRoot}images/tools/studio-sdk-dwnld-icon.png" style="vertical-align:sub;margin:0;height:17px" alt="" />) +also appears next +to the checkbox to indicate the pending update. An update icon +(<img src="{@docRoot}images/tools/studio-sdk-removal-icon.png" style="vertical-align:sub;margin:0;height:17px" alt="" />) appears next to the checkbox to +indicate pending removals.</p> + +<p>Click the <em>SDK Update Sites</em> tab to manage which SDK sites Android Studio checks for +tool and add-on updates. </p> + +<img src="{@docRoot}images/tools/studio-sdk-manager-packages.png" alt="" /> +<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager shows the +SDK platforms and packages that are available and installed along with the SDK update sites.</p> <p>There are several different packages available for the Android SDK. The table below describes most of the available packages and where they're located in your SDK directory @@ -33,8 +62,6 @@ once you download them.</p> - - <h2 id="Recommended">Recommended Packages</h2> <p>Here's an outline of the packages required and those we recommend you use: @@ -42,25 +69,32 @@ once you download them.</p> <dl> <dt>SDK Tools</dt> - <dd><strong>Required.</strong> Your new SDK installation already has the latest version. Make sure -you keep this up to date.</dd> + <dd><strong>Required.</strong> Your new SDK installation installs the latest version. Be sure + to respond to the Android Studio update prompts to keep your SDK Tools up-to-date.</dd> <dt>SDK Platform-tools</dt> - <dd><strong>Required.</strong> You must install this package when you install the SDK for -the first time.</dd> + <dd><strong>Required.</strong> Your new SDK installation installs the latest stable version. + Be sure to respond to the Android Studio update prompts to keep your SDK Platform-tools + up-to-date.</dd> <dt>SDK Platform</dt> - <dd><strong>Required.</strong>You must download <em>at least one platform</em> into your + <dd><strong>Required.</strong><em> At least one platform</em> is required in your environment so you're able to compile your application. In order to provide the best user experience on the latest devices, we recommend that you use the latest platform version as your build target. You'll still be able to run your app on older versions, but you must build against the latest version in order to use new features when running on devices with the latest version of Android. - <p>To get started, download the latest Android version, plus the lowest version you plan - to support (we recommend Android 2.2 for your lowest version).</p></dd> + <p>The SDK Manager downloads the latest Android version. It also downloads the earliest version + of Android (Android 2.2 (API level 8)) that we recommend that your app support. </p></dd> <dt>System Image</dt> <dd>Recommended. Although you might have one or more Android-powered devices on which to test your app, it's unlikely you have a device for every version of Android your app supports. It's a good practice to download system images for all versions of Android your app supports and test -your app running on them with the <a href="{@docRoot}tools/devices/emulator.html">Android emulator</a>.</dd> - <dt>Android Support</dt> +your app running on them with the +<a href="{@docRoot}tools/devices/emulator.html">Android emulator</a>. Each SDK platform package +contains the supported system images. Click <strong>Show Package Details</strong> to display the available +system images for each available platform. You can also download system images when creating +Android Virtual Devices (AVDs) in the +<a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a>. </dd> + + <dt>Android Support Library</dt> <dd>Recommended. Includes a static library that allows you to use some of the latest Android APIs (such as <a href="{@docRoot}guide/components/fragments.html">fragments</a>, plus others not included in the framework at all) on devices running @@ -68,13 +102,16 @@ a platform version as old as Android 1.6. All of the activity templates availabl a new project with the <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> require this. For more information, read <a href="{@docRoot}tools/support-library/index.html">Support Library</a>.</dd> - <dt>SDK Samples</dt> - <dd>Recommended. The samples give you source code that you can use to learn about -Android, load as a project and run, or reuse in your own app. Note that multiple -samples packages are available — one for each Android platform version. When -you are choosing a samples package to download, select the one whose API Level -matches the API Level of the Android platform that you plan to use.</dd> -</dl> + + <dt>Android Support Repository</dt> + <dd>Recommended. Includes local Maven repository for Support libraries.</dd> + + <dt>Google Play services</dt> + <dd>Recommended. Includes Google Play services client library and sample code.</dd> + + <dt>Google Repository</dt> + <dd>Recommended. Includes local Maven repository for Google libraries.</dd> + <p class="note"><strong>Tip:</strong> For easy access to the SDK tools from a command line, add the location of the SDK's <code>tools/</code> and @@ -82,74 +119,40 @@ location of the SDK's <code>tools/</code> and <p>The above list is not comprehensive and you can <a -href="#AddingSites">add new sites</a> to download additional packages from third-parties.</p> +href="#AddingSites">add new sites</a> to download additional packages from third parties.</p> <p>In some cases, an SDK package may require a specific minimum revision of another package or SDK tool. The development tools will notify you with warnings if there is dependency that you need to -address. The Android SDK Manager also enforces dependencies by requiring that you download any +address. The Android SDK Manager also enforces dependencies by requiring any packages that are needed by those you have selected.</p> - - <h2 id="AddingSites">Adding New Sites</h2> -<p>By default, <strong>Available Packages</strong> displays packages available from the -<em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host -their own Android SDK add-ons, then download the SDK add-ons -from those sites.</p> +<p>The <em>SDK Update Sites</em> tab displays the sites that Android Studio checks for Android SDK +and third-party updates. You can add other sites that host their own Android SDK add-ons, then +download the SDK add-ons from those sites.</p> <p>For example, a mobile carrier or device manufacturer might offer additional API libraries that are supported by their own Android-powered devices. In order to develop using their libraries, you must install their Android SDK add-on, if it's not already -available under <em>Third party Add-ons</em>. </p> +available as a <em>third-party add-on</em>. </p> <p>If a carrier or device manufacturer has hosted an SDK add-on repository file -on their web site, follow these steps to add their site to the Android SDK -Manager:</p> +on their website, follow these steps to add their site to the Android SDK Manager:</p> <ol> - <li>Select <strong>Available Packages</strong> in the left panel.</li> - <li>Click <strong>Add Add-on Site</strong> and enter the URL of the -<code>repository.xml</code> file. Click <strong>OK</strong>.</li> + <li>Click the <strong>SDK Update Sites</strong> tab.</li> + <li>Click the <strong>Add</strong> icon in the tools area and enter the name and URL of the + <code>add-on</code> site.</li> + <li>Click <strong>OK</strong>.</li> + <li>Make sure the checkbox is checked in the <em>Enabled</em> column.</li> + <li>Click <strong>OK</strong> or <strong>Apply</strong>.</li> </ol> -<p>Any SDK packages available from the site will now be listed under a new item named -<strong>User Add-ons</strong>.</p> - - - - -<h2 id="troubleshooting">Troubleshooting</h2> - -<p><strong>Problems connecting to the SDK repository</strong></p> - -<p>If you are using the Android SDK Manager to download packages and are encountering -connection problems, try connecting over http, rather than https. To switch the -protocol used by the Android SDK Manager, follow these steps: </p> - -<ol> - <li>With the Android SDK Manager window open, select "Settings" in the - left pane. </li> - <li>On the right, in the "Misc" section, check the checkbox labeled "Force - https://... sources to be fetched using http://..." </li> - <li>Click <strong>Save & Apply</strong>.</li> -</ol> - - - - - - - - - - - - - - +<p>Any SDK packages available from the site appear in the <em>SDK Platforms</em> or +<em>SDK Tools</em> tabs.</p> diff --git a/docs/html/tools/performance/allocation-tracker/index.jd b/docs/html/tools/performance/allocation-tracker/index.jd index e71b584..d68f601 100644 --- a/docs/html/tools/performance/allocation-tracker/index.jd +++ b/docs/html/tools/performance/allocation-tracker/index.jd @@ -90,19 +90,24 @@ page.article=true alt="" width="400px" /> <p class="img-caption"> - <strong>Figure 1. </strong>Steps for starting Allocation Tracker. + <strong>Figure 1. </strong>Steps for starting Allocation Tracker in Android DDMS. </p> </div> <li>Connect your mobile device to your computer.</li> - <li>Open your application in Android Studio, build the source, and run it on your device.</li> + <li>Open your application in Android Studio, build the source, and run it on your device or + emulator.</li> <li>Click the <b>Android</b> button at the bottom of your Android Studio window.</li> - <li>Click the RECORD button + <li>If you are using the Android Device Monitor, click the RECORD button <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image02.png"> - (Start Allocation Tracking tooltip).</li> + (Start Allocation Tracking tooltip) in the Android DDMS tool bar. If you are using Android + Studio, click the + <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image02.png"> + icon in the <a href="{@docRoot}tools/studio/index.html#mem-cpu">Memory Monitor</a> tool + bar. </li> <li>Interact with your application.</li> @@ -119,7 +124,7 @@ page.article=true alt="" width="440px" /> <p class="img-caption"> - <strong>Figure 2. </strong>Example of Allocation Tracker output. + <strong>Figure 2. </strong>Example of Allocation Tracker output in Android DDMS. </p> </div> diff --git a/docs/html/tools/performance/comparison.jd b/docs/html/tools/performance/comparison.jd index cf4b712..f79e762 100644 --- a/docs/html/tools/performance/comparison.jd +++ b/docs/html/tools/performance/comparison.jd @@ -86,7 +86,7 @@ page.article=true <h2 id="HeapViewer">Heap Viewer</h2> <div class="figure" style=""> - <img src="{@docRoot}images/tools/performance/compare_HeapViewer.png" + <img src="{@docRoot}images/tools/studio-hprof-viewer.png" alt="" height="" /> <p class="img-caption"> @@ -94,6 +94,7 @@ page.article=true </p> </div> + <ul> <li>Shows snapshots of a number of objects allocated by type.</li> @@ -110,7 +111,7 @@ page.article=true <h2 id="AllocationTracker">Allocation Tracker</h2> <div class="figure" style=""> - <img src="{@docRoot}images/tools/performance/compare_AllocationTracker.png" + <img src="{@docRoot}images/tools/studio-allocation-tracker.png" alt=""ge height="" /> <p class="img-caption"> diff --git a/docs/html/tools/performance/heap-viewer/index.jd b/docs/html/tools/performance/heap-viewer/index.jd index 9ca0c47..bfcbe1f 100644 --- a/docs/html/tools/performance/heap-viewer/index.jd +++ b/docs/html/tools/performance/heap-viewer/index.jd @@ -75,18 +75,23 @@ page.article=true alt="" width="400px" /> <p class="img-caption"> - <strong>Figure 1. </strong>Starting Android Device Monitor. + <strong>Figure 1. </strong>Starting Memory Monitor. </p> </div> <li>Connect your mobile device to your computer.</li> - <li>Open your application in Android Studio, build the source, and run it on your device.</li> + <li>Open your application in Android Studio, build the source, and run it on your device or + emulator.</li> - <li>Start the Android Device Monitor from Android Studio: <b>Tools -> Android -> Android - Device</b> <b>Monitor</b>. + <li>Start the Android Device Monitor from Android Studio: <strong>Tools -> Android + -> Android Device Monitor</strong>. -</ol> + <p>You can also start the <a href="{@docRoot}tools/studio/index.html#mem-cpu">Memory Monitor</a> + in Android Studio: Click the <em>Android</em> tab in the lower-left corner of the application + window. The CPU and Memory Monitor views appear.</p> </li> + + </ol> </div></li> <li><div style="overflow:hidden"> @@ -102,13 +107,7 @@ page.article=true </p> </div> - <li>Make sure your device and application are showing in the <b>Devices</b> tab.</li> - - <li>Click the <b>DDMS</b> button, because the Heap Viewer is one of the DDMS tools.</li> - - <li>Click the <b>Heap</b> tab, which is where your data will appear.</li> - - <li>In the <b>Devices</b> tab, select the app you want to monitor.</li> + <li>In the device and application drop-downs, select the app you want to monitor.</li> </ol> </div></li> @@ -126,7 +125,9 @@ page.article=true </p> </div> - <li>To start monitoring, click the Update Heap button, which looks like a green can.</li> + <li>To save a heap dump, click the Dump Java Heap icon. The heap snapshot file + with the filename <code>Snapshot-yyyy.mm.dd-hh.mm.ss.hprof</code> appears in the + <em>Captures</em> tab.</li> </ol> </div></li> @@ -147,7 +148,7 @@ page.article=true <li>Note the <em>Heap updates will happen after every GC for this client.</em> message.</li> - <li>Press the <strong>Cause CG</strong> button to + <li>Click the <strong>Initiate CG</strong> icon to trigger a garbage collection event. </li> </ol> @@ -166,12 +167,10 @@ page.article=true </p> </div> - <li>Click a data type to see detailed information on its current allocations on the - heap.</li> + <li>Double-click the heap snapshot file to open the heap viewer and see detailed information + about the current allocations on the heap.</li> </ol> </div></li> - <p class="note"><b>Note:</b> To visualize allocation changes over time, combine - several snapshots of the bar graph into an animated gif or video.</p> </ul> diff --git a/docs/html/tools/performance/memory-monitor/index.jd b/docs/html/tools/performance/memory-monitor/index.jd index 756ca14..a083a14 100644 --- a/docs/html/tools/performance/memory-monitor/index.jd +++ b/docs/html/tools/performance/memory-monitor/index.jd @@ -82,37 +82,18 @@ page.article=true </p> </div> - <li>Connect your mobile device to your computer.</li> + <li>If you're using a mobile device, connect it to your computer.</li> <li>Open your application in Android Studio, build the source, - and run it on your device.</li></li> - - <li>In Android Studio, choose <b>Tools > Android > Memory Monitor.</b></li> + and run it on your device or emulator.</li> + <li>In Android Studio, choose <strong> Tools > Android > Memory Monitor</strong>. You + can also click the <em>Android</em> tab in the lower-left corner of the application + window to launch the Android runtime window. The CPU and Memory Monitor views appear.</li> + </ol> </div></li> -<li><div style="overflow:hidden"> -<hr> - <ol class="padded" start="4"> - - <div class="figure" style=""> - <img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image002.png" - alt="" - width="400px" /> - <p class="img-caption"> - <strong>Figure 2. </strong>Choosing the device and Activity to monitor. - </p> - </div> - - <li>This opens the Memory Monitor pane.</li> - - <li>Choose your device from the drop-down menu at the top left of the pane.</li> - - <li>Choose your Activity from the drop-down menu at the top right of the pane.</li> - - </ol> -</div></li> <li><div style="overflow:hidden"> <hr> @@ -123,7 +104,7 @@ page.article=true alt="" width="400px" /> <p class="img-caption"> - <strong>Figure 3. </strong>Allocated and free memory in Memory Monitor. + <strong>Figure 1. </strong>Allocated and free memory in Memory Monitor. </p> </div> @@ -156,7 +137,7 @@ page.article=true alt="" width="400px" /> <p class="img-caption"> - <strong>Figure 4. </strong>Forcing a GC (Garbage Collection) event. + <strong>Figure 2. </strong>Forcing a GC (Garbage Collection) event. </p> </div> diff --git a/docs/html/tools/revisions/gradle-plugin.jd b/docs/html/tools/revisions/gradle-plugin.jd index 90ec44a..17e6d79 100644 --- a/docs/html/tools/revisions/gradle-plugin.jd +++ b/docs/html/tools/revisions/gradle-plugin.jd @@ -40,6 +40,106 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>Android Plugin for Gradle, Revision 1.3.0</a> <em>(July 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Gradle 2.2.1 or higher.</li> + <li>Build Tools 21.1.1 or higher.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Added support for the <code>com.android.build.threadPoolSize</code> property to control + the <code>Android</code> task thread pool size from the <code>gradle.properties</code> file + or the command line. The following example sets this property to 4. +<pre> +-Pcom.android.build.threadPoolSize=4 +</pre> + </li> + <li>Set the default build behavior to exclude <code>LICENSE</code> and <code>LICENSE.txt</code> + files from APKs. To include these files in an APK, remove these files from the + <code>packagingOptions.excludes</code> property in the <code>build.gradle</code> file. + For example: +<pre> +android { + packagingOptions.excludes = [] + } +</pre> + </li> + <li>Added the <code>sourceSets</code> task to inspect the set of all available source sets. </li> + <li>Enhanced unit test support to recognize multi-flavor and + <a href="{@docRoot}tools/building/configuring-gradle.html#workBuildVariants"> + build variant</a> source folders. For example, to test an app with multi-flavors + <code>flavor1</code> and <code>flavorA</code> with the <code>Debug</code> build type, + the test source sets are: + <ul> + <li>test </li> + <li>testFlavor1 </li> + <li>testFlavorA </li> + <li>testFlavor1FlavorA </li> + <li>testFlavor1FlavorADebug </li> + </ul> + <p>Android tests already recognized multi-flavor source folders. </p> </li> + <li>Improved unit test support to:</p> + <ul> + <li>Run <code>javac</code> on main and test sources, even if the <code>useJack</code> + property is set to <code>true</code> in your build file. </li> + <li>Correctly recognize dependencies for each build type. </li> + </ul> + </li> + <li>Added support for specifying instrumentation test-runner arguments from the command line. + For example: +<pre> +./gradlew connectedCheck \ + -Pandroid.testInstrumentationRunnerArguments.size=medium \ + -Pandroid.testInstrumentationRunnerArguments.class=TestA,TestB +</pre> + </li> + <li>Added support for arbitrary additional Android Asset Packaging Tool (AAPT) parameters + in the <code>build.gradle</code> file. For example: +<pre> +android { + aaptOptions { + additionalParameters "--custom_option", "value" + } +} +</pre> + </li> + + <li>Added support for a <a href="{@docRoot}tools/studio/studio-features.html#test-module"> + test APK module</a> as a separate test module, using the + <code>targetProjectPath</code> and <code>targetVariant</code> properties to set the APK + path and target variant. + <p class="note"><strong>Note:</strong> A test APK module does not support product + flavors and can only target a single variant. Also, Jacoco is not supported yet.</p> + </li> + <li>Added resource name validation before merging resources. </li> + <li>When building an AAR (Android ARchive) package for library modules, do not provide an + automatic <code>@{applicationId}</code> placeholder in the + <a href="{@docRoot}tools/building/manifest-merge.html">manifest merger</a> settings. + Instead, use a different placeholder, such as <code>@{libApplicationId}</code> and + provide a value for it if you want to include application Ids in the archive library. </li> + + </ul> + </dd> + </div> +</div> + + + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""/>Android Plugin for Gradle, Revision 1.2.0</a> <em>(April 2015)</em> </p> diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd index b727d96..c922b28 100644 --- a/docs/html/tools/revisions/studio.jd +++ b/docs/html/tools/revisions/studio.jd @@ -30,7 +30,7 @@ everything you need to begin developing Android apps:</p> <a href="{@docRoot}tools/studio/index.html">Android Studio</a> guide.</p> <p>Periodic updates are pushed to Android Studio without requiring you to update your Android -project. To manually check for updates, select <strong>Help > Check for updates</strong> (on Mac, +project. To manually check for updates, select <strong>Help > Check for update</strong> (on Mac, select <strong>Android Studio > Check for updates</strong>).</p> @@ -43,6 +43,85 @@ Android Studio, as denoted by revision number. </p> <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>Android Studio v1.3.1</a> <em>(August 2015)</em> + </p> + <div class="toggle-content-toggleme"> + <p>Fixes and enhancements:</p> + <ul> + <li>Fixed support for creating an Android Wear Android Virtual Device (AVD) on Windows. </li> + <li>Updated the <em>Project Wizard</em> to use the entered project name. </li> + <li>Added support to allow the Android SDK to be stored in a read-only directory. </li> + <li>Updated Android Plugin for Gradle version to 1.3.0. </li> + <li>Fixed issues with launching a debug session from the Android Debug Bridge (adb) Unix + shell. </li> + <li>Fixed the Java package renaming message to show the correct package name. </li> + </ul> + </div> +</div> + + + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v1.3.0</a> <em>(July 2015)</em> + </p> + <div class="toggle-content-toggleme"> + <p>Fixes and enhancements:</p> + <ul> + <li>Added options to enable + <a href="{@docRoot}tools/studio/studio-features.html#dev-services">developer services</a>, + such as <a href="https://developers.google.com/admob/">AdMob</a> and + <a href="{@docRoot}distribute/analyze/start.html">Analytics</a>, in your app from within + Android Studio. </li> + <li>Added additional <a href="{@docRoot}tools/debugging/annotations.html">annotations</a>, + such as <code>@RequiresPermission</code>, <code>@CheckResults</code>, and + <code>@MainThread</code>. </li> + <li>Added the capability to generate Java heap dumps and analyze thread allocations from the + <a href="{@docRoot}tools/studio/index.html#mem-cpu">Memory Monitor</a>. You can also + convert Android-specific HPROF binary format files to standard HPROF format from within + Android Studio. </li> + <li>Integrated the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> + into Android Studio to simplify package and tools access and provide update notifications. + <p class="note"><strong>Note:</strong> The standalone SDK Manager is still available from + the command line, but is recommended for use with only Eclipse ADT and standalone SDK + installations. </p> </li> + <li>Added the <code>finger</code> command in the emulator console to simulate + <a href="{@docRoot}tools/studio/studio-features.html#finger-print">fingerprint</a> + authentication. </li> + <li>Added a <code><public></code> resource declaration to designate library + resources as + <a href="{@docRoot}tools/studio/studio-features.html#private-res">public and private</a> + resources. + <p class="note"><strong>Note:</strong> Requires + <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin for Gradle</a> + version 1.3 or higher. </p> </li> + <li>Added <a href="{@docRoot}tools/data-binding/guide.html">data binding</a> support to + create declarative layouts that bind your application logic to layout elements. </li> + <li>Added support for a separate + <a href="{@docRoot}tools/studio/studio-features.html#test-module">test APK module</a> + to build test APKs in Android Studio. </li> + <li>Updated the <a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a> with HAXM + optimizations and improved notifications. </li> + <li>Added 64-bit ARM and MIPS emulator support for + <a class="external-link" href="http://wiki.qemu.org/Main_Page">QEMU</a> 2.1. </li> + <li>Simplified the resolution of <a href="{@docRoot}tools/help/lint.html">lint</a> warnings + by adding quick fixes, such as the automatic generation of + <a href="{@docRoot}reference/android/os/Parcelable.html">Parcelable</a> + implementation.</li> + <li>Added <a href="{@docRoot}sdk/installing/studio-tips.html#live-templates">live template</a> + support for quick insertion of code snippets. </li> + </ul> + </div> +</div> + + + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""/>Android Studio v1.2.2</a> <em>(June 2015)</em> </p> <div class="toggle-content-toggleme"> diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd index 5041b83..43cb2fe 100644 --- a/docs/html/tools/studio/index.jd +++ b/docs/html/tools/studio/index.jd @@ -50,7 +50,7 @@ Studio features.</p> <p>For specific Android Studio how-to documentation, see the pages in the <a href= "{@docRoot}tools/workflow/index.html">Workflow</a> section, such as <a href= -"{@docRoot}tools/projects/projects-studio.html">Managing Projects from Android Studio</a> and +"{@docRoot}sdk/installing/create-project.html">Managing Projects from Android Studio</a> and <a href="{@docRoot}tools/building/building-studio.html">Building and Running from Android Studio</a>. For a summary of the latest changes to Android Studio, see the <a href="{@docRoot}tools/revisions/studio.html">Android Studio Release Notes</a>.</p> @@ -206,6 +206,49 @@ runtime window to launch the Android runtime window. Click the <strong>Memory</s <img src="{@docRoot}images/tools/studio-memory-monitor.png" srcset="{@docRoot}images/tools/studio-memory-monitor_2x.png 2x" width"635" height="171" alt="" /> <p class="img-caption"><strong>Figure 4.</strong> Monitor memory and CPU usage.</p> +<h4 id="heap-dump">Heap dump </h4> +<p>When you're monitoring memory usage in Android Studio you can, at the same time, initiate +garbage collection and dump the Java heap to a heap snapshot in an Android-specific HPROF binary +format file. The HPROF viewer displays classes, instances of each class, and a reference tree to +help you track memory usage and find memory leaks. </p> + +<img src="{@docRoot}images/tools/studio-hprof-viewer.png" alt="" /> + <p class="img-caption"><strong>Figure 5.</strong> HPROF viewer with heap dump.</p> + +<p>To create a snapshot of the Android app heap memory, click the +Dump Java Heap icon (<img src="{@docRoot}images/tools/studio-dump-heap-icon.png" style="vertical-align:bottom;margin:0;height:17px"/>) +in the Memory Monitor. Android Studio creates the heap snapshot file with the filename +<code>Snapshot-yyyy.mm.dd-hh.mm.ss.hprof</code> +in the <em>Captures</em> tab. Double-click the heap snapshot file to open the HPROF viewer.</p> + +<p>To convert a heap dump to standard HPROF format in Android Studio, right-click a heap +snapshot in the <em>Captures</em> view and select <strong>Export to standard .hprof</strong>. </p> + + + +<h4 id="alloc-tracker">Allocation tracker </h4> +<p>Android Studio allows you to track memory allocation as it monitors memory use. Tracking memory +allocation allows you to monitor where objects are being allocated when you perform certain actions. +Knowing these allocations enables you to adjust the method +calls related to those actions to optimize your app's performance and memory use. </p> + +<img src="{@docRoot}images/tools/studio-allocation-tracker.png" alt="" /> + <p class="img-caption"><strong>Figure 6.</strong> Allocation tracker.</p> + +<p>Perform the following steps to track and analyze allocations: </p> +<ol> + <li>Click the Start/Stop Allocation Tracking icon + (<img src="{@docRoot}images/tools/studio-allocation-tracker-icon.png" style="vertical-align:bottom;margin:0;height:17px"/>) in the + <a href="#mem-cpu">Memory Monitor</a>. Android Studio starts tracking memory allocations.</li> + <li>Perform the tasks whose mallocs you want to track. </li> + <li>Click the Start/Stop Allocation Tracking icon again. Android Studio stops tracking mallocs + and saves the data to a file named <code>Allocation-yyyy.mm.dd-hh.mm.ss.alloc</code>. The + resulting file appears in the <em>Captures</em> tab. </li> + <li>Double-click the file to open it in the allocation viewer. + <p>The allocation viewer allows you to view and analyze the allocations your app made while + running. </p> </li> +</ol> + <h3>Data file access</h3> <p>The Android SDK tools, such as <a href="{@docRoot}tools/help/systrace.html">Systrace</a>, diff --git a/docs/html/tools/studio/studio-config.jd b/docs/html/tools/studio/studio-config.jd index f9646b8..88835d0 100644 --- a/docs/html/tools/studio/studio-config.jd +++ b/docs/html/tools/studio/studio-config.jd @@ -8,6 +8,7 @@ page.tags=studio, configuration <h2>In this document</h2> <ol> + <li><a href="#sdk-mgr">SDK Manager</a></li> <li><a href="#update-channel">Update Channels</a></li> <li><a href="#proxy">Proxy Settings</a></li> </ol> @@ -23,7 +24,7 @@ page.tags=studio, configuration </div> -<p>During installation, Android Studio provides wizards and templates that verify your system +<p>Android Studio provides wizards and templates that verify your system requirements, such as the Java Development Kit (JDK) and available RAM, and configure default settings, such as an optimized default Android Virtual Device (AVD) emulation and updated system images. This document describes additional configuration settings you may want to use to @@ -35,6 +36,20 @@ customize your use of Android Studio. </p> <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB Drivers</a>. </p> +<h2 id="sdk-mgr">SDK Manager</h2> +<p>After the initial Android Studio installation and setup, use the +<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> to verify and update the tools, +platforms, packages, and other components used by your apps. You can also use the +<strong>File</strong> > <strong>Settings</strong> > +<strong>Appearance & Behavior</strong> > <strong>System Settings</strong> > +<strong>Updates</strong> to configure the SDK Manager to automatically prompt whenever updates are +available. </p> + +<p class="note"><strong>Note:</strong> You can also customize the <code>build.gradle</code> file +so each app uses a specific build chain and compilation options. For more information see, +<a href="{@docRoot}tools/building/configuring-gradle.html">Configuring Gradle Builds</a>. </p> + + <h2 id="update-channel">Update channels</h2> <p>Android Studio provides four update channels to keep Android Studio up-to-date based on your diff --git a/docs/html/tools/studio/studio-features.jd b/docs/html/tools/studio/studio-features.jd index 76eba10..44d6985 100644 --- a/docs/html/tools/studio/studio-features.jd +++ b/docs/html/tools/studio/studio-features.jd @@ -12,7 +12,11 @@ page.tags=studio, features <li><a href="#git-samples">Android Code Samples on GitHub</a></li> <li><a href="#template-support">Expanded Template and Form Factor Support</a></li> <li><a href="#project-settings">Android Studio and Project Settings</a></li> + <li><a href="#finger-print">Fingerprint Support</a></li> + <li><a href="#dev-services">Developer Services</a></li> + <li><a href="#private-res">Public and Private Resources</a></li> <li><a href="#support-apis">Editor Support for the Latest Android APIs</a></li> + <li><a href="#test-module">Test APK Module</a></li> </ol> <h2>See also</h2> @@ -40,7 +44,8 @@ and <h2 id="trans-editor">Translations Editor</h2> <p>Multi-language support is enhanced with the Translations Editor plugin so you can easily add a variety of locales to the app's translation file. With -<a href="https://tools.ietf.org/html/bcp47">BCP 47</a> support, the editor combines language and +<a class="external-link" href="https://tools.ietf.org/html/bcp47">BCP 47</a> support, the editor +combines language and region codes into a single selection for targeted localizations. Color codes indicate whether a locale is complete or still missing string translations. </p> @@ -112,6 +117,114 @@ behavior, such a UI themes, system settings, and version control. </p> +<h2 id="finger-print">Fingerprint Support</h2> +<p>Android Studio provides the {@code finger} command, allowing you to simulate, and thus validate, +fingerprint authentication for your app. After you set up your app to accept +<a href="https://developer.android.com/preview/api-overview.html#authentication">fingerprint +authentication</a>, your emulator or device should display the fingerprint authentication screen, +as shown below. </p> + + <p><img src="{@docRoot}images/tools/studio-fingerprint.png" /></p> + <p class="img-caption"><strong>Figure 6</strong> Fingerprint authentication.</p> + +<p>Open a terminal session, and telnet to the emulator. For example:</p> +<pre> +{@code telnet localhost 5554} +</pre> + +<p>Enter the <code>finger</code> command to simulate finger touch and removal: </p> + +<ul> + <li><code>finger touch <fingerprint-id></code> to simulate a finger touching the sensor</li> + <li><code>finger remove</code> to simulate finger removal </li> +</ul> + +<p>Your app should respond as if a user touched, and then removed their finger from, the +fingerprint sensor. </p> + + +<h2 id="dev-services">Developer Services</h2> +<p>Android Studio supports enabling these developer services in your app: </p> +<ul> + <li>Ads using <a href="https://developers.google.com/admob/">AdMob</a></li> + <li>Analytics <a href="https://developers.google.com/analytics/">Google Analytics</a></li> + <li>Authentication using <a href="https://developers.google.com/identity/sign-in/android/">Google + Sign-in</a> </li> + <li>Notifications using <a href="https://developers.google.com/cloud-messaging/">Google + Cloud Messaging</a> </li> +</ul> + +<p>Enabling a developer service adds the required dependencies and, when applicable, also modifies +the related configuration files. To activate the service, you must perform +service-specific updates, such as loading an ad in the <code>MainActivity</code> class for ad +display.</p> + +<p>To enable an Android developer service, select the <code>File > Project Structure</code> +menu option and click a service under the <em>Developer Services</em> sub-menu. The service +configuration page appears. In the service configuration page, click the service check box to +enable the service and click <strong>OK</strong>. Android Studio updates your library dependencies +for the selected service and, for Analytics, updates the <code>AndroidManifest.xml</code> and +other tracker configuration files. You can enable multiple services within the same app. For more +detail about starting the services, refer to each service's specific activation instructions. </p> + + + +<h2 id="private-res">Public and Private Resources</h2> +<p>By default, Android Studio treats all library resources as public: A public library resource is +available to library clients for use outside the library, and appears in code completion suggestions +and other resource references. Android Studio also, however, supports the use of private library +resources. A private library resource can only be used within the source library, and does not +appear in code completion lists and other resource references. </p> + +<p>You cannot explicitly declare a library resource as private. Instead, if you declare any library +resources as public, Android Studio assumes all the other library resources are private. </p> + +<p>An app treats all Android library resources as public unless you explicitly declare at least one +resource in the library as public. Declaring one public resource causes your app to treat all other, +undeclared resources in the library as private. </p> + +<p class="note"><strong>Note:</strong> Declaring public and private resources requires the +<a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin for Gradle</a> version +1.3 or higher. </p> + + +<p>To declare a resource as public and set other undeclared resources as private, add a +<code><public></code> declaration with the resource name and type in the resource file. +This example shows the public declaration for the <code>mylib_app_name</code> string resource. </p> + +<pre> +<resources> + <public name="mylib_app_name" type="string"/> +</resources> +</pre> + +<p>For large numbers of declarations, we recommended that you place the public marker declarations +in a separate file named <code>public.xml</code>. </p> + +<p>To help enforce private resource access, a <a href="{@docRoot}tools/help/lint.html">lint</a> +warning appears when a client of a library references a private resource. Many Android libraries, +such as the +<a href="{@docRoot}tools/support-library/features.html#design">Design Support Library</a> and the +<a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat Library</a>, +declare public resources to display only resources that developers can directly reference. +</p> + +<p class="note"><strong>Note:</strong> If your app requires a private resource, copy the +private resource from the library to the location in your app where it is needed. </p> + +<p>When the build system builds an Android Archive (AAR) file, it extracts the +<code><public></code> resource declarations into a <code>public.txt</code> file, which is +packaged inside the AAR file next to the <code>R.txt</code> file. The <code>public.txt</code> file +contains a simple list of the declared public resources, describing their names and types. </p> + +<p>For a complete list of the available Android resource types, see +<a href="http://developer.android.com/guide/topics/resources/available-resources.html">Resource +Types</a></li> and +<a href="http://developer.android.com/guide/topics/resources/more-resources.html">More Resource +Types</a></li>. </p> + + + <h2 id="support-apis">Editor Support for the Latest Android APIs</h2> <p>Android Studio supports the <a href="{@docRoot}design/material/index.html">Material Design</a></li> themes, widgets, and @@ -121,3 +234,103 @@ and <code><animated-selector></code>, are supported.</p> +<h2 id="test-module">Test APK Module</h2> +<p>Android Studio supports adding a separate <code>test</code> module to your app so you can +generate a test APK. This <code>test</code> module resides at the same level as your app and +contains: the tests and instrumentation used to run the test APK on an Android device; an +<code>Android Manifest.xml</code> file for test APK configuration settings; and, a +<code>build.gradle</code> file for build settings.</p> + +<p>The <code>test</code> module cannot contain a <code>src/androidTest/</code> folder and does +not support build variants. If you have different product flavors in your main application APK, +create a different test module for each build variant.</p> + + +<p>To create a test APK module: + +<ul> + <li>Use the <strong>File > New > Module</strong> menu option to create a + <code>test</code> module consisting of the following directories and files: + <ul> + <li><code>./test/</code> </li> + <li><code>./test/build.gradle</code> </li> + <li><code>./test/src/main/java/com/android/tests/basic/MainTest.java</code> </li> + <li><code>./test/src/main/AndroidManifest.xml</code> </li> + </ul> + </li> + <li>In the <code>build.gradle</code> file, add the required properties to the + <code>android</code> block. + <ul> + <li><code>targetProjectPath ':<app name>'</code> specifies the main application APK + to test. </li> + <li><code>targetVariant ':<buildType>'</code> specifies the target build type.</li> + </ul> + <p>Here is an example of <code>build.gradle</code> file property settings: </p> + +<pre> +android { + compileSdkVersion 19 + buildToolsVersion = ‘21.1.3’ + + targetProjectPath ':app' + targetVariant 'debug' +} +</pre> + </li> + <li>Define the instrumentation entries in the manifest file. + <p>Here is an example of <code><instrumentation></code> settings in the manifest file: </p> + +<pre> +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.tests.basic.test"> + + <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16" /> + + <application> + >uses-library android:name="android.test.runner" /> + </application> + + <instrumentation android:name="android.test.InstrumentationTestRunner" + android:targetPackage="com.android.tests.basic" + android:handleProfiling="false" + android:functionalTest="false" + android:label="Tests for com.android.tests.basic"/> +</manifest< +</pre> + +<p class="note"><strong>Note:</strong> The <code>targetPackage</code> in the instrumentation +settings specifies the package of the test variant. </p> + + </li> + <li>In the <code>build.gradle</code> file for the tested app, include additional artifacts + that the test APK requires, such as the <code> classes.jar</code> file, by adding the + {@code publishNonDefault} property to the {@code Android} block, and assigning that property + a value of {@code true}. + <p>Here is an example of the <code>build.gradle</code> file that includes additional + artifacts: </p></li> +<pre> +android { + compileSdkVersion 19 + buildToolsVersion = ‘21.1.3’ + + publishNonDefault true +} +</pre> + </li> +</ul> + + +<p>In the {@code test} module in this example, the {@code build.gradle} file specifies the +properties for the project path and target build type variant. </p> + + <p><img src="{@docRoot}images/tools/studio-test-module.png" /></p> + <p class="img-caption"><strong>Figure 3.</strong> Test module for APK testing.</p> + + +<p class="note"><strong>Note:</strong> By default, the test module's build variant uses the +<code>debug</code> build type. You can configure additional build types using the +<code>testBuildType</code> property in the <code>defaultConfig</code> block in the main +app's <code>build.gradle</code> file. </p> + + diff --git a/docs/html/tools/support-library/index.jd b/docs/html/tools/support-library/index.jd index 5688d8a..9bd9178 100644 --- a/docs/html/tools/support-library/index.jd +++ b/docs/html/tools/support-library/index.jd @@ -59,9 +59,52 @@ page.title=Support Library <p>This section provides details about the Support Library package releases.</p> + <div class="toggle-content opened"> <p id="rev21"><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt="" +/>Android Support Library, revision 22.2.1</a> <em>(July 2015)</em> + </p> + <div class="toggle-content-toggleme"> + <dl> + <dt>Changes for <a href="features.html#design">Design Support library:</a></dt> + <dd> + <ul> + <li>Added the {@code hide()} and {@code show()} methods to the + {@link android.support.design.widget.FloatingActionButton} class for programmatic + triggering of animations. </li> + <li>Added the {@code LENGTH_INDEFINITE} constant to the + {@link android.support.design.widget.Snackbar} class for showing a snackbar + until it is dismissed or another snackbar is shown. Also, added the + {@link android.support.design.widget.Snackbar#setActionTextColor(int)} and + {@link android.support.design.widget.Snackbar#setActionTextColor(ColorStateList)} + methods. </li> + <li>Added the {@code getSelectedTabPosition()} method to the + {@link android.support.design.widget.TabLayout} class for retrieving the currently + selected tab. </li> + <li>Provided a fully fluent API for the + {@link android.support.v7.app.NotificationCompat.MediaStyle} class for method + chaining. </li> + <li>Added convenience methods to the + {@link android.support.v7.widget.RecyclerView} for batch insertion of items. </li> + </ul> + </dd> + </dl> + + <p>For a complete list of the Support Library changes, see the + <a href="{@docRoot}sdk/support_api_diff/22.2.0/changes.html">Support + Library API Differences Report</a>. </p> + + + + </div> +</div> <!-- end of collapsible section --> + + + +<div class="toggle-content closed"> + <p id="rev21"><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Android Support Library, revision 22.2.0</a> <em>(May 2015)</em> </p> <div class="toggle-content-toggleme"> @@ -143,7 +186,7 @@ page.title=Support Library {@link android.support.v4.media.session.PlaybackStateCompat.Builder#setExtras setExtras()} methods to the {@link android.support.v4.media.session.PlaybackStateCompat.Builder} class for adding - adding custom actions to a playback state. + custom actions to a playback state. </li> <li>Added the {@link android.support.v4.media.session.PlaybackStateCompat.CustomAction#fromCustomAction fromCustomAction()} and @@ -203,6 +246,9 @@ page.title=Support Library </ul> </dd> + <p>For a complete list of the Support Library changes, see the + <a href="{@docRoot}sdk/support_api_diff/22.2.0/changes.html">Support + Library API Differences Report</a>. </p> </dl> @@ -212,7 +258,6 @@ page.title=Support Library - <div class="toggle-content closed"> <p id="rev21"><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" diff --git a/docs/html/training/location/index.jd b/docs/html/training/location/index.jd index c4dec99..8ed2071 100644 --- a/docs/html/training/location/index.jd +++ b/docs/html/training/location/index.jd @@ -29,6 +29,14 @@ startpage=true </div> </div> +<a class="notice-developers-video wide" +href="https://www.youtube.com/watch?v=S8sugXgUVEI"> +<div> + <h3>Video</h3> + <p>Activity Recognition</p> + </div> + </a> + <p> One of the unique features of mobile applications is location awareness. Mobile users take their devices with them everywhere, and adding location |
