diff options
Diffstat (limited to 'docs/html')
253 files changed, 7070 insertions, 3959 deletions
diff --git a/docs/html/auto/images/assets/00_frame.png b/docs/html/auto/images/assets/00_frame.png Binary files differnew file mode 100644 index 0000000..2a78380 --- /dev/null +++ b/docs/html/auto/images/assets/00_frame.png diff --git a/docs/html/auto/images/assets/01_a_maps.png b/docs/html/auto/images/assets/01_a_maps.png Binary files differnew file mode 100644 index 0000000..0d1b219 --- /dev/null +++ b/docs/html/auto/images/assets/01_a_maps.png diff --git a/docs/html/auto/images/assets/01_b_now.png b/docs/html/auto/images/assets/01_b_now.png Binary files differnew file mode 100644 index 0000000..043ec74 --- /dev/null +++ b/docs/html/auto/images/assets/01_b_now.png diff --git a/docs/html/auto/images/assets/02_a_notif.gif b/docs/html/auto/images/assets/02_a_notif.gif Binary files differnew file mode 100644 index 0000000..ea1a7cc --- /dev/null +++ b/docs/html/auto/images/assets/02_a_notif.gif diff --git a/docs/html/auto/images/assets/02_b_switcher.gif b/docs/html/auto/images/assets/02_b_switcher.gif Binary files differnew file mode 100644 index 0000000..c4014e3 --- /dev/null +++ b/docs/html/auto/images/assets/02_b_switcher.gif diff --git a/docs/html/auto/images/assets/03_a_musict.png b/docs/html/auto/images/assets/03_a_musict.png Binary files differnew file mode 100644 index 0000000..4e11243 --- /dev/null +++ b/docs/html/auto/images/assets/03_a_musict.png diff --git a/docs/html/auto/images/assets/03_b_voice.gif b/docs/html/auto/images/assets/03_b_voice.gif Binary files differnew file mode 100644 index 0000000..b280a9b --- /dev/null +++ b/docs/html/auto/images/assets/03_b_voice.gif diff --git a/docs/html/auto/images/assets/do_01_switcher.png b/docs/html/auto/images/assets/do_01_switcher.png Binary files differnew file mode 100644 index 0000000..b654a13 --- /dev/null +++ b/docs/html/auto/images/assets/do_01_switcher.png diff --git a/docs/html/auto/images/assets/do_02_music.png b/docs/html/auto/images/assets/do_02_music.png Binary files differnew file mode 100644 index 0000000..59fc8df --- /dev/null +++ b/docs/html/auto/images/assets/do_02_music.png diff --git a/docs/html/auto/images/assets/do_02_music_night.png b/docs/html/auto/images/assets/do_02_music_night.png Binary files differnew file mode 100644 index 0000000..7faccfb --- /dev/null +++ b/docs/html/auto/images/assets/do_02_music_night.png diff --git a/docs/html/auto/images/assets/do_03_more.png b/docs/html/auto/images/assets/do_03_more.png Binary files differnew file mode 100644 index 0000000..17040d1 --- /dev/null +++ b/docs/html/auto/images/assets/do_03_more.png diff --git a/docs/html/auto/images/assets/do_04_mdrawer.png b/docs/html/auto/images/assets/do_04_mdrawer.png Binary files differnew file mode 100644 index 0000000..de94c22 --- /dev/null +++ b/docs/html/auto/images/assets/do_04_mdrawer.png diff --git a/docs/html/auto/images/assets/do_05_template.png b/docs/html/auto/images/assets/do_05_template.png Binary files differnew file mode 100644 index 0000000..63a07d8 --- /dev/null +++ b/docs/html/auto/images/assets/do_05_template.png diff --git a/docs/html/auto/images/assets/do_05_template_night.png b/docs/html/auto/images/assets/do_05_template_night.png Binary files differnew file mode 100644 index 0000000..6acd259 --- /dev/null +++ b/docs/html/auto/images/assets/do_05_template_night.png diff --git a/docs/html/auto/images/assets/do_06_gdrawer.png b/docs/html/auto/images/assets/do_06_gdrawer.png Binary files differnew file mode 100644 index 0000000..b02c0e6 --- /dev/null +++ b/docs/html/auto/images/assets/do_06_gdrawer.png diff --git a/docs/html/auto/images/assets/do_07_notif.png b/docs/html/auto/images/assets/do_07_notif.png Binary files differnew file mode 100644 index 0000000..50ea565 --- /dev/null +++ b/docs/html/auto/images/assets/do_07_notif.png diff --git a/docs/html/auto/images/figure01.png b/docs/html/auto/images/figure01.png Binary files differnew file mode 100644 index 0000000..3044020 --- /dev/null +++ b/docs/html/auto/images/figure01.png diff --git a/docs/html/auto/images/hero.jpg b/docs/html/auto/images/hero.jpg Binary files differnew file mode 100644 index 0000000..34b5b5d --- /dev/null +++ b/docs/html/auto/images/hero.jpg diff --git a/docs/html/auto/images/logos/apps/iheartradio.png b/docs/html/auto/images/logos/apps/iheartradio.png Binary files differnew file mode 100644 index 0000000..8feb38d --- /dev/null +++ b/docs/html/auto/images/logos/apps/iheartradio.png diff --git a/docs/html/auto/images/logos/apps/joyride.png b/docs/html/auto/images/logos/apps/joyride.png Binary files differnew file mode 100644 index 0000000..8c2897e --- /dev/null +++ b/docs/html/auto/images/logos/apps/joyride.png diff --git a/docs/html/auto/images/logos/apps/mlb.png b/docs/html/auto/images/logos/apps/mlb.png Binary files differnew file mode 100644 index 0000000..ddde4cd --- /dev/null +++ b/docs/html/auto/images/logos/apps/mlb.png diff --git a/docs/html/auto/images/logos/apps/pandora.png b/docs/html/auto/images/logos/apps/pandora.png Binary files differnew file mode 100644 index 0000000..13fa1d3 --- /dev/null +++ b/docs/html/auto/images/logos/apps/pandora.png diff --git a/docs/html/auto/images/logos/apps/pocketcasts.png b/docs/html/auto/images/logos/apps/pocketcasts.png Binary files differnew file mode 100644 index 0000000..5227937 --- /dev/null +++ b/docs/html/auto/images/logos/apps/pocketcasts.png diff --git a/docs/html/auto/images/logos/apps/songza.png b/docs/html/auto/images/logos/apps/songza.png Binary files differnew file mode 100644 index 0000000..3bd7107 --- /dev/null +++ b/docs/html/auto/images/logos/apps/songza.png diff --git a/docs/html/auto/images/logos/apps/spotify.png b/docs/html/auto/images/logos/apps/spotify.png Binary files differnew file mode 100644 index 0000000..d039fd3 --- /dev/null +++ b/docs/html/auto/images/logos/apps/spotify.png diff --git a/docs/html/auto/images/logos/apps/stitcher.png b/docs/html/auto/images/logos/apps/stitcher.png Binary files differnew file mode 100644 index 0000000..b77da12 --- /dev/null +++ b/docs/html/auto/images/logos/apps/stitcher.png diff --git a/docs/html/auto/images/logos/apps/tunein.png b/docs/html/auto/images/logos/apps/tunein.png Binary files differnew file mode 100644 index 0000000..137ba81 --- /dev/null +++ b/docs/html/auto/images/logos/apps/tunein.png diff --git a/docs/html/auto/images/logos/apps/umano.png b/docs/html/auto/images/logos/apps/umano.png Binary files differnew file mode 100644 index 0000000..7b59f95 --- /dev/null +++ b/docs/html/auto/images/logos/apps/umano.png diff --git a/docs/html/auto/images/logos/auto/abarth.png b/docs/html/auto/images/logos/auto/abarth.png Binary files differnew file mode 100644 index 0000000..fd1d228 --- /dev/null +++ b/docs/html/auto/images/logos/auto/abarth.png diff --git a/docs/html/auto/images/logos/auto/acura.png b/docs/html/auto/images/logos/auto/acura.png Binary files differnew file mode 100644 index 0000000..4ba69cc --- /dev/null +++ b/docs/html/auto/images/logos/auto/acura.png diff --git a/docs/html/auto/images/logos/auto/alpharomeo.png b/docs/html/auto/images/logos/auto/alpharomeo.png Binary files differnew file mode 100644 index 0000000..51c8c58 --- /dev/null +++ b/docs/html/auto/images/logos/auto/alpharomeo.png diff --git a/docs/html/auto/images/logos/auto/audi.png b/docs/html/auto/images/logos/auto/audi.png Binary files differnew file mode 100644 index 0000000..86cb06b --- /dev/null +++ b/docs/html/auto/images/logos/auto/audi.png diff --git a/docs/html/auto/images/logos/auto/bentley.png b/docs/html/auto/images/logos/auto/bentley.png Binary files differnew file mode 100644 index 0000000..ed8cf47 --- /dev/null +++ b/docs/html/auto/images/logos/auto/bentley.png diff --git a/docs/html/auto/images/logos/auto/chevrolet.png b/docs/html/auto/images/logos/auto/chevrolet.png Binary files differnew file mode 100644 index 0000000..e0980b0 --- /dev/null +++ b/docs/html/auto/images/logos/auto/chevrolet.png diff --git a/docs/html/auto/images/logos/auto/chrysler.png b/docs/html/auto/images/logos/auto/chrysler.png Binary files differnew file mode 100644 index 0000000..c670c19 --- /dev/null +++ b/docs/html/auto/images/logos/auto/chrysler.png diff --git a/docs/html/auto/images/logos/auto/datsun.png b/docs/html/auto/images/logos/auto/datsun.png Binary files differnew file mode 100644 index 0000000..059ffd8 --- /dev/null +++ b/docs/html/auto/images/logos/auto/datsun.png diff --git a/docs/html/auto/images/logos/auto/dodge.png b/docs/html/auto/images/logos/auto/dodge.png Binary files differnew file mode 100644 index 0000000..4d6fcc0 --- /dev/null +++ b/docs/html/auto/images/logos/auto/dodge.png diff --git a/docs/html/auto/images/logos/auto/fiat.png b/docs/html/auto/images/logos/auto/fiat.png Binary files differnew file mode 100644 index 0000000..b9783d9 --- /dev/null +++ b/docs/html/auto/images/logos/auto/fiat.png diff --git a/docs/html/auto/images/logos/auto/ford.png b/docs/html/auto/images/logos/auto/ford.png Binary files differnew file mode 100644 index 0000000..86a2670 --- /dev/null +++ b/docs/html/auto/images/logos/auto/ford.png diff --git a/docs/html/auto/images/logos/auto/honda.png b/docs/html/auto/images/logos/auto/honda.png Binary files differnew file mode 100644 index 0000000..62ee38f --- /dev/null +++ b/docs/html/auto/images/logos/auto/honda.png diff --git a/docs/html/auto/images/logos/auto/hyundai.png b/docs/html/auto/images/logos/auto/hyundai.png Binary files differnew file mode 100644 index 0000000..4744641 --- /dev/null +++ b/docs/html/auto/images/logos/auto/hyundai.png diff --git a/docs/html/auto/images/logos/auto/infinity.png b/docs/html/auto/images/logos/auto/infinity.png Binary files differnew file mode 100644 index 0000000..a20e0a0 --- /dev/null +++ b/docs/html/auto/images/logos/auto/infinity.png diff --git a/docs/html/auto/images/logos/auto/jeep.png b/docs/html/auto/images/logos/auto/jeep.png Binary files differnew file mode 100644 index 0000000..024c3d1 --- /dev/null +++ b/docs/html/auto/images/logos/auto/jeep.png diff --git a/docs/html/auto/images/logos/auto/kia.png b/docs/html/auto/images/logos/auto/kia.png Binary files differnew file mode 100644 index 0000000..f8046d9 --- /dev/null +++ b/docs/html/auto/images/logos/auto/kia.png diff --git a/docs/html/auto/images/logos/auto/maserati.png b/docs/html/auto/images/logos/auto/maserati.png Binary files differnew file mode 100644 index 0000000..22bcf6a --- /dev/null +++ b/docs/html/auto/images/logos/auto/maserati.png diff --git a/docs/html/auto/images/logos/auto/mazda.png b/docs/html/auto/images/logos/auto/mazda.png Binary files differnew file mode 100644 index 0000000..2281c90 --- /dev/null +++ b/docs/html/auto/images/logos/auto/mazda.png diff --git a/docs/html/auto/images/logos/auto/mercedesbenz.png b/docs/html/auto/images/logos/auto/mercedesbenz.png Binary files differnew file mode 100644 index 0000000..05fab0f --- /dev/null +++ b/docs/html/auto/images/logos/auto/mercedesbenz.png diff --git a/docs/html/auto/images/logos/auto/mitsubishi.png b/docs/html/auto/images/logos/auto/mitsubishi.png Binary files differnew file mode 100644 index 0000000..1405b19 --- /dev/null +++ b/docs/html/auto/images/logos/auto/mitsubishi.png diff --git a/docs/html/auto/images/logos/auto/nissan.png b/docs/html/auto/images/logos/auto/nissan.png Binary files differnew file mode 100644 index 0000000..63bc4f7 --- /dev/null +++ b/docs/html/auto/images/logos/auto/nissan.png diff --git a/docs/html/auto/images/logos/auto/opel.png b/docs/html/auto/images/logos/auto/opel.png Binary files differnew file mode 100644 index 0000000..7e25ed5 --- /dev/null +++ b/docs/html/auto/images/logos/auto/opel.png diff --git a/docs/html/auto/images/logos/auto/ram.png b/docs/html/auto/images/logos/auto/ram.png Binary files differnew file mode 100644 index 0000000..9702587 --- /dev/null +++ b/docs/html/auto/images/logos/auto/ram.png diff --git a/docs/html/auto/images/logos/auto/renault.png b/docs/html/auto/images/logos/auto/renault.png Binary files differnew file mode 100644 index 0000000..65a4ae3 --- /dev/null +++ b/docs/html/auto/images/logos/auto/renault.png diff --git a/docs/html/auto/images/logos/auto/seat.png b/docs/html/auto/images/logos/auto/seat.png Binary files differnew file mode 100644 index 0000000..9802ccf --- /dev/null +++ b/docs/html/auto/images/logos/auto/seat.png diff --git a/docs/html/auto/images/logos/auto/skoda.png b/docs/html/auto/images/logos/auto/skoda.png Binary files differnew file mode 100755 index 0000000..7bc06b0 --- /dev/null +++ b/docs/html/auto/images/logos/auto/skoda.png diff --git a/docs/html/auto/images/logos/auto/subaru.png b/docs/html/auto/images/logos/auto/subaru.png Binary files differnew file mode 100644 index 0000000..7407e61 --- /dev/null +++ b/docs/html/auto/images/logos/auto/subaru.png diff --git a/docs/html/auto/images/logos/auto/suzuki.png b/docs/html/auto/images/logos/auto/suzuki.png Binary files differnew file mode 100644 index 0000000..85fd7e5 --- /dev/null +++ b/docs/html/auto/images/logos/auto/suzuki.png diff --git a/docs/html/auto/images/logos/auto/volkswagen.png b/docs/html/auto/images/logos/auto/volkswagen.png Binary files differnew file mode 100644 index 0000000..febadf4 --- /dev/null +++ b/docs/html/auto/images/logos/auto/volkswagen.png diff --git a/docs/html/auto/images/logos/auto/volvo.png b/docs/html/auto/images/logos/auto/volvo.png Binary files differnew file mode 100644 index 0000000..683af26 --- /dev/null +++ b/docs/html/auto/images/logos/auto/volvo.png diff --git a/docs/html/auto/images/logos/hard/alpine.png b/docs/html/auto/images/logos/hard/alpine.png Binary files differnew file mode 100644 index 0000000..55f0e8a --- /dev/null +++ b/docs/html/auto/images/logos/hard/alpine.png diff --git a/docs/html/auto/images/logos/hard/clarion.png b/docs/html/auto/images/logos/hard/clarion.png Binary files differnew file mode 100644 index 0000000..2288b99 --- /dev/null +++ b/docs/html/auto/images/logos/hard/clarion.png diff --git a/docs/html/auto/images/logos/hard/cloudcar.png b/docs/html/auto/images/logos/hard/cloudcar.png Binary files differnew file mode 100644 index 0000000..9e7e8b7 --- /dev/null +++ b/docs/html/auto/images/logos/hard/cloudcar.png diff --git a/docs/html/auto/images/logos/hard/delphi.png b/docs/html/auto/images/logos/hard/delphi.png Binary files differnew file mode 100644 index 0000000..a2a03de --- /dev/null +++ b/docs/html/auto/images/logos/hard/delphi.png diff --git a/docs/html/auto/images/logos/hard/freescale.png b/docs/html/auto/images/logos/hard/freescale.png Binary files differnew file mode 100644 index 0000000..2909944 --- /dev/null +++ b/docs/html/auto/images/logos/hard/freescale.png diff --git a/docs/html/auto/images/logos/hard/fujitsuten.png b/docs/html/auto/images/logos/hard/fujitsuten.png Binary files differnew file mode 100644 index 0000000..70269e3 --- /dev/null +++ b/docs/html/auto/images/logos/hard/fujitsuten.png diff --git a/docs/html/auto/images/logos/hard/harman.png b/docs/html/auto/images/logos/hard/harman.png Binary files differnew file mode 100644 index 0000000..0fb295a --- /dev/null +++ b/docs/html/auto/images/logos/hard/harman.png diff --git a/docs/html/auto/images/logos/hard/jvc.png b/docs/html/auto/images/logos/hard/jvc.png Binary files differnew file mode 100644 index 0000000..6a9c7ad --- /dev/null +++ b/docs/html/auto/images/logos/hard/jvc.png diff --git a/docs/html/auto/images/logos/hard/kenwood.png b/docs/html/auto/images/logos/hard/kenwood.png Binary files differnew file mode 100644 index 0000000..3c80098 --- /dev/null +++ b/docs/html/auto/images/logos/hard/kenwood.png diff --git a/docs/html/auto/images/logos/hard/lg.png b/docs/html/auto/images/logos/hard/lg.png Binary files differnew file mode 100644 index 0000000..52feeff --- /dev/null +++ b/docs/html/auto/images/logos/hard/lg.png diff --git a/docs/html/auto/images/logos/hard/panasonic.png b/docs/html/auto/images/logos/hard/panasonic.png Binary files differnew file mode 100644 index 0000000..b6aaaf1 --- /dev/null +++ b/docs/html/auto/images/logos/hard/panasonic.png diff --git a/docs/html/auto/images/logos/hard/parrot.png b/docs/html/auto/images/logos/hard/parrot.png Binary files differnew file mode 100644 index 0000000..d5bf41f --- /dev/null +++ b/docs/html/auto/images/logos/hard/parrot.png diff --git a/docs/html/auto/images/logos/hard/pioneer.png b/docs/html/auto/images/logos/hard/pioneer.png Binary files differnew file mode 100644 index 0000000..307d71a --- /dev/null +++ b/docs/html/auto/images/logos/hard/pioneer.png diff --git a/docs/html/auto/images/logos/hard/renesas.png b/docs/html/auto/images/logos/hard/renesas.png Binary files differnew file mode 100644 index 0000000..69ecab7 --- /dev/null +++ b/docs/html/auto/images/logos/hard/renesas.png diff --git a/docs/html/auto/images/logos/hard/symphonyteleca.png b/docs/html/auto/images/logos/hard/symphonyteleca.png Binary files differnew file mode 100644 index 0000000..0b3ebe5 --- /dev/null +++ b/docs/html/auto/images/logos/hard/symphonyteleca.png diff --git a/docs/html/auto/images/logos/hard/texasinstruments.png b/docs/html/auto/images/logos/hard/texasinstruments.png Binary files differnew file mode 100644 index 0000000..87d80cb --- /dev/null +++ b/docs/html/auto/images/logos/hard/texasinstruments.png diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd new file mode 100644 index 0000000..5ce6289 --- /dev/null +++ b/docs/html/auto/index.jd @@ -0,0 +1,490 @@ +page.title=Android Auto +page.viewport_width=970 +fullpage=true +no_footer_links=true +page.type=about + +@jd:body + +<style> +.fullpage>#footer, +#jd-content>.content-footer.wrap { + display:none; +} +#hero-height { + height:calc(100% - 100px); +} +.img-logo { + margin:0 auto; + display:block; + margin-bottom:-28px !important; +} +.img-logo-thin { + margin:0 auto; + display:block; + margin-bottom:-55px !important; +} +.col-5 { + width:170px; +} +.auto-img-container-cols { + position:relative; + margin-bottom:25px; + margin-top:25px; +} +.auto-img-frame-cols { + z-index:2; + position:relative; + width:460px; +} +.auto-img-shot-cols { + width:447px; + position:absolute; + top:8px; + left:7px; + z-index:1; +} +.sdk-link { + font-size:16px; + padding-left:5px; + padding-right:15px; +} +.sdk-link-title { + font-size:18px; + padding-left:5px; + padding-right:15px; +} +.sdk-link-desc { + font-size:14px; + padding-left:5px; + padding-right:15px; +} +</style> + + +<div class="landing-body-content"> + <div class="landing-hero-container"> + + <div id="hero-height" class="landing-section auto-hero"> + <div class="landing-hero-scrim"></div> + <div class="landing-hero-wrap"> + <div class="vertical-center-outer"> + <div class="vertical-center-inner"> + + <div class="col-10"> + <div class="landing-section-header"> + <div class="landing-h1 hero">Android Auto</div> + <div class="landing-subhead hero">Entertainment and services on your dashboard</div> + <div class="landing-hero-description"> + <p style="width:450px">Display and control your Android app in vehicles. + Integrate your content with easy-to-use APIs and let Android Auto take + care of the rest.</p> + </div> + + <div class="landing-body"> + <a href="{@docRoot}auto/overview.html" class="landing-button landing-primary" + style="margin-top:40px;"> + Developer Overview + </a> + </div> + </div> + </div> + </div> + </div> <!-- end .wrap --> + + <div class="landing-scroll-down-affordance"> + <a class="landing-down-arrow" href="#android-in-car"> + <img src="{@docRoot}wear/images/carrot.png" alt="Scroll down to read more"> + </a> + </div> + </div> <!-- end .landing-section .landing-hero --> + </div> <!-- end .landing-hero-container --> + + <div class="landing-rest-of-page"> + + <div class="landing-section landing-gray-background" id="android-in-car"> + <div class="wrap"> + <div class="landing-section-h1"> + <div class="landing-h1">Extending Android to Cars</div> + </div> + <div class="landing-body"> + <div class="landing-subhead">Android Auto brings the Android experience to + cars with apps like Google Now and Maps.</div> + <div class="cols"> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/01_b_now.png" /> + </div> + </div> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/01_a_maps.png" /> + </div> + </div> + </div> + + <p>When users connect their Android phones to compatible vehicles, Android Auto + shows a standard interface that lets them start enabled apps and services. + Android Auto locks the handheld device when connected, so drivers + interact with Auto by using the vehicle's input controls, touch display, and voice.</p> + </p> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + + <div class="landing-section"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Build for One Platform</div> + <div class="landing-subhead">Create apps with the Android APIs you're familiar with + and extend them to cars with the Auto SDK. + </div> + </div> + + <div class="landing-body"> + + <div class="cols"> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/02_b_switcher.gif" /> + </div> + </div> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/02_a_notif.gif" /> + </div> + </div> + </div> + <p>Write your apps without having + to worry about vehicle-specific hardware differences like screen resolution, software + interfaces, knobs, and touch controls. Your users get the same experience on any compatible + vehicle such as a consistent app launcher and system events such as notifications.</p> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + + <div class="landing-section landing-gray-background"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Minimize Distraction</div> + <div class="landing-subhead"> + Android Auto displays different UIs for several app categories that let users focus on the road. + </div> + </div> + <div class="landing-body"> + <div class="cols"> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/03_b_voice.gif" /> + </div> + </div> + <div class="col-8"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/03_a_musict.png" /> + </div> + </div> + </div> + <p>Android Auto defines the user interaction model for all + apps and let you hook into a standard UI with touch and voice controls. The interface + is designed to reduce driver distraction while still letting you customize and brand them to properly deliver your content. + </p> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + <div class="landing-section" style="background-color:#f5f5f5"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-pre-h1">Coming soon</div> + <div class="landing-h1">Android Auto SDK</div> + </div> + + <div class="landing-body"> + <p>In the coming months, we’ll be releasing the Android Auto SDK, which includes APIs + and tools to make your existing apps compatible with Android Auto. The first version + of the SDK will provide APIs for music, podcast, live radio, and audio + news apps, as well as limited voice actions.</p> + + <div class="cols" style="margin-top:40px"> + <div class="col-3-wide"> + <p class="sdk-link-title">Updates</p> + <p class="sdk-link-desc"> + Register to receive more information and be notified when the SDK is available. + </p> + <a class="sdk-link" href="https://docs.google.com/a/google.com/forms/d/1ANgYOoYLkfyZ2JRPSU34Nep5yNaU-Ha2syXJ9b4xLrA/viewform">Sign up for updates</a> + </div> + <div class="col-3-wide"> + <p class="sdk-link-title">Google+ Community</p> + <p class="sdk-link-desc"> + Stay involved, get updates, and exchange experiences with other developers. + </p> + <a class="sdk-link" href="http://g.co/androidautodev">Discuss on Google+</a> + </div> + <div class="col-3-wide"> + <p class="sdk-link-title">Developer Overview</p> + <p class="sdk-link-desc"> + Learn more about developing apps for Android Auto when the SDK is available. + </p> + <a class="sdk-link" href="{@docRoot}auto/overview.html">Learn about the platform</a> + </div> + </div> + </div> + + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + + + <div class="landing-section landing-gray-background" > + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">See What Others Have Done</div> + <div class="landing-subhead">We're working with developers to bring many popular apps + to Android Auto</div> + </div> + <div class="landing-body"> + <div class="cols"> + + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/joyride.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/mlb.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/pandora.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/pocketcasts.png" + width="160" height="160" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/songza.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/stitcher.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/tunein.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/umano.png" + width="160" height="160" class="img-logo" /> + </div> + </div> + <div class="cols" style="margin-top:40px"> + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/iheartradio.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-12"> + <p><em> + "The Android Auto APIs provide an easy way to integrate the most important features and functionality of iHeartRadio’s robust music service into a safety-minded automotive infotainment solution. The process was seamless, utilizing a flexible construct that allowed us to quickly adapt our existing product without losing any of the core experience our listeners know and love."</em></p> + </div> + </div> + <div class="cols" style="margin-top:60px"> + + <div class="col-4"> + <img src="{@docRoot}auto/images/logos/apps/spotify.png" + width="160" height="160" class="img-logo" /> + </div> + <div class="col-12"><p style="margin-top:20px"><em> + "Android Auto offers Spotify the exciting opportunity to easily enable safe access to millions of songs while driving. We were able to quickly develop for the platform using the new Android voice and media API extensions. As a result, Android users will soon be able to continue the Spotify experience in their cars, including being able to play any song, artist, album or playlist by voice.</em></p> + </div> + </div> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + + + + <div class="landing-section landing-white-background"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Building an Ecosystem</div> + </div> + <div class="landing-body landing-align-center"> + <div class="landing-subhead"> + Android Auto is coming soon to new cars from these manufacturers + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/abarth.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/alpharomeo.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/acura.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/audi.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/bentley.png" + width="120" height="120" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/chevrolet.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/chrysler.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/dodge.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/fiat.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/ford.png" + width="120" height="120" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/honda.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/hyundai.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/infinity.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/jeep.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/kia.png" + width="120" height="120" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/maserati.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/mazda.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/mercedesbenz.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/mitsubishi.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/nissan.png" + width="120" height="120" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/opel.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/ram.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/renault.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/seat.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/skoda.png" + width="120" height="120" class="img-logo" /> + </div> + </div> + <div class="cols"> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/subaru.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/suzuki.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/volkswagen.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <img src="{@docRoot}auto/images/logos/auto/volvo.png" + width="120" height="120" class="img-logo" /> + </div> + <div class="col-5"> + <!--<img src="/auto/images/logos/auto/skoda.png" + width="120" height="120" class="img-logo" />--> + </div> + </div> + </div> + </div> + </div> <!-- end .landing-rest-of-page --> + <div class="content-footer wrap" itemscope="" itemtype="http://schema.org/SiteNavigationElement" + style="border-top: none;"> + <div class="layout-content-col col-16" style="padding-top:4px"> + <style>#___plusone_0 {float:right !important;}</style> + <div class="g-plusone" data-size="medium"></div> + </div> + </div> + <div id="footer" class="wrap" style="width:940px;position:relative;top:-35px;z-index:-1"> + <div id="copyright"> + Except as noted, this content is + licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> + Creative Commons Attribution 2.5</a>. For details and + restrictions, see the <a href="{@docRoot}license.html">Content + License</a>. + </div> + </div> + </div> <!-- end .landing-hero-container --> + + <script> + $("a.landing-down-arrow").on("click", function(e) { + $("body").animate({ + scrollTop: $(".auto-hero").height() + 120 + }, 1000, "easeOutQuint"); + e.preventDefault(); + }); + </script> + +</div> <!-- end landing-body-content --> diff --git a/docs/html/auto/overview.jd b/docs/html/auto/overview.jd new file mode 100644 index 0000000..cf63b98 --- /dev/null +++ b/docs/html/auto/overview.jd @@ -0,0 +1,411 @@ +fullpage=true +page.viewport_width=970 +no_footer_links=true +excludeFromSuggestions=true +page.metaDescription=Android Auto + +@jd:body + +<style> +.jd-descr { + height:auto; +} +#copyright { + margin-top:-35px; +} +.auto-img-container { + position:relative; +} +.auto-img-frame { + z-index:2; + position:relative; +} +.auto-img-shot { + position:absolute; + top:9px; + left:8px; + z-index:1; +} +.auto-img-container-cols { + position:relative; + margin-top:10px; +} +.auto-img-frame-cols { + width:380px; + z-index:2; + position:relative; +} +.auto-img-shot-cols { + width:369px; + position:absolute; + top:7px; + left:6px; + z-index:1; +} +.auto-col-2 { + width:380px; + display: inline; + float: left; + margin-left: 10px; + margin-right: 10px; +} +.auto-img-container-single { + width:380px; + margin:0 auto; + margin-top:20px; +} +</style> + +<div style="width:780px; margin:0 auto;"> + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#design">Design</a> + <ol> + <li><a href="#designprinciples">Design Principles</a></li> + <li><a href="#uioverview">UI Overview</a></li> + </ol> + </li> + <li><a href="#architecture">Architecture</a></li> + <li><a href="#ui">User Interface</a> + <ol> + <li><a href="#launchapp">Launch App</a></li> + <li><a href="#useractions">User Actions</a></li> + <li><a href="#drawertransitions">Drawer Transitions</a></li> + <li><a href="#daynighttransitions">Day and Night Transitions</a></li> + <li><a href="#customizeui">Customizing the UI</a></li> + </ol> + </li> + <li><a href="#devprocess">Development Process</a></li> + <li><a href="#emulator">Testing Your App</a></li> + <li><a href="#running">Running Your App</a></li> +</ol> +</div> +</div> + +<h1>Android Auto Developer Overview</h1> + +<p>Android Auto extends the Android platform into the car. When users connect +their Android handheld device to a compatible vehicle, Android Auto provides a car-optimized +Android experience on the vehicle's screen. Users interact with compatible apps and services +through voice actions and the vehicle's input controls.</p> + +<p>The Android Auto SDK lets you easily extend your existing apps to work in the car, without +having to worry about vehicle-specific hardware differences. You can use many Android APIs and +services you are already familiar with. Android Auto provides an easy to use UI model and +supports notifications and voice actions:</p> + +<dl> +<dt style="margin-bottom:10px"><strong>Media UI</strong></dt> +<dd style="margin-bottom:20px"> +Android Auto defines interaction models and car-specific UI patterns for apps. The +first version of Android Auto supports media apps, such as music, podcast, live radio, and +audio news apps. +</dd> +<dt style="margin-bottom:10px"><strong>Notifications</strong></dt> +<dd style="margin-bottom:20px"> +The platform will integrate with existing Android APIs for notifications. Users will get +car appropiate notifications from Android apps on the vehicle's screen.</dd> + +<dt style="margin-bottom:10px"><strong>Voice Actions</strong></dt> +<dd style="margin-bottom:20px"> +Android Auto supports a set of voice actions to interact with compatible apps and services. +Apps can respond to the voice actions they're interested in, such as playing a particular song +or taking a note.</dd> + +<dt style="margin-bottom:10px"><strong>Easy Development Workflow</strong></dt> +<dd style="margin-bottom:20px"> +To extend an existing Android app for Android Auto, you implement a set of interfaces and +services defined in the platform. You can reuse existing functionality and many Android APIs +you already know.</dd> +</dl> + +<p>We’ll release the Android Auto SDK in the coming months, which will let you test your +Android Auto experience on a regular Android device.</p> + + +<h2 id="design">Design</h2> + +<p>Android Auto extends users' digital ecosystem into their cars, allowing drivers to stay +connected to their virtual worlds while staying focused on the road ahead.</p> + +<p>Because driving is the primary activity in the car, any digital experiences should be designed +to complement and augment that activity. They should never demand the user's attention.</p> + +<p>Designing for cars is fundamentally different than designing for phones or tablets, and +requires rethinking how experiences unfold. Because attention is limited and not all tasks are +possible in the car, effective apps leverage the entire set of devices that drivers have, +leveraging the app experience on those devices, outside of the car, to set the stage for simple +experiences while driving.</p> + +<p>Android Auto experiences are:</p> + +<p><strong>Glanceable and simple</strong>. Driving requires users' full attention. In-car software +should not. Android Auto was designed to simplify not only the UI, but to optimize interactions +and require less thinking, induce lower cognitive load, and ultimately, be safer. Effective apps +provide just enough information in the minimum amount of time the user needs to glance at it and +return their attention back to the road. Apps should also reduce the number of features to only +those that are safe and drive-appropriate.</p> + +<p><strong>Predictive, yet predictable</strong>. Android Auto leverages rich, contextual awareness +to keep the driver informed about important situations during the drive. Rich, timely help is +combined with predictable functions. Effective apps make use of the patterns for common tasks and +show timely information only when relevant.</p> + +<p><strong>Connected</strong>. By leveraging the user's personal ecosystem of apps and services, +Android Auto promotes a continuous experience from phone to car to other devices. The user's +music, destinations, and virtual ecosystem are always available to augment the drive. Experiences +that leverage personal context and other devices are naturally part of Android Auto.</p> + +<p><strong>Naturally integrated</strong>. Android Auto blends the user's apps with the car, +creating a truly integrated experience that leverages what is unique about each car. By using +the screens, controls, and capabilities of the vehicle, Android Auto feels like an extension of +the car.</p> + + + + +<h2 id="architecture">Architecture</h2> + +<p>The Android Auto app shows your app's customized UI on the vehicle's screen. To communicate +with the Android Auto app, your media app implements a set of media interfaces.</p> + +<div style="width:750px;margin:0 auto"> +<img src="{@docRoot}auto/images/figure01.png" alt="" /> +<p class="img-caption"> + <strong>Figure 1</strong> - Architecture of Android Auto. +</p> +</div> + +<p>The architecture consists of the following components:</p> + +<p><strong>Media App</strong> - Runs a media service that exposes content through browsing and +playback APIs. The service provides content to the Android Auto app. This is your Android app.</p> + +<p><strong>Android Auto App</strong> - Creates the UI and handles user interactions. +This app uses a media client to request content from the media service running in the media +app. The client requests data from the media service and monitors service states.</p> + +<p><strong>Vehicle Display</strong> - Shows app content and supports user interaction via +on-screen soft buttons and other components, such as physical buttons or steering +wheel controls.</p> + +<p>Android media apps must implement binders to these APIs:</p> + +<ul> +<li><strong>Browsing</strong> - Enables a media client to browse a hierarchy of a user’s +media collection, presented as a virtual file system with containers (similar to directories) +and items (similar to files).</li> +<li><strong>Playback</strong> - Enables a media client to control media playback and monitor +playback state through callbacks.</li> +</ul> + + +<h2 id="ui">User Interface</h2> + +<p>The Android Auto app uses a car-specific UI model to display content and user interaction +opportunities. Android Auto provides you with a standard UI designed to minimize driver +distraction. You do not have to test a custom UI for for driver distraction, which is a +lengthy and expensive process involving multiple legislations across the globe and different +standards for each vehicle OEM.</p> + +<p>The UI defines interfaces for browsing, searching, and listening to content from +media apps. You can customize the UI colors, action icons, background images, and more.</p> + +<h3 id="launchapp">Launcher</h3> + +<p>The launcher shows all the compatible media apps installed on the user’s +Android device and lets users select one of them from an scrollable list:</p> + +<div class="auto-img-container-single"> + <div class="auto-img-container"> + <img class="auto-img-frame-cols" src="/auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="/auto/images/assets/do_01_switcher.png" /> + </div> + <p class="img-caption" style="margin-top:0px"> + <strong>Figure 2.</strong> The launcher. + </p> +</div> + +<h3>Primary App UI</h3> + +<p>After the user selects a media app, the display shows the primary app UI. +You can customize this UI to show your own icons, app name, and +background images. Figure 3 shows an example of a customized UI:</p> + +<div class="cols"> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_05_template.png" /> + </div> +</div> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_02_music.png" /> + </div> +</div> +</div> +<p class="img-caption"> + <strong>Figure 3.</strong> A customized UI. +</p> + + + +<h3 id="useractions">User Actions</h3> + +<p>The primary app UI supports four main actions on the action bar, four auxiliary actions +on the overflow bar, and the <em>Return</em> action. You can use standard controls and customize +the actions and icons, as shown in Figure 4.</p> + +<div class="auto-img-container-single"> + <div class="auto-img-container"> + <img class="auto-img-frame-cols" src="/auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="/auto/images/assets/do_03_more.png" /> + </div> + <p class="img-caption" style="margin-top:0px"> + <strong>Figure 4.</strong> Custom extra actions. + </p> +</div> + +<h3 id="drawertransitions">Drawer Transitions</h3> + +<p>For browse actions, the display shows the drawer transition as shown in Figure 5.</p> + +<div class="cols"> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_06_gdrawer.png" /> + </div> +</div> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_04_mdrawer.png" /> + </div> +</div> +</div> +<p class="img-caption"> + <strong>Figure 5.</strong> Generic and customized drawers. +</p> + +<p>After the transition from the primary app UI to the drawer UI, the drawer +appears on the center. The customized drawer UI shows the media containers and +media files provided by the media service in your app. You can also customize drawers +with icons for list items.</p> + + +<h3 id="daynighttransitions">Day and Night Transitions</h3> + +<p>All the UIs support different color schemes for day and night. +The platform provides the state (day or night) and makes adjustments automatically.</p> + +<div class="cols"> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_02_music.png" /> + </div> +</div> +<div class="auto-col-2"> + <div class="auto-img-container-cols"> + <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" /> + <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_02_music_night.png" /> + </div> +</div> +</div> +<p class="img-caption"> + <strong>Figure 6.</strong> Day and night modes. +</p> + +<h3 id="customizeui">Customizing UIs</h3> + +<p>To customize the UI, you provide the following app-specific resources and actions +to the Android Auto media client:</p> + +<ul> +<li><strong>Resources</strong> - App logo, app name, theme colors, and background images.</li> +<li><strong>Actions</strong> - Multiple custom actions; for example: <em>Thumbs Up/Down</em>, +<em>Favorite</em>, and <em>Bookmark</em>. These actions are app-specific.</li> +</ul> + +<p>If provided, the media client automatically uses them in the UI.</p> + + +<h2 id="devprocess">Development Process</h2> + +<p class="note"><strong>Note:</strong> When released, the Android Auto SDK will provide +media service interfaces, an APK for handheld devices that simulates the Android Auto +app, and other tools for Android Auto development.</p> + +<p>To create a media app for Android Auto, you include an Android service in your app +that implements the media service interfaces provided by the Android Auto SDK. These +interfaces define functionality for browsing and finding content, playing media, +customizing the UI, and performing app-specific actions.</p> + +<p>The media service interfaces present the content library as a navigable tree and enable +clients to play media, get album art, obtain theme resources for the UI, and +invoke app-specific actions.</p> + +<p>You don’t have to create a new app for Android Auto: you can extend your existing +Android app with implementations of the media service interfaces. Your service exposes +your app’s media content, theme resources, and app-specific actions using the methods and +data types specified by the media service interfaces. This simplifies the development +cycle because:</p> + +<ul> +<li>You do not have to maintain a separate project for Android Auto</li> +<li>You can reuse existing functionality from your Android app</li> +</ul> + +<p>The Android Auto client presents the customized UI to users and invokes the +functionality from your service as needed. This has two additional advantages:</p> + +<ul> +<li>Your app does not implement a UI for Android Auto</li> +<li>Your app does not manage user interactions directly</li> +</ul> + +<p>This also means that you do not have to worry about vehicle-specific hardware +differences such as screen resolutions, software interfaces, knobs and touch +controls.</p> + + +<h2 id="emulator">Testing Your App on an Android Device</h2> + +<p>The Android Auto SDK includes an APK with a media client implementation, which is +similar to those available in compatible vehicles. To test your app with this +client:</p> + +<ol> +<li>Get an Android device with a similar form factor to a dashboard screen (like a +Nexus 7).</li> +<li>Configure the device for Android development.</li> +<li>Install the APK for the media client from the Android Auto SDK on the device.</li> +<li>Install the APK for your app on the device.</li> +<li>Open the media client app from the Android Auto SDK on the device.</li> +<li>Select your app from the list of available services.</li> +</ol> + +<p>The customized UI for your app appears on the client. You can navigate the content +library and play media. If your app provides app-specific actions, these actions appear +in the UI controls.</p> + + +<h2 id="running">Running Your App on Android Auto</h2> + +<p>Media apps are available on the Google Play Store for compatible Android devices. +When users connect their Android device to a compatible vehicle, the +Android Auto media client shows a list of all the Android apps installed on the phone +that implement the media service interfaces.</p> + +<p>When users select one of these apps, the Android Auto media client uses the app’s +service to respond to user input and invoke the methods in the media service interfaces +to build the UI, navigate the content library, and play media.</p> + +<div style="margin-bottom:40px"> </div> +</div> diff --git a/docs/html/design/auto/index.jd b/docs/html/design/auto/index.jd new file mode 100644 index 0000000..aac79ab --- /dev/null +++ b/docs/html/design/auto/index.jd @@ -0,0 +1,35 @@ +page.title=Auto +@jd:body + +<style> +.auto-img-container-cols { + position:relative; + margin-bottom:25px; + margin-top:25px; +} +.auto-img-frame-cols { + z-index:2; + position:relative; +} +.auto-img-shot-cols { + position:absolute; + top:5px; + left:2px; + z-index:1; +} +</style> + +<div class="auto-img-container-cols" style="float:right; margin:0 0 40px 40px;width:460px"> + <img class="auto-img-frame-cols" src="/auto/images/assets/00_frame.png"> + <img class="auto-img-shot-cols" src="/auto/images/assets/03_a_musict.png"> +</div> + +<p>Android Auto is <strong>coming soon</strong> and brings apps to the car, +integrating with the vehicle's input controls and display.</p> + +<p>The future design guidelines provide templates that define the user interaction model for all apps and let you hook into a standard UI with touch and voice controls. The templates meet international best practices for reducing driver distraction while still letting you customize and brand them to properly deliver your content.</p> + +<p><a href="{@docRoot}auto/index.html">Learn more about Android Auto</a>.</p> + + + diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs index 4c2aab2..885f336 100644 --- a/docs/html/design/design_toc.cs +++ b/docs/html/design/design_toc.cs @@ -5,7 +5,26 @@ <ul> <li><a href="<?cs var:toroot ?>design/get-started/creative-vision.html">Creative Vision</a></li> <li><a href="<?cs var:toroot ?>design/get-started/principles.html">Design Principles</a></li> - <li><a href="<?cs var:toroot ?>design/get-started/ui-overview.html">UI Overview</a></li> + </ul> + </li> + + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot ?>design/devices.html">Devices</a></div> + <ul> + <li><a href="<?cs var:toroot ?>design/handhelds/index.html">Phones & Tablets</a></li> + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>design/wear/index.html">Wear</a></div> + <ul> + <li><a href="<?cs var:toroot ?>design/wear/creative-vision.html">Creative Vision</a></li> + <li><a href="<?cs var:toroot ?>design/wear/principles.html">Design Principles</a></li> + <li><a href="<?cs var:toroot ?>design/wear/structure.html">App Structure</a></li> + <li><a href="<?cs var:toroot ?>design/wear/patterns.html">UI Patterns</a></li> + <li><a href="<?cs var:toroot ?>design/wear/style.html">Style</a></li> + </ul> + </li> + <li><a href="<?cs var:toroot ?>design/tv/index.html">TV</a></li> + <li><a href="<?cs var:toroot ?>design/auto/index.html">Auto</a></li> </ul> </li> diff --git a/docs/html/design/devices.jd b/docs/html/design/devices.jd new file mode 100644 index 0000000..0015d01 --- /dev/null +++ b/docs/html/design/devices.jd @@ -0,0 +1,37 @@ +page.title=Devices +page.viewport_width=970 +section.landing=true +header.hide=1 +footer.hide=1 +@jd:body + +<style> +#landing-graphic-container { + position: relative; +} + +#text-overlay { + position: absolute; + left: 0; + top: 420px; + width: 360px; + +} +#hero-image { +} +</style> + +<div id="landing-graphic-container"> + <div id="text-overlay"> + <p itemprop="description">The device-centric UI principles, overviews, and detailed guidelines + described here build on the core <a href="{@docRoot}design/get-started/principles.html">Android Design Principles</a> + to provide more specific design guidance for different form factors. + </p> + <p> + <a href="{@docRoot}design/handhelds/index.html" class="landing-page-link">Phones & Tablets</a></p> + </div> + <a id="hero-image" href="{@docRoot}design/handhelds/index.html"> + <img src="{@docRoot}design/media/device_family.png"> + </a> +</div> + diff --git a/docs/html/design/get-started/creative-vision.jd b/docs/html/design/get-started/creative-vision.jd index 1ce305a..9261c6e 100644 --- a/docs/html/design/get-started/creative-vision.jd +++ b/docs/html/design/get-started/creative-vision.jd @@ -6,10 +6,10 @@ page.title=Creative Vision <div class="vspace size-1"> </div> <p itemprop="description"> - We focused the design of Android around three overarching goals, which apply - to our core apps as well as the system at large. As you design apps to work - with Android, consider these goals: <em>Enchant me</em>, <em>Simplify my - life</em>, and <em>Make me amazing</em> + Starting with Ice Cream Sandwich, we focused the design of + Android around these three overarching goals, which apply + to our core apps as well as the system at large. + As you work with Android, consider these goals. </p> <div class="vspace size-1"> </div> diff --git a/docs/html/design/get-started/principles.jd b/docs/html/design/get-started/principles.jd index 0b7147b..73ec3a6 100644 --- a/docs/html/design/get-started/principles.jd +++ b/docs/html/design/get-started/principles.jd @@ -1,9 +1,16 @@ -page.title=Design Principles +page.title=Android Design Principles @jd:body -<p>These design principles were developed by and for the Android User Experience Team to keep users' -best interests in mind. Consider them as you apply your own creativity and design thinking. Deviate -with purpose.</p> +<p>These design principles were developed by and for the Android +User Experience Team to keep users' best interests in mind. +For Android developers and designers, they continue to +underlie the more detailed design guidelines for different +types of devices.</p> + +<p> +Consider these principles as you apply your own +creativity and design thinking. Deviate with purpose. +</p> <h2 id="enchant-me">Enchant Me</h2> diff --git a/docs/html/design/get-started/ui-overview.jd b/docs/html/design/handhelds/index.jd index 5f4c40f..882b070 100644 --- a/docs/html/design/get-started/ui-overview.jd +++ b/docs/html/design/handhelds/index.jd @@ -1,12 +1,20 @@ -page.title=UI Overview +page.title=Phones & Tablets @jd:body -<p>Android's system UI provides the framework on top of which you build your app. Important aspects -include the Home screen experience, global device navigation, and notifications.</p> -<p>Your app will play an important part in keeping the overall Android experience consistent and -enjoyable to use. At the end of this chapter we introduce the main elements for achieving this goal -in your app.</p> -<p>Read on for a quick overview of the most important aspects of the Android user interface.</p> +<p> +Android's system UI provides the framework on top of which you build your app, +whether you're designing for phones, tablets, watches, or other form factors. +Aspects of UI that are especially important for phones and tablets include +the Home screen experience, global device navigation, and notifications. +</p> + +<p> +Your app will play an important part in keeping the overall Android experience +consistent and enjoyable to use. This page introduces some of the main elements +that can help you achieve this goal. The main Android Design topics listed on +the left, after the Devices sections, provide detailed guidelines for phones +and tablets. +</p> <h2 id="home-all-apps-recents">Home, All Apps, and Recents</h2> diff --git a/docs/html/design/index.jd b/docs/html/design/index.jd index cb7dd4f..27e3169 100644 --- a/docs/html/design/index.jd +++ b/docs/html/design/index.jd @@ -13,7 +13,7 @@ footer.hide=1 #text-overlay { position: absolute; - left: 36px; + left: 0; top: 42px; width: 266px; @@ -34,5 +34,15 @@ footer.hide=1 <a id="hero-image" href="/design/get-started/creative-vision.html"> <img src="/design/media/index_landing_page.png"> </a> + +<div style="background: hsl(8, 70%, 54%); margin: 0; padding: 20px 20px 10px 20px;color: #fff; position: absolute;top: 255px;width: 179px;"> +<h2 style="color: #fff;margin:0 0 10px; font-size:18px" class="norule">L Developer Preview</h2> +<p> The next version of Android uses a design +metaphor inspired by paper and ink that provides a reassuring sense of tactility. Before it arrives for users, you can get an early +look at the new Material design. +</p> +<p><a class="white" href="{@docRoot}preview/material/index.html">Learn more about Material</a></p> +</div> + </div> diff --git a/docs/html/design/media/device_family.png b/docs/html/design/media/device_family.png Binary files differnew file mode 100644 index 0000000..7889884 --- /dev/null +++ b/docs/html/design/media/device_family.png diff --git a/docs/html/design/media/wear/1D_picker.png b/docs/html/design/media/wear/1D_picker.png Binary files differnew file mode 100644 index 0000000..46c6bf6 --- /dev/null +++ b/docs/html/design/media/wear/1D_picker.png diff --git a/docs/html/design/media/wear/2D_picker.png b/docs/html/design/media/wear/2D_picker.png Binary files differnew file mode 100644 index 0000000..82c766a --- /dev/null +++ b/docs/html/design/media/wear/2D_picker.png diff --git a/docs/html/design/media/wear/2D_picker_action.png b/docs/html/design/media/wear/2D_picker_action.png Binary files differnew file mode 100644 index 0000000..8560ef8 --- /dev/null +++ b/docs/html/design/media/wear/2D_picker_action.png diff --git a/docs/html/design/media/wear/Bluebird.png b/docs/html/design/media/wear/Bluebird.png Binary files differnew file mode 100644 index 0000000..447e643 --- /dev/null +++ b/docs/html/design/media/wear/Bluebird.png diff --git a/docs/html/design/media/wear/action_button.png b/docs/html/design/media/wear/action_button.png Binary files differnew file mode 100644 index 0000000..dfdffa3 --- /dev/null +++ b/docs/html/design/media/wear/action_button.png diff --git a/docs/html/design/media/wear/action_on_card.png b/docs/html/design/media/wear/action_on_card.png Binary files differnew file mode 100644 index 0000000..d0b0fff --- /dev/null +++ b/docs/html/design/media/wear/action_on_card.png diff --git a/docs/html/design/media/wear/assets_specifics.png b/docs/html/design/media/wear/assets_specifics.png Binary files differnew file mode 100644 index 0000000..35a3819 --- /dev/null +++ b/docs/html/design/media/wear/assets_specifics.png diff --git a/docs/html/design/media/wear/bridgednotifications.jpg b/docs/html/design/media/wear/bridgednotifications.jpg Binary files differnew file mode 100644 index 0000000..a9e57a4 --- /dev/null +++ b/docs/html/design/media/wear/bridgednotifications.jpg diff --git a/docs/html/wear/images/circle_message2.png b/docs/html/design/media/wear/circle_message2.png Binary files differindex 63b7839..63b7839 100644 --- a/docs/html/wear/images/circle_message2.png +++ b/docs/html/design/media/wear/circle_message2.png diff --git a/docs/html/design/media/wear/clear_bold_type.jpg b/docs/html/design/media/wear/clear_bold_type.jpg Binary files differnew file mode 100644 index 0000000..e4b742c --- /dev/null +++ b/docs/html/design/media/wear/clear_bold_type.jpg diff --git a/docs/html/design/media/wear/confirmation.png b/docs/html/design/media/wear/confirmation.png Binary files differnew file mode 100644 index 0000000..513b85f --- /dev/null +++ b/docs/html/design/media/wear/confirmation.png diff --git a/docs/html/design/media/wear/contextualnotification.png b/docs/html/design/media/wear/contextualnotification.png Binary files differnew file mode 100644 index 0000000..1ec7ac8 --- /dev/null +++ b/docs/html/design/media/wear/contextualnotification.png diff --git a/docs/html/design/media/wear/continue_phone.png b/docs/html/design/media/wear/continue_phone.png Binary files differnew file mode 100644 index 0000000..fed93b6 --- /dev/null +++ b/docs/html/design/media/wear/continue_phone.png diff --git a/docs/html/design/media/wear/copywrite.png b/docs/html/design/media/wear/copywrite.png Binary files differnew file mode 100644 index 0000000..78be0bd --- /dev/null +++ b/docs/html/design/media/wear/copywrite.png diff --git a/docs/html/design/media/wear/countdown.png b/docs/html/design/media/wear/countdown.png Binary files differnew file mode 100644 index 0000000..11b1504 --- /dev/null +++ b/docs/html/design/media/wear/countdown.png diff --git a/docs/html/design/media/wear/customlayout.jpg b/docs/html/design/media/wear/customlayout.jpg Binary files differnew file mode 100644 index 0000000..9573cfc --- /dev/null +++ b/docs/html/design/media/wear/customlayout.jpg diff --git a/docs/html/design/media/wear/dismiss_cards.png b/docs/html/design/media/wear/dismiss_cards.png Binary files differnew file mode 100644 index 0000000..2e2d53b --- /dev/null +++ b/docs/html/design/media/wear/dismiss_cards.png diff --git a/docs/html/design/media/wear/expandable_stacks.png b/docs/html/design/media/wear/expandable_stacks.png Binary files differnew file mode 100644 index 0000000..edc2456 --- /dev/null +++ b/docs/html/design/media/wear/expandable_stacks.png diff --git a/docs/html/wear/images/fitness-24.png b/docs/html/design/media/wear/fitness.png Binary files differindex 3cf2f3c..3cf2f3c 100644 --- a/docs/html/wear/images/fitness-24.png +++ b/docs/html/design/media/wear/fitness.png diff --git a/docs/html/design/media/wear/low_info_card.png b/docs/html/design/media/wear/low_info_card.png Binary files differnew file mode 100644 index 0000000..a3ebf16 --- /dev/null +++ b/docs/html/design/media/wear/low_info_card.png diff --git a/docs/html/design/media/wear/peek_card.png b/docs/html/design/media/wear/peek_card.png Binary files differnew file mode 100644 index 0000000..2b12297 --- /dev/null +++ b/docs/html/design/media/wear/peek_card.png diff --git a/docs/html/design/media/wear/selection_list.png b/docs/html/design/media/wear/selection_list.png Binary files differnew file mode 100644 index 0000000..dcb0745 --- /dev/null +++ b/docs/html/design/media/wear/selection_list.png diff --git a/docs/html/design/media/wear/separate_info_cards.jpg b/docs/html/design/media/wear/separate_info_cards.jpg Binary files differnew file mode 100644 index 0000000..d4cb386 --- /dev/null +++ b/docs/html/design/media/wear/separate_info_cards.jpg diff --git a/docs/html/design/media/wear/separate_info_cards_1.jpg b/docs/html/design/media/wear/separate_info_cards_1.jpg Binary files differnew file mode 100644 index 0000000..b987aea --- /dev/null +++ b/docs/html/design/media/wear/separate_info_cards_1.jpg diff --git a/docs/html/design/media/wear/separate_info_cards_2.jpg b/docs/html/design/media/wear/separate_info_cards_2.jpg Binary files differnew file mode 100644 index 0000000..1930cb8 --- /dev/null +++ b/docs/html/design/media/wear/separate_info_cards_2.jpg diff --git a/docs/html/design/media/wear/single_action_controls.jpg b/docs/html/design/media/wear/single_action_controls.jpg Binary files differnew file mode 100644 index 0000000..ef89da0 --- /dev/null +++ b/docs/html/design/media/wear/single_action_controls.jpg diff --git a/docs/html/design/media/wear/voice_commands.png b/docs/html/design/media/wear/voice_commands.png Binary files differnew file mode 100644 index 0000000..9839ed8 --- /dev/null +++ b/docs/html/design/media/wear/voice_commands.png diff --git a/docs/html/design/tv/images/apps-games-rows.png b/docs/html/design/tv/images/apps-games-rows.png Binary files differnew file mode 100644 index 0000000..1724147 --- /dev/null +++ b/docs/html/design/tv/images/apps-games-rows.png diff --git a/docs/html/design/tv/images/atv-home.png b/docs/html/design/tv/images/atv-home.png Binary files differnew file mode 100644 index 0000000..2c18827 --- /dev/null +++ b/docs/html/design/tv/images/atv-home.png diff --git a/docs/html/design/tv/images/atv.png b/docs/html/design/tv/images/atv.png Binary files differnew file mode 100644 index 0000000..cd96164 --- /dev/null +++ b/docs/html/design/tv/images/atv.png diff --git a/docs/html/design/tv/images/overscan.png b/docs/html/design/tv/images/overscan.png Binary files differnew file mode 100644 index 0000000..bf08dd8 --- /dev/null +++ b/docs/html/design/tv/images/overscan.png diff --git a/docs/html/design/tv/images/recommendations.png b/docs/html/design/tv/images/recommendations.png Binary files differnew file mode 100644 index 0000000..579b390 --- /dev/null +++ b/docs/html/design/tv/images/recommendations.png diff --git a/docs/html/design/tv/images/search.png b/docs/html/design/tv/images/search.png Binary files differnew file mode 100644 index 0000000..be0d778 --- /dev/null +++ b/docs/html/design/tv/images/search.png diff --git a/docs/html/design/tv/images/settings.png b/docs/html/design/tv/images/settings.png Binary files differnew file mode 100644 index 0000000..f9f45fa --- /dev/null +++ b/docs/html/design/tv/images/settings.png diff --git a/docs/html/design/tv/index.jd b/docs/html/design/tv/index.jd new file mode 100644 index 0000000..5534724 --- /dev/null +++ b/docs/html/design/tv/index.jd @@ -0,0 +1,15 @@ +page.title=TV +@jd:body + + +<img src="{@docRoot}preview/tv/design/images/atv-home.jpg" + width="460" height="283" style="float:right;margin:0 0 40px 40px" /> + + +<p>Android TV is <strong>coming soon</strong> and lets you engage your users in a new, shared environment.</p> + +<p>Users bring a specific set of expectations to the experience of watching TV, versus interacting +with a phone or tablet. So find out how to get your app ready for its big-screen debut +later this year by reading the +<a href="{@docRoot}preview/tv/design/index.html">Android TV Design Guide</a> +in the L Developer Preview.</p>
\ No newline at end of file diff --git a/docs/html/design/tv/patterns.jd b/docs/html/design/tv/patterns.jd new file mode 100644 index 0000000..c8cc0b0 --- /dev/null +++ b/docs/html/design/tv/patterns.jd @@ -0,0 +1,100 @@ +page.title=Patterns for TV +page.tags="design" +@jd:body + +<p>As a developer of apps for TV, you should follow certain patterns to enable users to + quickly understand and efficiently your app. This section describes recommended design patterns + for TV apps.</p> + +<h2>Navigation</h2> + +<p>Users typically navigate TV devices using a directional pad (D-Pad). This type of controller + limits movement to up, down, left, and right. In a typical D-Pad remote, hardware keys that + correspond to those directions are present and an additional action key is available to make a + selection. As you design your Android application for TVs, pay special attention to how users + navigate your application when using a remote control instead of a touchscreen.</p> + +<p>[add visual: D-Pad image or illustration]</p> + +<p>A key aspect of making your application work well with a D-Pad controller is to make sure + that there is always a object that is obviously in focus. If a user cannot see what is in focus, + they will not be able to navigate your app intuitively with this type of controller.</p> + +<p>Optimize your app screen layouts for D-Pad navigation. Align objects in your app lists and + grids to make navigation within each screen intuitive. Design your layout so it takes advantage of + two-axis navigation.</p> + + +<h2>Home and Back Buttons</h2> + +<p> + In addition to the D-Pad buttons, Android TV devices always include Home and Back buttons on their + controllers. Make sure the Back button functions within your app in a way that is consistent with + the general <a href="{@docRoot}design/patterns/navigation.html">Android Design guidelines</a>. +</p> + + +<h2>Focus and Selection</h2> + +<p>Providing good focus and selection indicators is key to making your app useable on TV. As + mentioned previously, making sure that an object is always selected in your app is critical for + effective navigation using a D-Pad. This requirement also means that you must use focus indicators + that are easy to recognize and should be consistent throughout your app.</p> + +<p> + [add visual of selected item on screen] +</p> + +<p>The default focus indicator used in Android TV use a combination of scale, shadow, + brightness, and opacity. The focus feedback is enhanced by displaying an animation going from a + non-focused to a focused state and back. Instead of immediately applying the focus transformation, + it is animated into place to reduce abrupt changes and help users notice how the object changed.</p> + +<h2>Audio Feedback</h2> + +<p>Sounds on Android TV bring a cinematic quality to the interaction experience. You should + consider adding sounds for user actions or to provide feedback when a user is only partially + visually engaged with the screen (e.g., because they have their hands full or are multitasking). + You should also consider using sounds as alternatives to error messages, for example to indicate + that a user has reached the end of a list or is trying to navigate to an undefined location.</p> + +<h2>Banners</h2> + +<p> + App Banners represent your app on the home screen of TV devices and serves and as a way for + users to launch your app. Here are specific requirements for the banner image: +</p> + +<ul> + <li>Size: 320 x 180 px, xhdpi resource</li> + <li>Text should be included in the image. If your app is available in more than one + language, you must provide version of the banner image for each supported language.</li> +</ul> + + +<h2>App Icons</h2> + +<p>The app icon is shown in recommendation cards on the Home screen, search results and the main + Browse screen of your app if you use {@code BrowseFragment}. Here are the specific + requirements for the app icon:</p> + +<ul> + <li><p>Full color: size: 52x52dp, PNG</p></li> + <li><p>Monocolor: size 52x52dp, white(#fff) icon with transparent background, PNG</p></li> +</ul> + + +<h2>Background Images</h2> + +<p>Background images are displayed in the background of your app to provide additional visual + interest, information or branding. The BrowseFragment and DetailsFragment classes in the Leanback + support library provide specific support for background images and updating them as items are + brought into and out of focus. Here are the specific requirements for background images:</p> + +<ul> + <li>2016x1134 (1920x1080 + 5% extra margin for motion)</li> +</ul> + +<p> + <strong>Note:</strong> If the image does not meet this requirement, it is scaled to fit. +</p>
\ No newline at end of file diff --git a/docs/html/design/tv/principles.jd b/docs/html/design/tv/principles.jd new file mode 100644 index 0000000..5c0ce10 --- /dev/null +++ b/docs/html/design/tv/principles.jd @@ -0,0 +1,45 @@ +page.title=Design Principles for TV +@jd:body + +<p>Users bring a specific set of expectations to the experience of watching TV, versus + interacting with a phone or tablet. These principles have been developed by the Android User + Experience Team to guide creation of the Android TV platform and the apps that run on it.</p> + +<h2>Casual Consumption</h2> + +<p>The TV is an entertainment interface, not a computer or mobile device. Optimize for + activities that put content at the center: from the casual posture of movie-watching, to + edge-of-seat, immersive gameplay, to hanging out with friends in a living room.</p> + +<p>Users expect immediate access to to content when they turn on a TV. Get users into the action + fast, be it the big game, their favorite show, or a game with friends. The next piece of content + to watch or play should only be a click or two away.</p> + +<p> + [add a visual] +</p> + + +<h2>Cinematic Experience</h2> + +<p>Create immersive experiences for the user. Design for as little user interface and as much + content as possible on each screen. Use visual imagery, movement and sound to inform and delight + users. Avoid using on-screen text to convey information and purpose. Tell your story with pictures + and sound.</p> + +<p> + [add a visual] +</p> + + +<h2>Simplicity</h2> + +<p>An Android TV should be simple and magical. It’s all about finding and enjoying content and + apps with the least amount of friction. Minimize the number of navigation steps required to + perform actions. Build apps with the fewest screens possible between app entry and content + immersion. Avoid making users enter text whenever possible, and use voice interfaces when you + require text input.</p> + +<p> + [add a visual] +</p> diff --git a/docs/html/design/tv/style.jd b/docs/html/design/tv/style.jd new file mode 100644 index 0000000..479ed91 --- /dev/null +++ b/docs/html/design/tv/style.jd @@ -0,0 +1,108 @@ +page.title=Style for TV +page.tags="design" +@jd:body + + +<p>Follow these style guidelines to create beautiful, functional apps for TV.</p> + + +<h2>Layouts</h2> + +<p>The difference between a TV experience that feels right and one that does not greatly depends + on the number, spacing and size of on-screen elements. Although TV sizes and resolutions have + steadily increased over time, users expect TV experiences to be relatively simple and + uncluttered.</p> + +<p>The additional resolution and screen area afforded by modern displays is best used to display + things at better quality, rather than greater quantity. For example, use your layouts to show + large, beautiful pieces of content, or resize type for both easy reading and generous spacing.</p> + +<p>If you are creating an app for browsing and playing content, use the prebuilt fragments in the + Leanback support library. These layouts have been built specifically for use on TV devices with + the guidance of the Android User Experience team. For more information on using these classes, + see the <a href="{@docRoot}preview/tv/build-ui/index.html">User Interfaces</a> guide. +</p> + +<p>Here are some additional recommendations for creating functional and attractive layout for TV + apps:</p> + +<ul> + <li><p>Build layouts designed for landscape orientation. TV screens always use in this + orientation.</p></li> + <li><p>Put on-screen navigational controls on the left or right side of the screen and + save the vertical space for content.</p></li> + <li><p>Create UIs that are divided into sections, by using Fragments and use view groups + like GridView instead of ListView to make better use of the horizontal screen space.</p></li> + <li><p>Add sufficient margins between layout controls to avoid a cluttered interface.</p></li> +</ul> + + +<h3>Screen Size</h3> + +<p>TV devices running Android are intended to operate at HD resolution (1920 x 1080 pixels) or + higher. Design your artwork assets for best viewing at this resolution.</p> + + +<h3>Overscan</h3> + +<p>During the evolution of TV technology, overscan originally described an area of TV content + outside of a safe zone that most TVs could reliably display. Even on some of today’s HDTV flat + screens, areas outside that zone may not be visible.</p> + +<img src="{@docRoot}design/tv/images/overscan.png" alt="image alt text" /> + +<p>Build a 10% margin into your TV screen designs to account for overscan area the TV may not + display correctly. On a 1920 x 1080 pixel screen, this margin should be a minimum of 27px from the + top and bottom edges and a minimum of 48px from the right and left edges of the picture.</p> + + +<h2>Color</h2> + +<p>Color rendering on televisions can be imprecise compared to computer monitors or mobile + devices. LCD and Plasma TVs often apply smoothing and sharpening filters, and color rendering may + not match what you see on a computer screen.</p> + +<p>Subtle hue or brightness differences between elements may disappear or be over-emphasized on + TV screens. Some color gradient combinations will show bands. You should avoid pure whites and + highly saturated colors in large areas of the screen (especially reds, greens and blues). You + should also avoid using very dark or muddy colors, as TV settings may display these colors with + exaggerated contrast, causing them to be indistinguishable.</p> + + +<h2>Typography</h2> + +<p>The text and controls in a TV application's UI should be easily visible and navigable from a + distance. The minimum recommended font size for TV is 12sp. The default text size setting should + be 18sp. We recommend the following guidelines for TV apps:</p> + +<ul> + <li>Browse Titles: Regular 44sp</li> + <li>Browse Menu Category Text: 20sp at 50% transparency</li> + <li>Browse Focused Menu Category Text: 24sp with no transparency</li> + <li>Row Category Titles focused: 20sp with no transparency</li> + <li>Row Category Titles focused: 20sp at 50% transparency</li> + <li>Details Content Titles: 34sp</li> + <li>Details Subtext: 14sp</li> +</ul> + +<p>[visual showing text on a TV screen (sidebar position)]</p> + +<p>Some TVs have strong sharpness and contrast settings as their defaults. These picture + settings make thin and light typefaces look jagged and make the text difficult for people to read. + Therefore you should avoid thin or light typefaces on TV.</p> + +<h2>Text</h2> + +<p>Use text in TV apps sparingly. The position of users relative to a TV screen + (typically about 10 away) makes it harder for users to read text and the expectation of users in a + TV environment not conducive to reading. Follow these tips for the best handling of text in your + app:</p> + +<ul> + <li>Break text into small chunks that users can quickly scan.</li> + <li>Use light text on a dark background. This style is easier to read on a TV.</li> + <li>Avoid lightweight fonts or fonts that have both very narrow and very broad + strokes. Use simple sans-serif fonts and use anti-aliasing to increase readability.</li> + <li>Use layout-relative sizing rather than absolute sizing and density-independent + pixel units instead of absolute pixel units.</li> +</ul>
\ No newline at end of file diff --git a/docs/html/design/tv/ui-overview.jd b/docs/html/design/tv/ui-overview.jd new file mode 100644 index 0000000..c58c9cd --- /dev/null +++ b/docs/html/design/tv/ui-overview.jd @@ -0,0 +1,63 @@ +page.title=UI Overview for TV +page.tags="design" +@jd:body + +<p>The Android TV system user interface provides the launch pad for your app's big screen + experience. It's important to understand how your app is presented in the main user interface and + how your app can help users get to the content they want quickly, including contributing content + suggestions to the recommendations row.</p> + +<p>This section provides quick overview of the Android TV user interface.</p> + + +<h2>Home Screen</h2> + +<p>The Home Screen is the start of a TV user's experience, providing search, content + recommendations, access to apps and settings. The Home Screen provides a rich and cinematic + overview of apps and content.</p> + +<img src="{@docRoot}design/tv/images/atv-home.png" alt="TV Home screen" /> + + +<h2>Search</h2> + +<p>By bringing the power of Google search to the big screen, Android TV makes new, dynamic + connections between content - a favorite movie may connect to the discovery of a new music artist, + planning trip to Paris might surface new YouTube content and photos.</p> + +<img src="{@docRoot}design/tv/images/search.png" alt="Recommendations Row" /> + + +<h2>Recommendations</h2> + +<p>The recommendation row on Android TV is a central feature of the Home Screen that allows + users quick access to dynamic and relevant content for their media consumption activities. The + stream is optimized for quick browsing of personalized content and activity resumption (on the + device and across devices), while also providing a way for users to act on meaningful new content.</p> + +<img src="{@docRoot}design/tv/images/recommendations.png" alt="Recommendations Row" /> + +<p> + The recommendations are based on the user’s recent and frequent usage behaviors, as well as + expressed content preferences. They are presented as cards that represent a system or app action, + notification, activity, or piece of actionable media. Your app can provide suggestions for the + recommendations row to help get your content noticed. To learn more, see + <a href="{@docRoot}preview/tv/build-ui/recommendations.html">Recommendations</a>. +</p> + + +<h2>Apps and Games</h2> + +<p>Apps and Games rows both have special areas on the Home Screen. Within these respective + areas, Apps and Games titles are reordered to reflect the user’s recent usage.</p> + +<img src="{@docRoot}design/tv/images/apps-games-rows.png" alt="Apps and Games Rows" /> + + +<h2>Settings</h2> + +<p>Access to Settings is found at the bottom of the Home Screen. From here, the user can access + Android and device-specific settings. Please see the "Settings" section for more detailed + information.</p> + +<img src="{@docRoot}design/tv/images/settings.png" alt="Settings Row" /> diff --git a/docs/html/design/wear/creative-vision.jd b/docs/html/design/wear/creative-vision.jd new file mode 100644 index 0000000..4530744 --- /dev/null +++ b/docs/html/design/wear/creative-vision.jd @@ -0,0 +1,36 @@ +page.title=Creative Vision for Wear +@jd:body + + +<p>Android Wear devices provide just the right information at just the right time, +allowing users to be more connected to both the virtual world and the real world. Great Android +Wear experiences are:</p> + + +<div class="layout-content-row"> + <div class="layout-content-col span-6"> + <h4>Launched automatically</h4> + <p>Most people are used to launching apps by clicking an icon. Android Wear is different. Wearable apps are aware of the user’s context - time, location, physical activity, and so on. The apps use this information to insert cards into the stream when they become relevant. This makes Android Wear timely, relevant and very specific.</p> + </div> + <div class="layout-content-col span-6" style="margin-left:75px"> + <h4>Glanceable</h4> + <p>A classic wrist watch is designed to let you see the time in a split second and get on with what you were doing. Designing for Android Wear is no different. The less time it takes to use your software, the more time the user can be present in whatever they are doing. Android wear is fast, sharp and immediate.</p> + </div> +</div> + + +<div class="layout-content-row"> + <div class="layout-content-col span-6"> + <h4>Zero or low interaction</h4> + <p>Staying true to the strengths afforded by a smaller form factor, Android Wear focuses on simple interactions, only requiring input by the user when absolutely necessary. Most inputs are based around touch swipes or voice, and inputs requiring fine-grained finger movements are avoided. Android Wear is gestural, simple, and fast.</p> + </div> + <div class="layout-content-col span-6" style="margin-left:75px"> + <h4>All about suggest and demand</h4> + <p>Android Wear is like a great personal assistant: it knows you and your preferences, it only interrupts you when absolutely necessary, and it’s always on hand to provide a ready answer. Android Wear is helpful, respectful, and responsive.</p> + </div> +</div> + +<p>By providing a smart connection to the rest of the world while respecting the user’s attention, Android Wear feels personal and global, simple and smart, unobtrusive and ever-ready. Applications that represent these principles will feel most at home in the overall Android Wear experience.</p> + +<p>Third party apps extend Android Wear to be more specialized and helpful throughout the day. Installing apps are a way for the user to tell the Android Wear how to do that.</p> + diff --git a/docs/html/design/wear/index.jd b/docs/html/design/wear/index.jd new file mode 100644 index 0000000..3536445 --- /dev/null +++ b/docs/html/design/wear/index.jd @@ -0,0 +1,67 @@ +page.title=Wear +@jd:body + + + +<p>Designing apps for wearables powered by Android Wear +is substantially different than designing for phones or +tablets: different strengths and weaknesses, different use cases, different ergonomics. +To get started, you should understand the overall vision for the Android Wear experience, +and how apps fit into and enhance this experience.</p> + +<p>A new form factor deserves a new UI model. At a high level, the Android Wear UI consists of two +main spaces centered around the core functions of <strong>Suggest</strong> and +<strong>Demand</strong>. Your app will have an important role to play in both of these +spaces.</p> + + + +<h2 id="Stream">Suggest: The Context Stream</h2> + +<div class="framed-wear-square" style="float:right;margin:0 -22px 60px 40px"> + <img src="{@docRoot}wear/images/screens/stream.gif"> +</div> + +<p>The context stream is a vertical list of cards, each showing a useful or timely piece of information. Much like the Google Now feature on Android phones and tablets, users swipe vertically to navigate from card to card. Only one card is displayed at a time, and background photos are used to provide additional visual information. Your application can create cards and inject them into the stream when they are most likely to be useful.</p> + +<p>This UI model ensures that users don’t have to launch many different applications to check for updates; they can simply glance at their stream for a brief update on what’s important to them.</p> + +<p>Cards in the stream are more than simple notifications. They can be swiped horizontally to reveal additional pages. Further horizontal swiping may reveal buttons, allowing the user to take action on the notification. Cards can also be dismissed by swiping left to right, removing them from the stream until the next time the app has useful information to display.</p> + + + + +<h2 id="CueCard">Demand: The Cue Card</h2> + +<div class="framed-wear-square" style="float:right;margin:0 -22px 60px 40px"> + <img src="{@docRoot}wear/images/screens/cuecard.gif"> +</div> + +<p>For cases where Android Wear does not suggest an answer proactively through the context stream, the cue card allows users to speak to Google. The cue card is opened by saying, “OK Google” or by tapping on the background of the home screen. Swiping up on the cue card shows a list of suggested voice commands, which can also be tapped.</p> + +<p>At a technical level, each suggested voice command activates a specific type of intent. As a developer, you can match your applications to some of these intents so that users can complete tasks using these voice commands. Multiple applications may register for a single voice intent, and the user will have the opportunity to choose which application they prefer to use.</p> + +<p>Applications can respond to a voice command in the same way as they can respond to a tap on a regular in-stream action button: by adding or updating a stream card, or by launching a full screen application. Voice input often takes the form of a command, such as "remind me to get milk," in which case a simple confirmation animation is sufficient to display before automatically returning to the Context Stream.</p> + + +<h2 id="Other">Other UI Features</h2> + +<ul> +<li>The <strong>Home screen</strong> is the default state of the device and features: + <ul> + <li>The background, showing either content relating to the first card or a custom watch face design, depending on the watch face the user has chosen. Tapping anywhere on the background or saying "Ok Google" starts a voice query. + <li>Status indicators, showing connectivity, charging status, airplane mode, and in some watch faces a count of unread items. + <li>The top ranked card in the Context Stream, peeking up at the bottom of the screen. The amount of the peek card that appears is determined by the current watch face. + </ul> +</li> + +<li><strong>Watch faces</strong> may be chosen by the user to appear in the background of the Home screen. Watch faces display the time and accommodate the top ranked peek card. The user can choose a different watch face by long pressing on the current one.</li> + +<li>Some devices may enter a low-power <strong>Ambient Mode</strong> when not being used. This usually involves dimming the screen in some way. The contents of a peek card will automatically be optimized for display in this state. Users can exit ambient mode by tapping on the screen, by tilting the screen towards them, or by pressing a hardware button if one exists.</li> + +<li>Swiping down on the Home screen reveals the <strong>Date and Battery</strong> display. Dragging further down toggles <strong>Mute mode</strong>, preventing interruptive notifications from vibrating and illuminating the screen.</li> + +<li>The <strong>Settings screen</strong> can be invoked from the cue card or on some devices using a hardware button. From here the user may shut down or restart their device, adjust screen brightness, toggle airplane mode, and access device information.</li> + +<li><strong>Full screen apps</strong> can be launched on top of the main stream where a wider range of interaction is called for. Although not stylistically limited to the context stream pattern, apps should respect the same design principles as the rest of the system. For more information, see the <a href="{@docRoot}design/wear/structure.html">App Structure</a> guide.</li> +</ul>
\ No newline at end of file diff --git a/docs/html/design/wear/patterns.jd b/docs/html/design/wear/patterns.jd new file mode 100644 index 0000000..8f4698c --- /dev/null +++ b/docs/html/design/wear/patterns.jd @@ -0,0 +1,150 @@ +page.title=UI Patterns for Wear +@jd:body + + + +<p>Android Wear is used for micro-interactions, and so adhering to consistent design patterns that users are already accustomed to is paramount.</p> + +<h2>Cards</h2> + +<p>Cards in the stream can take slightly different forms:</p> + +<div class="framed-wear-square-small" style="float:left;margin:0 20px 20px 0"> + <img src="{@docRoot}design/media/wear/Bluebird.png"> +</div> + +<div class="framed-wear-square-small" style="float:left;margin:0 20px 20px 0"> + <img src="{@docRoot}design/media/wear/single_action_controls.jpg"> +</div> + +<div class="framed-wear-square-small" style="float:left;margin:0 20px 20px 0"> + <img src="{@docRoot}design/media/wear/expandable_stacks.png"> +</div> + +<ul style="clear:both"> +<li>Standard cards for displaying information from a notification</li> +<li>Single-action controls (such as a play/pause toggle)</li> +<li>Expandable stack of cards, for grouping a set of related notifications together</li> +</ul> + + +<h2>App icons</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 60px"> + <img src="{@docRoot}design/media/wear/clear_bold_type.jpg"> +</div> + +<p>App icons appear in a fixed position overhanging the edge at the top right of the card by default for all notifications in the Context Stream. This is an opportunity for cards to be recognized as coming from a specific source. Photo backgrounds should be used only to convey information, not to brand a card. App icons are necessary only on the leftmost card; it is not necessary to add the app icon to pages.</p> + +<h2 style="clear:both">Pages</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/separate_info_cards_2.jpg"> +</div> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/separate_info_cards_1.jpg"> +</div> + +<p>Supplementary information should be displayed on additional cards to the right of a main Context Stream card. In most cases one additional detail card should be sufficient. For example, a weather card might show the weather for the current location today, with subsequent days listed in an additional card to the right. Keep the number of detail cards as low as possible. Actions (see below) should always come after pages; don’t change the order or interleave them.</p> + + +<h2 style="clear:both">Dismissing cards</h2> + + <img src="{@docRoot}design/media/wear/dismiss_cards.png" height="147"> + +<p>Swiping from left to right on a card causes it to be dismissed from the stream. Dismissed cards may return when they next have relevant information. State is synced between the Android Wear context stream and the notifications on the Android handheld device, so dismissing from one causes an automatic dismissal from the other.</p> + + + +<h2 style="clear:both">Action buttons</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/action_button.png"> +</div> + +<p>Where the user may need to take action on the information shown in a notification, you can provide action buttons. These are system-rendered buttons that appear to the right of detail cards. They consist of a white icon set on a blue system-rendered circular button and a short caption with a verb. Actions should be limited to three for a single card row.</p> + +<p>Tapping on an action button can cause an action to be executed; or an action to be continued on the companion handheld; or a full screen activity to be invoked for further input (see “2D Picker” section below).</p> + +<p>Refer to the UI Toolkit provided in the Downloads section for detailed specs regarding action icons.</p> + + +<h2 style="clear:both">Action countdown and confirmation</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/countdown.png"> +</div> + +<p>Where tapping on an action button results in an action being executed, one of the following can happen:</p> + +<ol> +<li>The action is completed immediately and the result of the action is shown (either by updating the relevant card contents immediately, or by showing a confirmation animation).</li> +<li>A short countdown animation to completing the action is played, which the user can interrupt to cancel. Once the timer has counted down, a confirmation animation is played. This animation can be custom-designed by developers.</li> +<li>A confirmation step is required. This is for actions that are potentially damaging if accidentally triggered. A generic confirmation template is supplied by the system. Once the user confirms, the standard confirmation animation is played.</li> +<li>The cue card can be invoked to continue specifying the action. For example in a messaging application, tapping a “Reply” action button invokes the Cue Card and prompts for voice input. In this case the prompt label (such as “Speak your message…”) and a set of sample voice suggestions can be specified by developers.</li> +</ol> + + +<h2 style="clear:both">Continuing activities on phone</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/continue_phone.png"> +</div> + +<p>Developers should attempt to perform actions on the wearable device wherever possible. In cases where the phone must be used, a generic animation should be played once the action button has been tapped and the corresponding Android app will open on the phone.</p> + + +<h2 style="clear:both">Actions on cards (such as media controls)</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/action_on_card.png"> +</div> + +<p>Some cards may benefit from having tappable actions directly on a card. Some guidance on when to use this pattern versus using an action button:</p> + +<ul> +<li>This pattern should be used when only one possible action could be reasonably expected. For example, tapping on an address with a car icon and ETA seems like it would very obviously launch directions. Conversely, if you see a contact's photo and name, it's not clear what tapping would do (call them? email them?), so the pattern shouldn't be used in this case.</li> +<li>On-card actions should not require a text label to be understood.</li> +<li>On-card actions should only result in something happening on the wearable (apart from web links to open them on the phone).</li> +<li>Only one action per card: no menus on a single card.</li> +</ul> + +<p>Good examples of using an action on card include: play / pause music; toggle light switch on and off; navigate to an address; call a phone number.</p> + + +<h2 style="clear:both">Card stacks</h2> +<img src="/wear/images/11_bundles_B.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" alt=""> +<img src="/wear/images/11_bundles_A.png" height="200" width="169" style="float:right;margin:0 0 20px 40px" alt=""> +<p>Card stacks group related cards together and allow them to be progressively expanded vertically in the stream. A tap on a stack fans the cards out so that the top edge of each card can be seen. A subsequent tap on a fanned card reveals that card fully. Stacks of cards revert to a fully collapsed state once the user has swiped away from them.</p> + + + +<h2 style="clear:both">2D Picker</h2> + +<p>A 2D Picker component in your app can be invoked from the cue card or from an action button. It allows users to choose from a list of items, and optionally select an attribute of each item. For example, in response to a voice action to “buy tickets to a movie tonight,” you could show a 2D Picker with a vertical list of movies playing, with each movie having a horizontal list of showtimes.</p> + +<img src="{@docRoot}design/media/wear/2D_picker_action.png" width="500" alt=""> + +<p>In some instances, further information may be required. In these cases, the most probable default values for these choices should be chosen on the user’s behalf with the option to edit before completing the action. This pattern is in keeping with Android Wear’s core design principle of minimizing interactions required.</p> + + +<h2 style="clear:both">Voice commands</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/voice_commands.png"> +</div> + +<p>It is possible for apps to take action in response to Android voice commands that invoke intents. For example, an app can register for the “Take a note” intent and capture the subsequent voice input for processing. In the case where multiple apps registered for the same intent, user preference will be captured once and saved. Users can edit their intent preferences in the Android Wear app on their handheld.</p> + + +<h2 style="clear:both">Selection List</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 20px 40px"> + <img src="{@docRoot}design/media/wear/selection_list.png"> +</div> + +<p>Choosing an item from a list is a common interaction. The Selection List pattern (available as the WearableListView component) creates a simple list optimized for ease of use on a small screen: the focused item snaps to the center of the screen, and a single tap selects. This widget is recommended as a common pattern for selecting items. It is used throughout the system UI, including in the list that can be accessed by swiping up on the cue card.</p> + + +<p>Of course, it is possible for Android Wear apps to extend themselves beyond the familiarities of these patterns. For a deeper look at the options available, see the section on App Structure.</p> diff --git a/docs/html/design/wear/principles.jd b/docs/html/design/wear/principles.jd new file mode 100644 index 0000000..a214435 --- /dev/null +++ b/docs/html/design/wear/principles.jd @@ -0,0 +1,52 @@ +page.title=Design Principles for Wear +@jd:body + +<style> +p.try { + background:#e4e4e4; + padding:10px; +} +</style> + +<p>These design principles provide some simple heuristics about how you should plan and assess your +Android Wear app design.</p> + + +<h2>Focus on not stopping the user and all else will follow</h2> +<p>A watch is a perfect form factor for a device that you can use while doing something else, such as cooking, eating, walking, running, or even having a conversation. If using your wearable app causes the user to stop whatever they’re doing, it’s a good occasion to consider how to improve it using the principles in this section.</p> + +<p class="try"><strong>Try this:</strong> Time a typical use of your Wear app. If using it takes more than 5 seconds, you should think about making your app more focused. Also try using your app while you’re having a conversation, and see how it affects your train of thought and eye contact.</p> + + +<h2>Design for big gestures</h2> + +<p>When you swipe through photos on your phone you’re using a large area of the display, and you don’t have to be precise at all. That’s the best kind of interaction for a wearable device. Your users are going to use your app in all sorts of situations, the least frequent one might actually be sitting down at their desk.</p> + +<p class="try"><strong>Try this:</strong> Use your app in various everyday situations, such as walking, eating, talking to people, or ordering coffee. If you have to slow down while walking or stop the conversation to be precise, you should consider how your gestures could be bigger.</p> + +<h2>Think about stream cards first</h2> +<p>The best experience on a wearable device is when the right content is there just when the user needs it. You can figure out when to show your cards with sensors, or events happening in the cloud. For the cases where it’s impossible to know when the user needs your app, you can rely on a voice action or touch.</p> + +<p class="try"><strong>Try this:</strong> Make a list of all the situations a user would find your app useful. What do they have in common? Same location? Time of day? Certain physical activities? You will most likely come up with several different situations - that’s a good sign, because it means that you can specialize your cards to those situations. Remember that the user always has the option of completely muting your stream cards if they feel they aren’t relevant enough.</p> + + +<p>[image] </p> +<p class="img-caption">An app that offers to check in users could appear in the stream suggesting the most likely place nearby, after a certain amount of time.</p> + + +<h2>Do one thing, really fast</h2> +<p>While users will engage with your app for only a few seconds at time, they'll use it many times throughout the day. A well-designed stream card carries one bit of information and potentially offers a few action buttons when the user swipes over.</p> + +<p class="try"><strong>Try this:</strong> How many bits of information is there in your design? Is everything absolutely necessary, or could you split it up into separate cards? If you’re designing a card, don’t forget that you can use multiple pages.</p> + + +<h2>Design for the corner of the eye</h2> +<p>The longer the user is looking at your app, the more you are pulling them out of the real world. Thinking about how to design your app for glanceability can vastly help the user get full value from your app and quickly go back to what they were doing.</p> + +<p class="try"><strong>Try this:</strong> To view your app with your peripheral vision, try focusing on your knuckles while your watch is displaying the app. Do you get a sense of what it is trying to do? Is it distinguishable from other apps? Does the background image help conveying the message? Does it use photos or a distinct shape and color?</p> + +<h2> +Don’t be a constant shoulder tapper</h2> +<p>A watch constantly touches the user’s skin. Being this intimate, you want to buzz the watch fewer times than you’re used to on the phone.</p> + +<p class="try"><strong>Try this:</strong> Next time you’re in a conversation, imagine someone tapping you your shoulder, interrupting you with the information you want your app to deliver. If the information delivered did not justify suspending a conversation, you should not make the notification interruptive.</p>
\ No newline at end of file diff --git a/docs/html/design/wear/structure.jd b/docs/html/design/wear/structure.jd new file mode 100644 index 0000000..caeb119 --- /dev/null +++ b/docs/html/design/wear/structure.jd @@ -0,0 +1,116 @@ +page.title=App Structure for Wear +@jd:body + + +<p>As outlined in the <a href="{@docRoot}design/wear/creative-vision.html">Creative Vision</a>, +Android Wear apps do not adhere to the traditional mobile app model of touching an icon to launch into a self-contained experience. Rather, it is useful to think about the different spaces in the Android Wear UI and how your app might present itself across these spaces. For example, a typical app might begin by showing a notification card in the stream at a contextually relevant moment, then jump into a custom full screen UI for a micro-interaction, or maybe open the cue card to capture voice input that is then relayed back to the in-stream card.</p> + +<p>It’s important to make some fundamental decisions about how your users will interact with your app. There are a number of ways that functionality can manifest itself in Android Wear, and it is important to choose the places that provide maximum value and ease of use.</p> + +<p>For example, application functionality might show up in the following ways:</p> + +<ul> + <li>As a <strong>card in the main context stream</strong>: + <ul> + <li><strong>Bridged notifications</strong> are pushed to the wearable from the connected handheld (a phone or tablet) using the standard Android notifications framework. In general, bridged notifications mirror what’s happening on the handheld and use one of a predefined layout templates. Example: new message notification. + <li><strong>Contextual notifications</strong> are like smart notifications. They are generated locally on the wearable and appear at contextually relevant moments specificed by the app developer. Contextual notifications allow more freedom of control, allowing for custom layouts and dynamic updating of card contents. Example: live updating exercise stats. + </ul> + </li> + <li>As a <strong>full screen UI</strong> that temporarily overlays on top of the context stream: + <ul> + <li>The <strong>2D Picker</strong> is a simple design pattern (available in the SDK as a prebuilt component) aimed at asking the user to select from a set of items. This is a common interaction and a familiar pattern, so use of the familiar 2D Picker pattern is encouraged wherever possible. Example: choose from a set of artists and albums to play. + <li><strong>Custom layouts</strong> are also possible where apps need to extend beyond the basic card/stream metaphor. These apps should be distinctly separate from the core user experience in both appearance and interaction.</li> + </ul> + </li> +</ul> + + +<p>Apps can also open the cue card to capture voice input.</p> + +<p>Note that the different approaches above are listed in order of complexity. When designing your interactions, try to achieve them with the simplest approach possible. If your needs are more involved, move to the next level of complexity.</p> + +<p>Many applications will consist of a combination of these views, possibly with connections between them. For example, a contextual card may have an action that launches a more immersive experience. Inversely, an immersive experience may result in a card being added to the stream.</p> + +<p>Think of these different components as building blocks that can be snapped together into a single user flow. Avoid single monolithic full screen UIs that need to be launched and quit. Place simple notifications and ongoing information in the stream, and jump in and out of simple full screen activities to complete quick tasks before returning to the stream.</p> + +<p>In this section we will look at these different approaches and how combine them to create the best experience for your users.</p> + + +<h2 id="Bridged">Bridged Notifications</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 -22px 60px 40px"> + <img src="{@docRoot}design/media/wear/bridgednotifications.jpg"> +</div> + +<p>Bridged notifications are the simplest way of having content appear on an Android wearable. Since cards in the Android Wear stream are synced from the notifications on your connected handheld, any notifications created there automatically appear on Android Wear. Where appropriate, make sure to use the new APIs in the support library that enhance your app's notifications with features such as voice replies and notification pages.</p> + + + +<h2 id="Contextual">Contextual Notifications</h2> + +<p>Displaying information on contextual cards is at the core of the Android Wear user experience. Cards with focused trigger criteria appear at just the right time, delighting and assisting the user with timely, useful content. Refer to the Design principles section for details on how to think about triggering cards, and the UI overview section for a breakdown of the familiar system UI components that make up an entry in the context stream.</p> + +<p>An important aspect of creating contextual notifications is defining trigger conditions: what is the specific scenario in which your notification should appear? Think about using all sensor information available to you -- time, location, movement, identity, user habits and patterns, interaction with nearby devices, and more -- and describe the specific combination of sensor readings that should result in your app presenting itself.</p> + + +<img src="{@docRoot}design/media/wear/contextualnotification.png" width="500" alt="" /> + + +<p>For example, imagine you were building a running app. If the user is standing at the beginning of their regular running trail, at the time that they often go for a run, and we detect a running activity... they are probably going for a run! This would be a great time to present a contextual card that offers to track their run.</p> + +<p>Putting effort into getting your contextual triggering just right is one of the most impactful things you can do to create a delightful experience for your users.</p> + +<p>You may use the standard Android notifications framework to create cards using a range of provided templates, or draw your own ActivityView inside cards for a custom card layout. Make sure to refer to the Style section to make sure your custom ActivityView layouts are sympathetic to the overall design of cards in the stream. Use ActivityViews to create custom card layouts that are stylistically consistent with neighboring cards in the stream; do not invent entirely new or conflicting UI patterns inside cards.</p> + +<p>Contextual cards are ideal for situations where it may be useful to push information to the user, when the information may be useful on an ongoing basis or referred back to, or when context strongly indicates that the information is useful. Refer to the section on Respecting Users Attention in the Design Principles section for details on targeted triggering. Triggering too often or in unsuitable contexts will result in users being annoyed by your app.</p> + + + +<h2 id="Picker">2D Picker</h2> + +<p>The 2D Picker design pattern (available as the GridViewPager component) is useful for showing a range of options or asking a user to make a quick selection. Google search results on Android Wear are a great example of the GridViewPager pattern in action.</p> + +<p>A 2D Picker is called up as an overlay on the main UI by tapping a card or button, or through a voice action. It preserves the same look and feel as the main context stream, giving users a familiar and predictable set of interaction patterns to rely on.</p> + +<p>On Android Wear, the basic hierarchy is vertical-then-horizontal, never horizontal-then-vertical, with a recommended vertical limit of five cards. Each vertical slot may consist of one card, as in the Google results case, or multiple cards which may be swiped horizontally.</p> + +<img src="{@docRoot}design/media/wear/1D_picker.png" alt="" width="499px" /> +<p class="img-caption">This pattern can be used to present a single vertical list, or a “1D Picker”</p> + +<img src="{@docRoot}design/media/wear/2D_picker.png" alt="" width:760px" /> +<p class="img-caption">It can also be used as a 2D matrix of options, as a way of presenting categorized options.</p> + +<p>This flexibility means that developers can choose to present a one or two-dimensional set of options. For example, a music app could use a vertical list to present a list of albums by a given artist (one dimension of options), and it could additionally allow each album slot to be horizontally swipeable to also choose a song from each album (a second dimension of options).</p> + +<p>Do not add buttons or pages to horizontal 2D Picker rows; rows should only be used to present a list or grid of similar options in this context. Provide a clear call to action on the card using the Action cards pattern detailed in the <a href="{@docRoot}design/wear/patterns.html">UI Patterns</a> guide.</p> + +<p>2D Picker should be automatically dismissed when a selection is made. It may also be exited by swiping back down on the first card, or by swiping left to right on a leftmost card.</p> + +<p>The simplicity of individual cards within a 2D Picker is a feature. Remember that in many cases the user may be on the go or attempting to complete a task as quickly as possible. As such, micro-interactions and familiar input mechanism are paramount, and using the already-familiar pattern of vertically-then-horizontally oriented cards gives users exactly what they want with as little fuss as possible. Strive to minimize the number of results or options that you present. Show the most popular or repeatedly-used options at the top of the list of cards to avoid scrolling. Learn the user's preferences and use context detection to put the most likely option for any given situation at the top. In general, optimize for fast task completion over excessive customization.</p> + + + +<h2 id="Custom">Custom Layouts</h2> + +<p>Some interactions may require a broader range of input mechanisms than is possible within the limitations of a card-based UI. For example, an app that allows for location selection may require the user to swipe in many directions before tapping to drop a pin. In cases like this, it is recommended to momentarily launch out of the context stream UI and present an immersive, full screen app with a custom layout.</p> + +<p>Custom full screen apps provides the benefit of flexibility: you can launch your own Android activity that takes up the entire screen, and capture all touch events, making a wide range of UIs possible.</p> + +<img src="{@docRoot}design/media/wear/customlayout.jpg" alt="" width="760px" /> + + +<p>However, be cautious of making this the default way of accessing your app’s functionality. Users will thank you for presenting your content in the familiar, simple environment of the context stream if it is possible to do so. Only enter full screen mode when the interactions required are not possible using the card UI. Full screen is a modal state to be entered for the purpose of achieving a specific task, and in most cases should be easily and quickly exited. You should use full screen apps to achieve a single, quick task within a broader user flow that hinges off the Context Stream. A great full screen experience will present itself quickly, ask for some user input, and then self-quit back to the stream.</p> + +<p>To avoid confusion, avoid using the specific styles and idioms of the context stream when designing immersive experiences. If you find yourself replicating the structure of the card layout, your should probably be using a 2D Picker. Make your immersive experience visually distinct. However, still adhere to the <a href="{@docRoot}design/wear/principles.html">Design Principles</a>, which apply universally to Android Wear interfaces.</p> + +<p>Because Android wearables do not feature a home or back button, exiting the application at the appropriate time is the responsibility of the app developer. Exiting always leads back to the context stream. Where possible, exit automatically or present the option to exit at logical break points using acknowledge/cancel buttons. For example:</p> + +<ol> +<li>A map view that allows the user to slide a map to drop a pin on a location should automatically exit when the pin has been placed.</li> +<li>A short game should automatically exit back to the stream at the end of each game.</li> +<li>A drawing app should display the option to exit after 5 seconds of inactivity.</li> +</ol> + +<p>Even with logical exit points like these, some cases may exist where the user may want to immediately initiate an exit. This may be particularly common in apps of longer duration. In all cases, the developer should <strong>present the option to quit the app on long press</strong> using DismissOverlayView. Your design should long press for the sole purpose of prompting to quit.</p> + +<p>Seamlessly and fluidly moving between the context stream and immersive mode makes your app feel like an integrated part of the Android Wear experience.</p>
\ No newline at end of file diff --git a/docs/html/design/wear/style.jd b/docs/html/design/wear/style.jd new file mode 100644 index 0000000..ed39bd6 --- /dev/null +++ b/docs/html/design/wear/style.jd @@ -0,0 +1,102 @@ +page.title=Style for Wear +@jd:body + + +<p>Here are a number of design considerations to bear in mind that are particular to Android Wear.</p> + +<h2 id="ScreenSize">Screen Size</h2> + +<img src="{@docRoot}design/media/wear/circle_message2.png" height="200" + style="float:right;margin:0 0 20px 60px"> + +<img src="{@docRoot}design/media/wear/fitness.png" height="200" + style="float:right;margin:0 0 20px 60px"> + +<p>Be mindful of different device sizes and shapes. Wearable devices are a form of fashion and expression for their owners, and so Android Wear supports a variety of forms. Most of the complexities of supporting these different devices is taken care of at a system level, but bear in mind different screen types when designing custom full screen apps.</p> + +<p>Use the Android Wear emulator to test both square and round devices, and note that <code>WatchViewStub</code> is available to activities to detect whether a square or round device is being used.</p> + + + + +<h2 id="Assets" style="clear:both">Specific Assets Required</h2> + +<img src="{@docRoot}design/media/wear/assets_specifics.png" width="300" + style="float:left;margin:0 60px 20px 0"> + +<p>A core set of standard assets may need to be provided depending on your card design: app icon, background image or images, action icons, actions confirmation animation. Of course, your specific design may necessitate other assets. Background image should be provided in landscape format at least 600px width for notifications that include pages of cards, since the system automatically adds a parallaxing effect.</p> + + + +<h2 id="PeekCard" style="clear:both">Peek Card Readability</h2> + +<img src="{@docRoot}design/media/wear/peek_card.png" width="300" + style="float:left;margin:0 60px 20px 0"> + +<p>Test your card layout to ensure that useful information is conveyed in the peek state on the Home screen. The main message of the card should be readable in the peek state, particularly for contextual cards. Content that requires an interaction to be read, for example a long message, should be cropped appropriately to provide an affordance to the user to swipe the card to read more.</p> + + + +<h2 id="InfoDensity" style="clear:both">Low Information Density</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 40px 60px"> + <img src="{@docRoot}design/media/wear/low_info_card.png"> +</div> + +<p>Cards should be designed to be glanceable in a split second, just like reading the time on a traditional watch. In most cases a pairing of an icon and value, or a title and short caption should be enough to convey a meaningful message. Note that the background photo should also be used to convey information; backgrounds that change to reflect and support the primary message in the card work great. For example, in the case illustrated above a suitable background image is chosen to reflect severity of the current traffic conditions. This is not just a nice piece of attention to detail; the background actually reinforces the message and makes the content more glanceable.</p> + + +<h2 id="Chunks" style="clear:both">Separate Information into Chunks</h2> + +<img src="{@docRoot}design/media/wear/separate_info_cards.jpg" width="400" + style="float:left;margin:0 60px 20px 0"> + +<p>In cases where additional information is absolutely necessary, don’t crowd out a card layout to the point where glanceability is affected. Instead, add an additional page (or multiple pages, if needed) to the right of the main card in the stream to which the user can swipe for more information. See also “Continuing activities on phone”, below.</p> + + +<h2 id="KeepMinimum" style="clear:both">Keep Notifications to a Minimum</h2> + +<p>Don’t abuse the user’s attention. Active notifications (that is, those that cause the device to vibrate) should only be used in cases that are both timely and involve a contact, for example receiving a message from a friend. Non-urgent notifications should be silently added to the Context Stream. See also the general Android Notifications Guidelines.</p> + + +<h2 id="Typography" style="clear:both">Use Clear, Bold Typography</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 60px 40px"> + <img src="{@docRoot}design/media/wear/clear_bold_type.jpg"> +</div> + +<p>The system font is Roboto Condensed, with Regular and Light variants. Text should adhere to the size and color recommendations (see the UI Toolkit in the Downloads section). In general, text should be displayed as large as possible. Your goal should be to convey maximum information with minimum fuss.</p> + + +<h2 id="Branding" >Use Consistent Branding and Color</h2> + +<p>The app icon is used to identify and brand your application. The icon is optional but when present always appears in the same location, overhanging the top edge of the card at the right. Note that app icons or branding should not be displayed in the background photo, which is reserved to display an image relevant to the information on the card.</p> + + +<h2 id="Copywrite" style="clear:both">Copywrite Sparingly</h2> + +<div class="framed-wear-square-small" style="float:right;margin:0 0 60px 40px"> + <img src="{@docRoot}design/media/wear/copywrite.png"> +</div> + +<p>Omit needless text. Design for glanceability, not reading. Use words and phrases, not sentences. Use icons paired with values instead of text wherever possible. Text strings should be as concise as possible, and long pieces of text will be truncated to fit on a single card.</p> + + +<h2 id="BeDiscreet" >Be Discreet if Necessary</h2> + +<p>Wearables are personal devices by nature, but they are not completely private. If your notification serves content that may be particularly sensitive or embarrassing (such as notifications from a dating app or a medical status report), consider not displaying all of the information in a peek card. A notification could place the sensitive information on a second page that must be swiped to, or an application could show different amounts of detail in peek and focused card positions.</p> + + +<h2 id="ConfirmAnim" style="clear:both">Confirmation Animations</h2> + +<div class="framed-wear-square-small" style="float:left;margin:0 40px 40px 0 "> + <img src="{@docRoot}design/media/wear/confirmation.png"> +</div> + +<p>If your app allows the user to perform an action, it is necessary to provide positive feedback. Show a generic confirmation animation or create your own. A confirmation animation is an opportunity to express your app’s character and insert a moment of delight for your user. Keep animations short (less than 1000ms) and simple. Animating the confirmation icon is an effective way of transitions the user to a new state after completing an action.</p> + + + + + + diff --git a/docs/html/distribute/essentials/essentials_toc.cs b/docs/html/distribute/essentials/essentials_toc.cs index 7084fdd..d0a1114 100644 --- a/docs/html/distribute/essentials/essentials_toc.cs +++ b/docs/html/distribute/essentials/essentials_toc.cs @@ -11,12 +11,6 @@ </div> </li> <li class="nav-section"> - <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/gpfe-guidelines.html"> - <span class="en">Education Guidelines</span> - </a> - </div> - </li> - <li class="nav-section"> <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/optimizing-your-app.html"> <span class="en">Optimize Your App</span> </a> diff --git a/docs/html/distribute/essentials/gpfe-guidelines.jd b/docs/html/distribute/essentials/gpfe-guidelines.jd deleted file mode 100644 index 734bddc..0000000 --- a/docs/html/distribute/essentials/gpfe-guidelines.jd +++ /dev/null @@ -1,509 +0,0 @@ -page.title=Education Guidelines -page.metaDescription=These guidelines and requirements help you develop great apps for students, which offer compelling content and an intuitive user experience on Android tablets. -page.image=/distribute/images/edu-guidelines.jpg -Xnonavpage=true - -@jd:body - - -<div id="qv-wrapper"><div id="qv"> -<h2>Guidelines</h2> -<ol> -<li><a href="#basic-reqts">Basic Requirements</a></li> -<li><a href="#monetizing-ads">Monetizing and Ads</a></li> -<li><a href="#e-value">Educational Value</a></li> -<li><a href="#quality">App Quality</a></li> -<li><a href="#related-resources">Related Resources</a></li> -</ol> - -<h2> - Testing -</h2> - -<ol> - <li> - <a href="#test-environment">Setting Up a Test Environment</a> - </li> -</ol> - -</div></div> - -<div style="margin:0 0 1em 0;"> - <img src="{@docRoot}distribute/images/edu-guidelines.jpg" style= - "width:274px;"> -</div> - -<p> - These guidelines and requirements help you develop great apps for students, - which offer compelling content and an intuitive user experience on Android - tablets. -</p> - -<p> - You’ll also need to ensure that your apps comply with the terms of the - <a href= - "https://play.google.com/about/developer-distribution-agreement-addendum.html"> - Google Play for Education Addendum</a>, <a href= - "http://play.google.com/about/developer-content-policy.html">Google Play - Developer Program Policies</a>, and <a href= - "http://play.google.com/about/developer-distribution-agreement.html">Developer - Distribution Agreement</a>. -</p> - -<div class="headerLine"> - <h2 id="basic-reqts"> - Basic Requirements - </h2> - - -</div> - -<p> - To participate, your apps must be designed for the K-12 market. The basic - requirements that your apps must meet are: -</p> - -<ul> - <li> - <p> - Apps and the ads they contain must not collect personally identifiable - information, other than user credentials or data required to operate and - improve the app. - </p> - </li> - - <li> - <p> - Apps must not use student data for purposes unrelated to its educational - function. - </p> - </li> - - <li> - <p> - Apps must have a content rating of "Everyone" or "Low Maturity" (apps - with a "Medium Maturity" rating are allowed, if they have that rating - solely because they allow communication between students). - </p> - </li> - - <li> - <p> - App content, including ads displayed by the app, must be consistent with - the app's maturity rating. The app must not display any "offensive" - content, as described in the <a href= - "http://play.google.com/about/developer-content-policy.html">Google Play - Developer Program Policies</a> and <a href= - "https://support.google.com/googleplay/android-developer/answer/188189">content-rating - guidelines</a>. - </p> - </li> - - <li> - <p> - Apps must comply with the Children’s Online Privacy Protection Act and - all other applicable laws and regulations. - </p> - </li> -</ul> - -<div class="headerLine"> - <h2 id="monetizing-ads"> - Monetizing and Ads - </h2> - - -</div> - -<p> - In-app purchase is currently not supported with Google Play for Education, so - a student device will block any transactions. To avoid confusion, be sure to - remove any in-app purchase buttons and related UI elements from your apps. - We’re investigating additional purchase mechanisms to enable more flexible - pricing models for developers and schools. -</p> - -<p> - If your apps are priced In Google Play for Education, you must allow Google - Play to offer teachers limited free trials before purchase (you provide this - through business terms only, no development work is needed.) -</p> - -<p> - You can only choose not to remove in-app purchasing from your apps where all - content and services are sold through Google Play for Education using In-app - Billing. If you choose not to remove In-app Billing features, ensure that: -</p> - -<ul> - <li> - <p> - Users can access your apps’ core functionality for a classroom setting - without an in-app purchase. - </p> - </li> - - <li> - <p> - In-app purchases are clearly identifiable in your UI. - </p> - </li> - - <li> - <p> - You declare the use of in-app purchases at <a href= - "{@docRoot}distribute/googleplay/edu/start.html#publish">opt-in</a>. - </p> - </li> -</ul> - -<p> - For each app that you publish, you can set a single price that applies to - both Google Play and Google Play for Education. You can’t set a different - price for a given app (based on a single package name) in Google Play for - Education. -</p> - -<p> - If your apps display ads, you should disable the display of ads if possible, - or ensure that: -</p> - -<ul> - <li>Ads are not distracting for students or teachers (this includes - Flash-based ads, video ads, and ads that flash or move) - </li> - - <li>Interstitial ads are not served in the app - </li> - - <li>Ad walls do not appear in the app UI - </li> - - <li>Ads do not occupy a significant portion of the screen - </li> - - <li>Ads content does not exceed the maturity rating of the app. - </li> - - <li> - <p> - You declare the use of ads at <a href= - "{@docRoot}distribute/googleplay/edu/start.html#publish">opt-in</a>. - </p> - </li> -</ul> - -<div class="headerLine"> - <h2 id="e-value"> - Educational Value - </h2> - - -</div> - -<div class="figure"> - <img src="{@docRoot}images/gp-e-value.png" class="border-img"> -</div> - -<p> - Apps submitted to Google Play for Education will be evaluated by a - third-party educator network, which will review them based on alignment with - <a href="http://www.corestandards.org/">Common Core Standards</a> and other - educational considerations. This will help make your content more - discoverable for teachers and administrators as they browse by grade level, - subject, core curriculum, and other parameters. -</p> - -<p> - Apps with highest educational value will have these characteristics: -</p> - -<ul> - <li> - <p> - Designed for use in K-12 classrooms. - </p> - </li> - - <li> - <p> - Aligned with a common core standard or support common-core learning. - </p> - </li> - - <li> - <p> - Simple, easy to use, and intuitive for the grade levels the apps are - targeting. Apps are relatively easy to navigate without teacher guidance. - Not distracting or overwhelming to students. - </p> - </li> - - <li> - <p> - Enjoyable and interactive. Apps are engaging to students and lets them - control their experience. - </p> - </li> - - <li> - <p> - Versatile. Apps have features that make them useful for more than one - classroom function or lesson throughout the school year. - </p> - </li> - - <li> - <p> - Supports the "4Cs": - </p> - - <ul> - <li> - <p> - <em>Creativity</em> — Allows students to create in order to - express understanding of the learning objectives, and try new - approaches, innovation, and invention to get things done. - </p> - </li> - - <li> - <p> - <em>Critical thinking</em> — Allows students to look at - problems in a new way, linking learning across subjects and - disciplines. - </p> - </li> - - <li> - <p> - <em>Collaboration</em> — Allows students and (if appropriate) - educators to work together to reach a goal. - </p> - </li> - - <li> - <p> - <em>Communication</em> — Allows students to comprehend, - critique and share thoughts, questions, ideas, and solutions. - </p> - </li> - </ul> - </li> -</ul> - -<p> - As you design and develop your apps, make sure they offer high educational - value by addressing as many of these characteristics as possible. -</p> - -<div class="headerLine"> - <h2 id="quality"> - App Quality - </h2> - - -</div> - -<div class="figure"> - <img src="{@docRoot}images/gp-edu-quality.png"> -</div> - -<p> - Your apps should be designed to perform well and look great on Android - tablets, and they should offer the best user experience possible. -</p> - -<p> - High quality apps are engaging, intuitive, and offer compelling content. - Google Play for Education will highlight high-quality apps for easy discovery - in the store. Here are some recommendations for making your app easy for - students and teachers to enjoy: -</p> - -<ul> - <li> - <p> - Meet the Core Quality Guidelines: - </p> - - <ul> - <li> - <p> - Follow <a href="{@docRoot}design/index.html">Android Design - Guidelines</a>. Pay special attention to the sections on <a href= - "{@docRoot}design/patterns/actionbar.html">Action Bar</a>, <a href= - "{@docRoot}design/patterns/navigation.html">Navigation</a>, and - <a href="{@docRoot}design/patterns/pure-android.html">Pure - Android</a>. - </p> - </li> - - <li> - <p> - Test your apps against the <a href= - "{@docRoot}distribute/essentials/quality/core.html">Core Quality - Guidelines</a>. - </p> - </li> - </ul> - </li> - - <li> - <p> - Meet the Tablet App Quality guidelines: - </p> - - <ul> - <li> - <p> - Follow our best practices for tablet app development. - </p> - </li> - - <li> - <p> - Review the <a href= - "{@docRoot}distribute/essentials/quality/tablets.html">Tablet App - Quality</a> guidelines and <a href= - "http://android-developers.blogspot.com/2012/11/designing-for-tablets-were-here-to-help.html"> - blog post on designing for tablets.</a> - </p> - - <ul> - <li>Check your Optimization Tips in the <a href= - "https://play.google.com/apps/publish/">Developer Console</a> (if - you've already uploaded your apps.) - </li> - </ul> - </li> - - <li> - <p> - Strive for simplicity and highest usability for students: - </p> - - <ul> - <li> - <p> - Design your app so that teachers and students can use all the - capabilities of your app without having to sign-in to multiple - accounts and remember multiple passwords. - </p> - </li> - - <li> - <p> - Every student or teacher using a Google Play for Education tablet - will already be signed in with a Google account on the device. - You can take advantage of that to provide a simple, seamless - sign-in experience in your app. A recommended approach is to use - <a href="{@docRoot}google/play-services/auth.html">Google OAuth 2 - authorization</a> through Google Play Services. - </p> - </li> - </ul> - </li> - </ul> - </li> -</ul> - -<div class="headerLine"> - <h2 id="test-environment"> - Test Environment - </h2> - - -</div> - -<p> - To test your app and assess it against the guidelines in this document, it's - recommended that you <a href= - "{@docRoot}distribute/essentials/quality/tablets.html#test-environment">set - up a test environment</a> that replicates the actual environment in which - students and teachers will run your app. -</p> - -<h3> - Test conditions -</h3> - -<p> - Make sure to test your apps under conditions that simulate those of schools. - For example, Google Play for Education lets administrators <a href= - "https://support.google.com/a/answer/182442?hl=en">control or disable certain - capabilities</a> for students, so it's good to test your app with those - capabilities disabled. Below are some conditions to test your apps for, to - ensure best results in the Google Play for Education environment: -</p> - -<ul> - <li> - <p> - <em>Android version</em> — Test the apps on devices running Android - 4.2. Google Play for Education devices will be running Android 4.2 or - higher (API level 17+). - </p> - </li> - - <li> - <p> - <em>Proxy server</em> — Test the apps in a network environment that - uses proxies. Many schools use proxies. - </p> - </li> - - <li> - <p> - <em>No location services</em> — Test the apps to make sure they - work properly with location services disabled. Many schools will disable - location services for student devices. - </p> - </li> - - <li> - <p> - <em>No In-app Billing</em> — Test the apps to make sure they work - properly without access to In-app Billing. In-app purchases are blocked - on Google Play for Education devices. - </p> - </li> - - <li> - <p> - <em>No Bluetooth</em> — Test the apps to make sure they work - properly when Bluetooth is disabled. Many schools will disable Bluetooth - on student devices. - </p> - </li> - - <li> - <p> - <em>No access to network</em> — Test the app to make sure it works - properly when the device cannot connect to the internet. - </p> - </li> -</ul> - -<div class="headerLine"> -<h2>Related Resources</h2> -</div> - -<div class="dynamic-grid"> -<h3>FOR DEVELOPERS</h3> - -<div class="resource-widget resource-flow-layout col-13" - data-query="collection:distribute/essentials/eduessentials/developers" - data-sortOrder="-timestamp" - data-cardSizes="6x3,6x3,6x3" - data-maxResults="6"></div> - -<h3>FOR TEACHERS AND EDUCATORS</h3> - -<div class="resource-widget resource-flow-layout col-13" - data-query="collection:distribute/essentials/eduessentials/educators" - data-sortOrder="-timestamp" - data-cardSizes="6x3,6x3,6x3" - data-maxResults="3"></div> -</div>
\ No newline at end of file diff --git a/docs/html/distribute/googleplay/edu/about.jd b/docs/html/distribute/googleplay/edu/about.jd index e73356e..60d9402 100644 --- a/docs/html/distribute/googleplay/edu/about.jd +++ b/docs/html/distribute/googleplay/edu/about.jd @@ -9,7 +9,7 @@ Xnonavpage=true <p> Google Play for Education is an extension of Google Play designed for - schools. Here educators can discover apps approved by teachers for teachers, + schools. Here educators can discover Android and Chrome apps approved by teachers for teachers, as well as educational videos and a collection of classic books for their classroom. </p> @@ -22,7 +22,7 @@ Xnonavpage=true </p> -<div class="resource-widget resource-flow-layout col-13" +<div class="resource-widget resource-flow-layout col-13" style="height:323px" data-query="collection:distribute/googleplay/gpfe/highlight" data-sortOrder="-timestamp" data-cardSizes="18x6," diff --git a/docs/html/distribute/googleplay/edu/faq.jd b/docs/html/distribute/googleplay/edu/faq.jd deleted file mode 100644 index 36e2064..0000000 --- a/docs/html/distribute/googleplay/edu/faq.jd +++ /dev/null @@ -1,433 +0,0 @@ -page.title=Education FAQ -meta.tags="gpfe, edu" -page.metaDescription=Answers to frequent questions about Google Play for Education. -page.image=/distribute/images/gpfe-faq.jpg - -@jd:body - -<div id="qv-wrapper"> - <div id="qv"> - <h2> - Topics - </h2> - - <ol> - <li> - <a href="#business-model-and-monetization">Business Model and - Monetization</a> - </li> - - <li> - <a href="#free-trials">Free Trials</a> - </li> - - <li> - <a href="#discovery">Discovery</a> - </li> - - <li> - <a href="#app-review-process">App Review Process</a> - </li> - - <li> - <a href="#app-features">App Features</a> - </li> - - <li> - <a href="#marketing-and-roi">Marketing and ROI</a> - </li> - - <li> - <a href="#devices">Devices</a> - </li> - - <li> - <a href="#accounts">Accounts</a> - </li> - - <li> - <a href="#related-resources">Related Resources</a> - </li> - </ol> - </div> -</div> - -<p> - This page provides answers to common questions that you might have about - Google Play for Education. -</p> - -<div class="headerLine"> - <h2 id="business-model-and-monetization"> - Business Model and Monetization - </h2> - - -</div> - -<p> - <strong>What is Google Play for Education?</strong> -</p> - -<p> - Google Play for Education is a new online destination designed for schools. - Teachers can discover educational apps, books, and videos to meet the needs - of a single student, a classroom, or a whole district. Educators can browse - apps by grade, subject, keyword, or standard including Common Core State - Standards. Purchasing is done using a PO with no credit card required. Apps - are distributed to tablets instantly through the cloud. -</p> - -<p> - <strong>Is Google Play for Education primarily for students or - educators?</strong> -</p> - -<p> - The store on Google Play for Education is for educators, but its content is - for both educators and students. Teachers and administrators have the ability - to make purchases and control who within their school has access to the - purchase flows. -</p> - -<div class="figure"> - <img src="{@docRoot}distribute/images/gpfe-faq.jpg" style= - "width:480px;margin:1em 0em 1.5em 1.5em;"> -</div> - -<p> - <strong>Will Google Play for Education support subscription - purchases?</strong> -</p> - -<p> - Currently, Google Play for Education supports one-time purchases. We’re - investigating additional purchase mechanisms to enable more flexible pricing - models for developers and schools. -</p> - -<p> - <strong>Why is it recommended that in-app purchase features are - removed?</strong> -</p> - -<p> - In-app Billing is currently not supported with Google Play for Education, and - a student device will block the Google Play transaction if a student attempts - to make an in-app purchase. To avoid confusing students, we recommend not - including any in-app purchase buttons and other UI in your apps. We’re - investigating additional purchase mechanisms to enable more flexible pricing - models for developers and schools. -</p> - -<p> - <strong>Is Google Play for Education restricted so only its users can - purchase from the Google Play for Education? Or will anyone be able to - purchase from it?</strong> -</p> - -<p> - Currently, only schools that are signed up for Google Play for Education can - make purchases on it. -</p> - -<p> - <strong>Can I set different prices for my apps in Google Play for Education - and Google Play?</strong> -</p> - -<p> - You set a single price for each app that applies to both Google Play and - Google Play for Education. You can’t set a different price for a given app - (based on a single package name) in Google Play for Education. -</p> - -<div class="headerLine"> - <h2 id="free-trials"> - Free Trials - </h2> - - -</div> - -<p> - <strong>Can I offer free trials through Google Play for Education?</strong> -</p> - -<p> - Google Play for Education doesn't currently support free trials. If you want, - you can offer a free version of your app with limited functionality in Google - Play for Education, but that app would need to be separate from your paid app - and be reviewed separately for educational content. -</p> - -<p> - <strong>Can I offer a free trial through Google Play's "In-app Subscriptions - with Free Trials" feature?</strong> -</p> - -<p> - Google Play for Education doesn’t currently support In-app Billing or In-app - Subscriptions with free trials. -</p> - -<div class="headerLine"> - <h2 id="discovery"> - Discovery - </h2> - - -</div> - -<p> - <strong>What are the categories in Google Play for Education?</strong> -</p> - -<p> - Google Play for Education includes categories for all grade levels from - Kindergarten to 12 and the following subjects: English Language Arts, World - Languages, Mathematics, Science, Social Science, Elective, Open Education - Resources (OER), and Tools. -</p> - -<p> - <strong>I created an app specifically for Google Play for Education and don’t - want it to show up in Google Play. Is this possible?</strong> -</p> - -<p> - Currently, it’s not possible to publish an app on Google Play for Education - and make it unavailable on Google Play. -</p> - -<p> - <strong>If my app offers content for every level of education, how will it - fit the Common Core State Standard filters?</strong> -</p> - -<p> - If your app applies to multiple levels of education, then the app will show - up in filtered results for multiple levels. -</p> - -<div class="headerLine"> - <h2 id="app-review-process"> - App Review Process - </h2> - - -</div> - -<p> - <strong>How are apps being reviewed? By whom and against what - criteria?</strong> -</p> - -<p> - Apps are being reviewed by a third-party network of educators. These - educators assign the appropriate subject, grade, and Common Core State - Standards metadata, as well as evaluating whether the app meets the Google - Play for Education <a href= - "{@docRoot}distribute/essentials/gpfe-guidelines.html">criteria for classroom - use</a>. -</p> - -<p> - <strong>How do I update my apps in Google Play for Education?</strong> -</p> - -<p> - You can update your apps on Google Play for Education in the same manner you - do on Google Play. App updates will not be reviewed prior to being made - available through Google Play for Education. However, we will periodically - review updated apps for quality. -</p> - -<p> - <strong>Does the app maturity rating reflect solely on what a user can do - within my Android app, or does the web version of my app influence the rating - as well?</strong> -</p> - -<p> - The maturity rating that you set for an Android app refers only to the - content displayed in that app. -</p> - -<div class="headerLine"> - <h2 id="app-features"> - App Features - </h2> - - -</div> - -<p> - <strong>Do I need separate builds of my phone and tablet apps for Google Play - for Education, or is it the exact same app that lives on Google - Play?</strong> -</p> - -<p> - We recommend you create one app and use it in both Google Play and Google - Play for Education. -</p> - -<p> - <strong>What is the best way to get students’ work within apps sent back to - their teachers?</strong> -</p> - -<p> - Teachers have mentioned that many apps achieve this by email from a third - party, which isn’t optimal for schools. As many schools use Google Apps for - Education, consider integrating your apps with Google Drive using the - <a href="https://developers.google.com/drive/about-sdk">SDK</a>. -</p> - -<p> - <strong>How can developers test the teacher experience in Google Play for - Education? Is there a way to get an account to test it?</strong> -</p> - -<p> - Currently, we are unable to provide developers with a test account to test - the Google Play for Education user experience. We’re investigating ways to - allow developers to simulate the environment. -</p> - -<p> - <strong>If I already have an app in the Chrome Apps Pack will I get some help - migrating this to Android?</strong> -</p> - -<p> - If you’d like to reach tablet users in schools we encourage you to build a - native app for the optimal user experience. Considerations for building your - apps can be found in the <a href= - "{@docRoot}distribute/essentials/gpfe-guidelines.html">Google Play for - Education Guidelines</a>. -</p> - -<div class="headerLine"> - <h2 id="marketing-and-roi"> - Marketing and ROI - </h2> - - -</div> - -<p> - <strong>What are you doing to promote these apps to educators?</strong> -</p> - -<p> - Google Play for Education is an extension of Google Play targeting schools - and making the discovery of educational apps easier. It helps your apps gain - visibility with the right audiences, without having to knock on school doors. - We’re constantly referring to the highest quality apps in our educator - outreach. We’ve also developed a series of collections to help educators - quickly browse apps for the most common use cases. -</p> - -<p> - <strong>How many installs have similar apps had on Google Play for Education? - How much can I expect to make if I do an ROI analysis?</strong> -</p> - -<p> - While we cannot disclose specific numbers, Google Play app listings provide - app download ranges for all apps. -</p> - -<p> - <strong>What is the seasonality like for the education market? What are the - key timing considerations for app developers?</strong> -</p> - -<p> - In the United States, school districts’ budget decisions go through a - planning phase in the Spring with budgets being released on July 1. We’ve - observed high purchase-volumes in the second quarter of the calendar year, to - use up end-of-year budgets. New budget purchases begin in the third quarter - of the calendar year. -</p> - -<p> - <strong>Is there a way to offer a special deal, such as a discount, only on - Google Play for Education and not on Google Play?</strong> -</p> - -<p> - No, this isn’t possible. Pricing, including special offers, must be the same - between Google Play for Education and Google Play. -</p> - -<div class="headerLine"> - <h2 id="devices"> - Devices - </h2> - - -</div> - -<p> - <strong>Which devices are available in the program? Will more be - available?</strong> -</p> - -<p> - Nexus 7 is available for shipment now, and the Asus Transformer, HP Slate 8 - Pro, and Galaxy Tab for Education will be available in early 2014. We look - forward to welcoming more Android devices into the Google in Education family - soon. -</p> - -<p> - <strong>Can the devices be shared among many students?</strong> -</p> - -<p> - No. Currently, this program is for one-to-one use. Each student can login to - one specific tablet that is allocated to them. -</p> - -<div class="headerLine"> - <h2 id="accounts"> - Accounts - </h2> - - -</div> - -<p> - <strong>Will an app know whether a user is a teacher or student?</strong> -</p> - -<p> - No, the app has no mechanism for knowing if it’s running on a teacher’s - device or a student’s device. We recommend developers use their own user - database to enable this feature, where logins can be based on Google Account - information. -</p> - -<p> - <strong>What log-in method do you recommend for an app on Google Play for - Education?</strong> -</p> - -<p> - One of the key pieces of feedback we’ve heard multiple times from various - schools is that they prefer apps that offer Google Single Sign-on, so that - teachers and students don’t need to remember multiple log-in credentials. As - schools in the program use Google Accounts and Google Apps for Education, - offering Google Single Sign-on is ideal. -</p> -<div class="headerLine"><h2 id="related-resources">Related Resources</h2></div> - -<div class="resource-widget resource-flow-layout col-13" - data-query="collection:distribute/toolsreference/gpfefaq" - data-sortOrder="-timestamp" - data-cardSizes="6x3,6x3,6x3,9x3,9x3,9x3" - data-maxResults="6"></div> - diff --git a/docs/html/distribute/googleplay/edu/start.jd b/docs/html/distribute/googleplay/edu/start.jd index 4886b5a..136611c 100644 --- a/docs/html/distribute/googleplay/edu/start.jd +++ b/docs/html/distribute/googleplay/edu/start.jd @@ -1,4 +1,4 @@ -page.title=Get Started with Education +page.title=Publish Android Apps for Education page.image=/distribute/images/play-education.jpg meta.tags="education", "guidelines", "quality" page.tags="education", "addendum" @@ -16,21 +16,23 @@ page.metaDescription=Join Google Play for Education in just a few simple steps. </ol> </div></div> <p> - If you've got great apps for education and want to reach even more teachers + If you've got great Android apps for education and want to reach even more teachers and students, you can join the <strong>Google Play for Education</strong> program in a few simple steps. You do everything using the familiar tools and processes in Google Play. </p> <p> - Note that Google Play for Education is currently available to <strong>K-12 - schools in the United States</strong> only. +Note that Google Play for Education is currently available to <strong>K-12 schools in the United +States</strong> only.</p> + +<p>If you have an educational Chrome app instead of an Android app, you can learn more about +Chrome Apps in Google Play for Education at <a href= +"https://developers.google.com/edu">developers.google.com/edu</a>. </p> -<div class="center-img"> - <img src="{@docRoot}images/gpfe-start-0.jpg" style= - "border:1px solid #ddd;padding:0px;width:100%;"> -</div> +<img src="{@docRoot}images/gpfe-start-0.jpg" style= + "border:1px solid #ddd;padding:0px" width="760" height="403"> <div class="headerLine"> <h2 id="register"> diff --git a/docs/html/distribute/googleplay/googleplay_toc.cs b/docs/html/distribute/googleplay/googleplay_toc.cs index 4196c39..36e424a 100644 --- a/docs/html/distribute/googleplay/googleplay_toc.cs +++ b/docs/html/distribute/googleplay/googleplay_toc.cs @@ -25,13 +25,7 @@ </li> <li class="nav-section"> <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/edu/start.html"> - <span class="en">Get Started with Education</span> - </a> - </div> - </li> - <li class="nav-section"> - <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/edu/faq.html"> - <span class="en">Education FAQ</span> + <span class="en">Publish Android Apps for Education</span> </a> </div> </li> diff --git a/docs/html/google/auth/api-client.jd b/docs/html/google/auth/api-client.jd index 402a95f..5331d1e 100644 --- a/docs/html/google/auth/api-client.jd +++ b/docs/html/google/auth/api-client.jd @@ -1,4 +1,4 @@ -page.title=Accessing Google Play Services APIs +page.title=Accessing Google APIs page.tags="oauth 2.0","GoogleAuthUtil" trainingnavtop=true diff --git a/docs/html/google/gcm/ccs.jd b/docs/html/google/gcm/ccs.jd index 03addfd..4389e3d 100644 --- a/docs/html/google/gcm/ccs.jd +++ b/docs/html/google/gcm/ccs.jd @@ -19,7 +19,11 @@ page.title=GCM Cloud Connection Server (XMPP) <li><a href="#response">Response format</a></li> </ol> </li> - <li><a href="#upstream">Upstream Messages</a> </li> + <li><a href="#upstream">Upstream Messages</a> + <ol> + <li><a href="#receipts">Receive return receipts</a></li> + </ol> + </li> <li><a href="#flow">Flow Control</a> </li> <li><a href="#implement">Implementing an XMPP-based App Server</a> <ol class="toc"> @@ -43,9 +47,6 @@ target="_android">CCS and User Notifications Signup Form</a></li> </div> </div> -<p class="note"><strong>Note:</strong> To try out this feature, sign up using -<a href="https://services.google.com/fb/forms/gcm/">this form</a>.</p> - <p>The GCM Cloud Connection Server (CCS) is an XMPP endpoint that provides a persistent, asynchronous, bidirectional connection to Google servers. The connection can be used to send and receive messages between your server and @@ -149,8 +150,8 @@ exceptions:</p> <li>CCS adds the field {@code message_id}, which is required. This ID uniquely identifies the message in an XMPP connection. The ACK or NACK from CCS uses the {@code message_id} to identify a message sent from 3rd-party app servers to CCS. -Therefore, it's important that this {@code message_id} not only be unique, but -always present.</li> +Therefore, it's important that this {@code message_id} not only be unique (per +sender ID), but always present.</li> </ul> <p>In addition to regular GCM messages, control messages are sent, indicated by @@ -188,7 +189,8 @@ parameters and which connection server(s) supports them.</p> "hello":"world", } "time_to_live":"600", - "delay_while_idle": true/false + "delay_while_idle": true/false, + "delivery_receipt_requested": true/false } </gcm> </message> @@ -227,42 +229,48 @@ message is "nack". A NACK message contains:</p> <p>Below are some examples.</p> <p>Bad registration:</p> + <pre><message> - <data:gcm xmlns:data="google:mobile:data"> + <gcm xmlns="google:mobile:data"> { - "error":"BAD_REGISTRATION", // error code + "message_type":"nack", "message_id":"msgId1", - "from":"PA91bHFOtaQGSwupt5l1og", - "message_type":"nack" + "from":"SomeInvalidRegistrationId", + "error":"BAD_REGISTRATION", + "error_description":"Invalid token on 'to' field: SomeInvalidRegistrationId" } - </data:gcm> + </gcm> </message></pre> -<p>Invalid "time to live":</p> +<p>Invalid JSON:</p> <pre><message> - <data:gcm xmlns:data="google:mobile:data"> - { - "error":"InvalidJson : INVALID_TTL : Invalid value (-1) for \"time_to_live\": must be between 0 and \"2419200\"\n", - "message_id":"msgId1", - "from":"APA91bHFOtaQGSwupt5l1og", - "message_type":"nack" - } - </data:gcm> -</message></pre> + <gcm xmlns="google:mobile:data"> + { + "message_type":"nack", + "message_id":"msgId1", + "from":"APA91bHFOtaQGSwupt5l1og", + "error":"INVALID_JSON", + "error_description":"InvalidJson: JSON_TYPE_ERROR : Field \"time_to_live\" must be a JSON java.lang.Number: abc" + } + </gcm> +</message> +</pre> -<p>JSON type error:</p> +<p>Quota exceeded:</p> <pre><message> - <data:gcm xmlns:data="google:mobile:data"> - { - "error":"InvalidJson : JSON_TYPE_ERROR : Field \"delay_while_idle\" must be a JSON java.lang.Boolean: not-boolean-user-supplied-value\n", - "message_id":"msgId1", - "from":"APA91bHFOtaQGSwupt5l1og", - "message_type":"nack" - } - </data:gcm> -</message></pre> + <gcm xmlns="google:mobile:data"> + { + "message_type":"nack", + "message_id":"msgId1", + "from":"APA91bHFOtaQGSwupt5l1og", + "error":"QUOTA_EXCEEDED", + "error_description":"Short-term downstream quota exceeded for this registration id" + } + </gcm> +</message> +</pre> <p>The following table lists NACK error codes. Unless otherwise @@ -300,7 +308,7 @@ message should be immediately retried over another connection.</td> </tr> <tr> <td>{@code INVALID_JSON}</td> -<td>The JSON message payload was not valid.</td> +<td>The JSON message payload is not valid.</td> </tr> <tr> <td>{@code QUOTA_EXCEEDED}</td> @@ -309,10 +317,10 @@ sender/device pair) is too high. If you want to retry the message, try using a s rate.</td> </tr> <tr> -<td>{@code SERVICE_UNAVAILABLE}</td> -<td>CCS is not currently able to process the message. The -message should be retried over the same connection using exponential backoff -with an initial delay of 1 second.</td> + <td>{@code SERVICE_UNAVAILABLE}</td> + <td>CCS is not currently able to process the message. The + message should be retried over the same connection using exponential backoff + with an initial delay of 1 second.</td> </tr> </table> @@ -382,8 +390,8 @@ Bundle data = new Bundle(); // Bundle data consists of a key-value pair data.putString("hello", "world"); // "time to live" parameter -// This is optional. It specifies a value in seconds up to 4 weeks. -int ttl = [0 seconds, 4 weeks] +// This is optional. It specifies a value in seconds up to 24 hours. +int ttl = [0 seconds, 24 hours] gcm.send(GCM_SENDER_ID + "@gcm.googleapis.com", id, ttl, data); </pre> @@ -419,6 +427,69 @@ response to the above message:</p> </gcm> </message></pre> +<h3 id="receipts">Receive return receipts</h3> + +<p>You can use upstream messaging to get receipt notifications, confirming +that a given message was sent to a device. Your 3rd-party app server receives the receipt +notification from CCS once the message has been sent to the device.</p> + +<p>To enable this feature, the message your 3rd-party app server sends to CCS must include +a field called <code>"delivery_receipt_requested"</code>. When this field is set to +<code>true</code>, CCS sends a return receipt. Here is an XMPP stanza containing a JSON +message with <code>"delivery_receipt_requested"</code> set to <code>true</code>:</p> + +<pre><message id=""> + <gcm xmlns="google:mobile:data"> + { + "to":"REGISTRATION_ID", + "message_id":"m-1366082849205" + "data": + { + "hello":"world", + } + "time_to_live":"600", + "delay_while_idle": true, + <strong>"delivery_receipt_requested": true</strong> + } + </gcm> +</message> +</pre> + +<p>Here is an example of a receipt notification message that CCS sends back to your 3rd-party +app server:</p> + +</p> +<pre><message id=""> + <gcm xmlns="google:mobile:data"> + { + "category":"com.example.yourapp", // to know which app sent it + "data": + { + “message_status":"MESSAGE_SENT_TO_DEVICE", + “original_message_id”:”m-1366082849205” + “device_registration_id”: “REGISTRATION_ID” + }, + "message_id":"dr2:m-1366082849205", + "message_type":"receipt", + "from":"gcm.googleapis.com" + } + </gcm> +</message></pre> + +<p>Note the following:</p> + +<ul> + <li>The {@code "message_type"} is set to {@code "receipt"}. + <li>The {@code "message_status"} is set to {@code "MESSAGE_SENT_TO_DEVICE"}, + indicating that the message was delivered. Notice that in this case, +{@code "message_status"} is not a field but rather part of the data payload.</li> + <li>The receipt message ID consists of the original message ID, but with a +<code>dr:</code> prefix. Your 3rd-party app server must send an ACK back with this ID, +which in this example is {@code dr2:m-1366082849205}.</li> + <li>The original message ID and status are inside the +{@code "data"} field.</li> +</ul> + <h2 id="flow">Flow Control</h2> <p>Every message sent to CCS receives either an ACK or a NACK response. Messages diff --git a/docs/html/google/gcm/client.jd b/docs/html/google/gcm/client.jd index 42cebfc..ec7e748 100644 --- a/docs/html/google/gcm/client.jd +++ b/docs/html/google/gcm/client.jd @@ -246,7 +246,8 @@ private boolean checkPlayServices() { <h3 id="sample-register">Register for GCM</h3> <p>An Android application needs to register with GCM servers before it can receive messages. When an app registers, it receives a registration ID, which it can then -store for future use. In the following snippet the {@code onCreate()} method in the sample app's +store for future use (note that registration IDs must be kept secret). In the +following snippet the {@code onCreate()} method in the sample app's main activity checks to see if the app is already registered with GCM and with the server:</p> diff --git a/docs/html/google/gcm/gcm.jd b/docs/html/google/gcm/gcm.jd index 88bf659..19151b9 100644 --- a/docs/html/google/gcm/gcm.jd +++ b/docs/html/google/gcm/gcm.jd @@ -123,7 +123,7 @@ it to receive messages. Once the Android application has the registration ID, it it to the 3rd-party application server, which uses it to identify each device that has registered to receive messages for a given Android application. In other words, a registration ID is tied to a particular Android application running on a particular -device. +device. Note that registration IDs must be kept secret. <br/> <br/> <strong>Note:</strong> If you use diff --git a/docs/html/google/gcm/index.jd b/docs/html/google/gcm/index.jd index 8f325b8..1f05a71 100644 --- a/docs/html/google/gcm/index.jd +++ b/docs/html/google/gcm/index.jd @@ -14,7 +14,10 @@ header.hide=1 <h1 itemprop="name" style="margin-bottom:0;">Google Cloud Messaging for Android</h1> <p itemprop="description"> Google Cloud Messaging for Android (GCM) is a service that allows you to send data -from your server to your users' Android-powered device, and also to receive messages from devices on the same connection. The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device. GCM is completely free no matter how big your messaging needs are, and there are no quotas. +from your server to your users' Android-powered device, and also to receive messages from +devices on the same connection. The GCM service handles all aspects of queueing of messages +and delivery to the target Android application running on the target device. GCM is +completely free no matter how big your messaging needs are, and there are no quotas. </p> </div> @@ -27,31 +30,39 @@ from your server to your users' Android-powered device, and also to receive mess <p>This could be a lightweight message telling your app there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing -up to 4kb of payload data (so apps like instant messaging can consume the message directly). <a href="{@docRoot}google/gcm/gcm.html">GCM Architectural Overview.</a></p> +up to 4kb of payload data (so apps like instant messaging can consume the message directly). +<a href="{@docRoot}google/gcm/gcm.html">GCM Architectural Overview.</a></p> <h4>Send "send-to-sync" messages</h4> - <p>A send-to-sync (collapsible) message is often a "tickle" that tells a mobile application to sync data from the server. For example, suppose you have an email application. When a user receives new email on the server, the server pings the mobile application with a "New mail" message. This tells the application to sync to the server to pick up the new email. - <a href="{@docRoot}google/gcm/adv.html#s2s">Send-to-sync messages</a>.</p> - </a> + <p>A send-to-sync (collapsible) message is often a "tickle" that tells a mobile + application to sync data from the server. For example, suppose you have an email + application. When a user receives new email on the server, the server pings the mobile + application with a "New mail" message. This tells the application to sync to the server + to pick up the new email. + <a href="{@docRoot}google/gcm/adv.html#s2s">Learn more »</a></p> <h4>Send messages with payload</h4> - <p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4kb. - <a href="{@docRoot}google/gcm/adv.html#payload">Messages with payload</a>.</p> + <p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) + is delivered. The payload the message contains can be up to 4kb. + <a href="{@docRoot}google/gcm/adv.html#payload">Learn more »</a></p> </div> <div class="col-6 normal-links"> <h3 style="clear:left">New Features</h3> - <h4>Faster, easier GCM setup</h4> - <p>Streamlined registration makes it simple and fast to add GCM support to your Android app. <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p> - <h4>Upstream messaging over XMPP</h4> - <p>GCM's Cloud Connection Service (CCS) lets you communicate with Android devices over a persistent XMPP connection. The primary advantages of CCS are speed, and the ability to receive upstream messages (that is, messages from a device to the cloud). You can use the service in tandem with existing GCM APIs. Use <a href="https://services.google.com/fb/forms/gcm/">this form</a> to sign up for CCS. <a href="{@docRoot}google/gcm/ccs.html">Learn more »</a></p> - <h4>Seamless multi-device messaging</h4> - <p>Maps a single user to a notification key, which you can then use to send a single message to multiple devices owned by the user. Use <a href="https://services.google.com/fb/forms/gcm/">this form</a> to sign up for User Notifications. <a href="{@docRoot}google/gcm/notifications.html">Learn more »</a></p> + + + <h4>Return Receipts</h4> + <p>You can use upstream messaging to get receipt notifications, confirming that a given + message was sent to a device. Your 3rd-party app server receives the receipt notification + from CCS once the message has been sent to the device. + <a href="{@docRoot}google/gcm/ccs.html#receipts">Learn more »</a></p> + <h4>Get Started</h4> - <p>Get started using the new features with a tutorial that walks you through creating a GCM app. <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p> + <p>Get started with a tutorial that walks you through creating a GCM app. + <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p> </div> </div> diff --git a/docs/html/google/gcm/notifications.jd b/docs/html/google/gcm/notifications.jd index 43a7368..2815f3d 100644 --- a/docs/html/google/gcm/notifications.jd +++ b/docs/html/google/gcm/notifications.jd @@ -14,8 +14,8 @@ page.title=User Notifications <h2>In this document</h2> <ol class="toc"> - <li><a href="#request">Request Format</a></li> - <li><a href="#create">Generate a Notification Key</a></li> + <li><a href="#gen-server">Generate a Notification Key on the Server</a></li> + <li><a href="#gen-client">Generate a Notification Key on the Client</a></li> <li><a href="#add">Add Registration IDs</a></li> <li><a href="#remove">Remove Registration IDs</a></li> <li><a href="#upstream">Send Upstream Messages</a></li> @@ -31,15 +31,11 @@ page.title=User Notifications <ol class="toc"> <li><a href="{@docRoot}google/gcm/gs.html">Getting Started</a></li> -<li><a href="https://services.google.com/fb/forms/gcm/" class="external-link" target="_android">CCS and User Notifications Signup Form</a></li> </ol> </div> </div> -<p class="note"><strong>Note:</strong> To try out this feature, sign up using <a href="https://services.google.com/fb/forms/gcm/">this form</a>.</p> - - <p>With user notifications, 3rd-party app servers can send a single message to multiple instance of an app running on devices owned by a single user. This feature is called <em>user notifications</em>. User notifications make it possible for every @@ -76,27 +72,23 @@ and then reconciling it with the corresponding notification. <p>You can use this feature with either the <a href="ccs.html">XMPP</a> (CCS) or <a href="http.html">HTTP</a> connection server.</p> +<p>You can generate notification keys in two different ways: on the server, and on +the client, if the user has a Google account. All of the associated registration IDs +can be mapped to a single user.</p> <p>The examples below show you how to perform generate/add/remove operations, and how to send upstream messages. For generate/add/remove operations, the message body is JSON.</p> -<h2 id="request">Request Format</h2> -<p>To send a message, the application server issues a POST request to -<code>https://android.googleapis.com/gcm/notification</code>.</p> +<h2 id="gen-server">Generate a Notification Key on the Server</h2> -<p>Here is the HTTP request header you should use for all create/add/remove operations:</p> - -<pre>content-type: "application/json" -Header : "project_id": <projectID> -Header: "Authorization", "key=API_KEY" -</pre> - -<h2 id="create">Generate a Notification Key</h2> +<p>To generate a notification key on the server, you create a new +create a new <code>notification_key</code> and map it to a +<code>notification_key_name</code>.</p> <p>This example shows how to create a new <code>notification_key</code> for a <code>notification_key_name</code> called <code>appUser-Chris</code>. -The {@code notification_key_name} is a name or identifier (can be a username for +The {@code notification_key_name} is a name or identifier (it can be a username for a 3rd-party app) that is unique to a given user. It is used by third parties to group together registration IDs for a single user. Note that <code>notification_key_name</code> and <code>notification_key</code> are unique to a group of registration IDs. It is also @@ -116,10 +108,109 @@ to use in subsequent operations:</p> "registration_ids": ["4", "8", "15", "16", "23", "42"] }</pre> +<h3 id="request-server">Request format</h3> + +<p>To send a message in cases where your notification key is generated on the server, +the application server issues a POST request to +<code>https://android.googleapis.com/gcm/notification</code>.</p> + +<p>Here is the HTTP request header you should use for all server side create/add/remove operations:</p> + +<pre>content-type: "application/json" +Header : "project_id": <projectID> +Header: "Authorization", "key=API_KEY" +</pre> + + +<h2 id="gen-client">Generate a Notification Key on the Client</h2> + +<p>Generating a notification key on the client is useful for cases where a server is unavailable. +To generate a notification key on the client, the device must have at least one +Google account. Note that the process for generating a notification key on the client is significantly +different from the server process described above.</p> + +<p>To generate a notification key on the client:</p> + +<ol> + <li>Open your project in the <a href="https://cloud.google.com/console">Google Developers Console</a>.</li> + <li>Click <strong>APIS & AUTH > Credentials</strong>.</li> + <li>Under OAuth, click <strong>Create new Client ID</strong>.</li> + <li>In the <strong>Create Client ID</strong> dialog, select <strong>Web Application</strong> as +the application type, and click <strong>Create Client ID</strong>.</li> + <li>Copy the value from <strong>Client ID for web application > Client ID</strong>. +This client ID represents a Google account "scope" that you will use to generate an {@code id_token}.</li> +</ol> + +<p>Once you've followed the above steps and gotten a client ID from Google Developers Console, + you're ready to add this feature to your app. First check the device for the presence of a Google +account. For example:</p> + +<pre>// This snippet takes the simple approach of using the first returned Google account, +// but you can pick any Google account on the device. +public String getAccount() { + Account[] accounts = AccountManager.get(getActivity()). + getAccountsByType("com.google"); + if (accounts.length == 0) { + return null; + } + return accounts[0].name; +}</pre> + +<p>Next, get an authentication token ({@code id_token}) by using the <code><a href= +"http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html">GoogleAuthUtil</a></code> +class. For example:</p> + +<pre>String accountName = getAccount(); + +// Initialize the scope using the client ID you got from the Console. +final String scope = "audience:server:client_id:" + + "1262xxx48712-9qs6n32447mcj9dirtnkyrejt82saa52.apps.googleusercontent.com"; +String id_token = null; +try { + id_token = GoogleAuthUtil.getToken(context, accountName, scope); +} catch (Exception e) { + log("exception while getting id_token: " + e); +} +...</pre> + +<p>Now use <code>id_token</code> to authenticate your request. +This add operation returns a {@code notification_key}. +Third parties must save this {@code notification_key} (as well as its mapping to the +<code>notification_key_name</code>) +to use in subsequent operations. Note that a client request only takes a single regID. +The only operations supported on the client side are add/remove.</p> + +<pre>request: +{ + "operation": "add", + "notification_key_name": "appUser-Chris", + "registration_ids": ["4"] + "id_token": "id_token" +}</pre> + +<h3 id="request-client">Request format</h3> + +<p>To send a message in cases where your notification key is generated on the client, +the application server issues a POST request to +<code>https://android.googleapis.com/gcm/googlenotification</code>.</p> + +<p>Here is the HTTP request header you should use for all add/remove operations. The +client side doesn't support the create operation; +the add operation has the effect of creating the notification key if it doesn't already +exist:</p> + +<pre>content-type: "application/json" +Header : "project_id": <projectID> +</pre> + +<p>Note that the authentication token is passed in the JSON body as shown above, not the header. +This is different from the server case.</p> + + <h2 id="add">Add Registration IDs</h2> <p>This example shows how to add registration IDs for a given notification key. -The maximum number of members allowed for a {@code notification_key} is 10.</p> +The maximum number of members allowed for a {@code notification_key} is 20.</p> <p>Note that the <code>notification_key_name</code> is not strictly required for adding/removing regIDs. But including it protects you against accidentally using diff --git a/docs/html/google/gcm/server.jd b/docs/html/google/gcm/server.jd index ccd1267..e3a6b25 100644 --- a/docs/html/google/gcm/server.jd +++ b/docs/html/google/gcm/server.jd @@ -120,7 +120,8 @@ have an application server that meets the following criteria:</p> <li>Able to store the API key and client registration IDs. The API key is included in the header of POST requests that send messages.</li> - <li>Able to generate message IDs to uniquely identify each message it sends.</li> + <li>Able to generate message IDs to uniquely identify each message it sends. Message IDs +should be unique per sender ID.</li> </ul> <h2 id="send-msg">Sending Messages</h2> diff --git a/docs/html/google/gcs/gcs-signup.jd b/docs/html/google/gcs/gcs-signup.jd new file mode 100644 index 0000000..7334cec --- /dev/null +++ b/docs/html/google/gcs/gcs-signup.jd @@ -0,0 +1,10 @@ +page.title=Sign Up for Google Cloud Save + +@jd:body + +<p>Sign up to be a trial partner for Google Cloud Save.</p> + + +<iframe src="https://docs.google.com/a/google.com/forms/d/1_V67YIXzLDLb-UzxOOpSjUDuJFfeYg3hEUT0oliK2ck/viewform?embedded=true" width="100%" height="930" frameborder="0" marginheight="0" marginwidth="0" id="signupform">Loading...</iframe> +</body> +</html> diff --git a/docs/html/google/gcs/index.jd b/docs/html/google/gcs/index.jd new file mode 100644 index 0000000..e5f4776 --- /dev/null +++ b/docs/html/google/gcs/index.jd @@ -0,0 +1,30 @@ +page.title=Google Cloud Save +page.tags="gcs" +header.hide=1 +@jd:body + + +<div class="landing-banner"> + +<div class="col-5" style="min-height:100px"> + <img src="{@docRoot}images/google/gcs.png" /> +</div> +<div class="col-7"> + + <h1 itemprop="name" style="margin-bottom:0;">Google Cloud Save</h1> + <p itemprop="description"> + Google Cloud Save is a service that enables per-user data storage +and sync in your apps with no backend programming required. Google Cloud Save +stores its data +in <a href="http://developers.google.com/datastore/">Google Cloud Datastore</a>, + a fully managed, schemaless database for storing non-relational data. Cloud +Datastore automatically scales with your users. +Google Cloud Save works even when your device is offline, and it +provides an easy transition to server-side coding because +the same database is accessible via App Engine and Compute Engine. +Finally, Google Cloud Save provides a generous initial per-user free quota that +expands as your user base grows. +</p> +<a href="{@docRoot}google/gcs/gcs-signup.html" class="button">Sign Up</a> +</div> +</div> diff --git a/docs/html/google/google_toc.cs b/docs/html/google/google_toc.cs index 6ff00c0..b4028bd 100644 --- a/docs/html/google/google_toc.cs +++ b/docs/html/google/google_toc.cs @@ -3,11 +3,11 @@ ######## ATTENTION ############### ######## ############### ######################################################### - + IF YOU MAKE CHANGES TO THIS FILE, YOU MUST GENERATE THE GMS REFERENCE DOCS, BECAUSE THEY ARE NOT INCLUDED IN THE DOCS BUILD RULE. - + ######################################################### ######################################################### ?> @@ -73,11 +73,11 @@ </div> <ul> <li><a href="<?cs var:toroot?>google/play-services/setup.html"> - <span class="en">Setup</span></a> + <span class="en">Setting Up Google Play Services</span></a> </li> <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot?>google/auth/api-client.html"> - <span class="en">Accessing Google Play Services APIs</span></a> + <span class="en">Accessing Google APIs</span></a> </div> <ul> <li> diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd index 2e97d62..4778a85 100644 --- a/docs/html/google/index.jd +++ b/docs/html/google/index.jd @@ -89,6 +89,16 @@ cloud messaging.</p> to use Google Cloud Messaging.</p> </div> +<div class="landing-cell"> + <div class="cell-icon"> + <img src="{@docRoot}images/google/gcs-small.png" width="40" > + </div> + <h4><a href="{@docRoot}google/gcs/index.html" + >Google Cloud Save</a></h4> + <p>Enable per-user data storage and sync in your apps with no backend programming + required.</p> +</div> + </div><!-- col-6 --> diff --git a/docs/html/google/play-services/games.jd b/docs/html/google/play-services/games.jd index 94f6715..a73f688 100644 --- a/docs/html/google/play-services/games.jd +++ b/docs/html/google/play-services/games.jd @@ -1,4 +1,5 @@ page.title=Google Play Game Services +page.tags="games" header.hide=1 @jd:body diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd index 744e191..4332953 100644 --- a/docs/html/google/play-services/setup.jd +++ b/docs/html/google/play-services/setup.jd @@ -1,4 +1,4 @@ -page.title=Set Up Google Play Services SDK +page.title=Setting Up Google Play Services @jd:body @@ -8,8 +8,7 @@ page.title=Set Up Google Play Services SDK <h2>In this document</h2> <ol> - <li><a href="#Install">Install the Google Play Services SDK</a></li> - <li><a href="#Setup">Set Up a Project that Uses Google Play Services</a></li> + <li><a href="#Setup">Add Google Play Services to Your Project</a></li> <li><a href="#Proguard">Create a Proguard Exception</a></li> <li><a href="#ensure">Ensure Devices Have the Google Play services APK</a></li> </ol> @@ -18,12 +17,17 @@ page.title=Set Up Google Play Services SDK </div> </div> +<script> +$(document).ready(function() { + setupIdeDocToggle(); +}); +</script> + - <p>To develop an app using the <a href="{@docRoot}reference/gms-packages.html">Google -Play services APIs</a>, you must download the Google Play services SDK -from the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>. -The download includes the client library and code samples.</p> +Play services APIs</a>, you need to set up your project with the Google Play services SDK. +<p>If you haven't installed the Google Play services SDK yet, go get it now by following the guide +to <a href="{@docRoot}sdk/installing/adding-packages.html">Adding SDK Packages</a>.</p> <p>To test your app when using the Google Play services SDK, you must use either:</p> <ul> @@ -33,68 +37,25 @@ The download includes the client library and code samples.</p> that runs the Google APIs platform based on Android 4.2.2 or higher.</li> </ul> -<p>Ideally, you should develop and test your app on a variety of devices, including -both phones and tablets.</p> - - -<h2 id="Install">Install the Google Play Services SDK</h2> - -<p>To install the Google Play services SDK for development:</p> -<ol> - <li>Launch the SDK Manager in one of the following ways: - <ul> - <li>In Android Studio, click <strong>SDK Manager</strong> -<img src="{@docRoot}images/tools/sdk-manager-studio.png" style="vertical-align:bottom;margin:0;height:19px" /> -in the toolbar.</li> - <li>In Eclipse (with <a href="{@docRoot}tools/help/adt.html">ADT</a>), - select <strong>Window</strong> > <strong>Android 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 - Android SDK, then execute <code>android sdk</code>.</li> - </ul> - </li> - <li>Install the Google Play services SDK. - <p>Scroll to the bottom of the package list, expand <b>Extras</b>, select - <b>Google Play services</b>, and install it. If you're using Android Studio, also install - <b>Google Repository</b> (it provides the Maven repository used for Gradle builds).</p> - <p>The Google Play services SDK is saved in your Android SDK environment at - <code><android-sdk>/extras/google/google_play_services/</code>.</p> - -<p class="note"><strong>Note:</strong> Google Play services 4.0.30 (released -November 2013) and newer versions require Android 2.3 or higher. If your app supports Android 2.2, -you can continue development with the Google Play services SDK, but must instead install -<b>Google Play services for Froyo</b> from the SDK Manager.</p> - - </li> - <li>Install a compatible version of the Google APIs platform. - <p>If you want to test your app on the emulator, expand the directory for <b>Android 4.2.2 - (API 17)</b> or a higher version, select <b>Google APIs</b>, and install it. Then create a - new <a href="{@docRoot}tools/devices/index.html">AVD</a> with Google APIs as - the platform target.</p> - </li> - <li>Make a copy of the Google Play services library project. - <p class="note"><strong>Note:</strong> If you are using Android Studio, skip this step.</p> - <p>Copy the library project at - <code><android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/</code> - to the location where you maintain your Android app projects. - <p>If you are using Eclipse, import the library project into your workspace. - Click <b>File > Import</b>, select <b>Android > Existing - Android Code into Workspace</b>, and browse to the copy of the library project to import it.</p> - </li> -</ol> +<h2 id="Setup">Add Google Play Services to Your Project</h2> +<p> +<select class="ide"> + <option value="eclipse">Using Eclipse with ADT</option> + <option value="studio">Using Android Studio</option> + <option value="other">Using something else</option> +</select> +</p> -<h2 id="Setup">Set Up a Project that Uses Google Play Services</h2> -<p><b>Using Android Studio:</b></p> +<div class="select-ide studio"> <ol> - <li>Open the <code>build.gradle</code> file inside your application module directory. - <p class="note"><strong>Note:</strong> Android Studio projects contain a top-level - <code>build.gradle</code> file and a <code>build.gradle</code> file for each module. + <li>Open the <code>build.gradle</code> file inside your application module directory. + <p class="note"><strong>Note:</strong> Android Studio projects contain a top-level + <code>build.gradle</code> file and a <code>build.gradle</code> file for each module. Be sure to edit the file for your application module. See <a href="{@docRoot}sdk/installing/studio-build.html">Building Your Project with Gradle</a> for more information about Gradle.</p></li> @@ -128,8 +89,11 @@ element: <p>You can now begin developing features with the <a href="{@docRoot}reference/gms-packages.html">Google Play services APIs</a>.</p> +</div><!-- end studio --> -<p><b>Using Eclipse or another IDE:</b></p> + + +<div class="select-ide eclipse other"> <p>To make the Google Play services APIs available to your app, you must reference the library project you created in step 4 of the <a href="#Install">installation instructions</a>.</p> @@ -156,6 +120,9 @@ element: you can begin developing features with the <a href="{@docRoot}reference/gms-packages.html">Google Play services APIs</a>.</p> +</div><!-- end eclipse and other --> + + <h2 id="Proguard">Create a Proguard Exception</h2> @@ -236,5 +203,6 @@ about the error and provides an action that takes the user to Google Play Store to install the update.</p> -<p>To then begin a connection to Google Play services, read <a -href="{@docRoot}google/auth/api-client.html">Accessing Google Play Services APIs</a>.</p> +<p>To then begin a connection to Google Play services (required by most Google APIs such +as Google Drive, Google+, and Games), read <a +href="{@docRoot}google/auth/api-client.html">Accessing Google APIs</a>.</p> diff --git a/docs/html/guide/components/activities.jd b/docs/html/guide/components/activities.jd index 1cbaa79..3de7eea 100644 --- a/docs/html/guide/components/activities.jd +++ b/docs/html/guide/components/activities.jd @@ -4,12 +4,6 @@ page.tags="activity","intent" <div id="qv-wrapper"> <div id="qv"> -<h2>Quickview</h2> -<ul> - <li>An activity provides a user interface for a single screen in your application</li> - <li>Activities can move into the background and then be resumed with their state restored</li> -</ul> - <h2>In this document</h2> <ol> <li><a href="#Creating">Creating an Activity</a> diff --git a/docs/html/guide/components/bound-services.jd b/docs/html/guide/components/bound-services.jd index 653c7a0..4215f0f 100644 --- a/docs/html/guide/components/bound-services.jd +++ b/docs/html/guide/components/bound-services.jd @@ -6,12 +6,6 @@ parent.link=services.html <div id="qv-wrapper"> <ol id="qv"> -<h2>Quickview</h2> -<ul> - <li>A bound service allows other components to bind to it, in order to interact with it and -perform interprocess communication</li> - <li>A bound service is destroyed once all clients unbind, unless the service was also started</li> -</ul> <h2>In this document</h2> <ol> <li><a href="#Basics">The Basics</a></li> diff --git a/docs/html/guide/components/fragments.jd b/docs/html/guide/components/fragments.jd index 32c9f99..0cc5f72 100644 --- a/docs/html/guide/components/fragments.jd +++ b/docs/html/guide/components/fragments.jd @@ -5,15 +5,6 @@ parent.link=activities.html <div id="qv-wrapper"> <div id="qv"> - - <h2>Quickview</h2> - <ul> - <li>Fragments decompose application functionality and UI into reusable modules</li> - <li>Add multiple fragments to a screen to avoid switching activities</li> - <li>Fragments have their own lifecycle, state, and back stack</li> - <li>Fragments require API Level 11 or greater</li> - </ul> - <h2>In this document</h2> <ol> <li><a href="#Design">Design Philosophy</a></li> diff --git a/docs/html/guide/components/processes-and-threads.jd b/docs/html/guide/components/processes-and-threads.jd index 1fed712..e297205 100644 --- a/docs/html/guide/components/processes-and-threads.jd +++ b/docs/html/guide/components/processes-and-threads.jd @@ -5,13 +5,6 @@ page.tags="lifecycle","background" <div id="qv-wrapper"> <div id="qv"> -<h2>Quickview</h2> -<ul> - <li>Every application runs in its own process and all components of the application run in that -process, by default</li> - <li>Any slow, blocking operations in an activity should be done in a new thread, to avoid slowing -down the user interface</li> -</ul> <h2>In this document</h2> <ol> diff --git a/docs/html/guide/components/services.jd b/docs/html/guide/components/services.jd index da01d2c..6e22be8 100644 --- a/docs/html/guide/components/services.jd +++ b/docs/html/guide/components/services.jd @@ -3,14 +3,6 @@ page.title=Services <div id="qv-wrapper"> <ol id="qv"> -<h2>Quickview</h2> -<ul> - <li>A service can run in the background to perform work even while the user is in a different -application</li> - <li>A service can allow other components to bind to it, in order to interact with it and -perform interprocess communication</li> - <li>A service runs in the main thread of the application that hosts it, by default</li> -</ul> <h2>In this document</h2> <ol> <li><a href="#Basics">The Basics</a></li> diff --git a/docs/html/guide/components/tasks-and-back-stack.jd b/docs/html/guide/components/tasks-and-back-stack.jd index f818873..e054313 100644 --- a/docs/html/guide/components/tasks-and-back-stack.jd +++ b/docs/html/guide/components/tasks-and-back-stack.jd @@ -5,14 +5,6 @@ parent.link=activities.html <div id="qv-wrapper"> <div id="qv"> -<h2>Quickview</h2> -<ul> - <li>All activities belong to a task</li> - <li>A task contains a collection of activities in the order in which the user interacts with -them</li> - <li>Tasks can move to the background and retain the state of each activity in order for users -to perform other tasks without losing their work</li> -</ul> <h2>In this document</h2> <ol> diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd index bd1edc2..a8d7615 100644 --- a/docs/html/guide/topics/manifest/activity-element.jd +++ b/docs/html/guide/topics/manifest/activity-element.jd @@ -5,7 +5,8 @@ parent.link=manifest-intro.html <dl class="xml"> <dt>syntax:</dt> -<dd><pre class="stx"><activity android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"] +<dd><pre class="stx"><activity android:<a href="#embedded">allowEmbedded</a>=["true" | "false"] + android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"] android:<a href="#always">alwaysRetainTaskState</a>=["true" | "false"] android:<a href="#clear">clearTaskOnLaunch</a>=["true" | "false"] android:<a href="#config">configChanges</a>=["mcc", "mnc", "locale", @@ -62,6 +63,17 @@ by the system and will never be run. <dt>attributes:</dt> <dd><dl class="attr"> +<dt><a name="embedded"></a>{@code android:allowEmbedded}</dt> +<dd> + Indicate that the activity can be launched as the embedded child of another + activity. Particularly in the case where the child lives in a container + such as a Display owned by another activity. For example, activities + that are used for Wear custom notifications must declare this so + Wear can display the activity in it's context stream, which resides + in another process. + + <p>The default value of this attribute is <code>false</code>. +</dd> <dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt> <dd>Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd index 814396c..ca954fe 100644 --- a/docs/html/guide/topics/manifest/uses-feature-element.jd +++ b/docs/html/guide/topics/manifest/uses-feature-element.jd @@ -584,9 +584,14 @@ is sensitive to delays or lag in sound input or output.</td> </tr> <tr> <td><code>android.hardware.camera.any</code></td> - <td>The application uses at least one camera facing in any direction. Use this -in preference to <code>android.hardware.camera</code> if a back-facing camera is -not required.</td> + <td>The application uses at least one camera facing in any direction, or an +external camera device if one is connected. Use this in preference to +<code>android.hardware.camera</code> if a back-facing camera is not required. + </td> +</tr> +<tr> + <td><code>android.hardware.camera.external</code></td> + <td>The application uses an external camera device if one is connected.</td> </tr> <tr> @@ -1099,4 +1104,4 @@ filtering based on the <code>CAMERA</code> permission, you would add this <td><code>android.hardware.wifi</code></td> <!-- <td></td> --> </tr> -</table>
\ No newline at end of file +</table> diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index aec7fa7..bf16630 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -562,6 +562,7 @@ which indicates the current device orientation.</p> <code>desk</code><br/> <code>television<br/> <code>appliance</code> + <code>watch</code> </td> <td> <ul class="nolist"> @@ -573,8 +574,9 @@ which indicates the current device orientation.</p> non-pointer interaction</li> <li>{@code appliance}: Device is serving as an appliance, with no display</li> + <li>{@code watch}: Device has a display and is worn on the wrist</li> </ul> - <p><em>Added in API level 8, television added in API 13.</em></p> + <p><em>Added in API level 8, television added in API 13, watch added in API 20.</em></p> <p>For information about how your app can respond when the device is inserted into or removed from a dock, read <a href="{@docRoot}training/monitoring-device-state/docking-monitoring.html">Determining diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd index 4bd752f..c868080 100644 --- a/docs/html/guide/topics/ui/accessibility/services.jd +++ b/docs/html/guide/topics/ui/accessibility/services.jd @@ -81,7 +81,8 @@ as shown in the following sample:</p> <pre> <application> <service android:name=".MyAccessibilityService" - android:label="@string/accessibility_service_label"> + android:label="@string/accessibility_service_label" + android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"> <intent-filter> <action android:name="android.accessibilityservice.AccessibilityService" /> </intent-filter> diff --git a/docs/html/guide/topics/ui/drag-drop.jd b/docs/html/guide/topics/ui/drag-drop.jd index e989374..9a6b0e9 100644 --- a/docs/html/guide/topics/ui/drag-drop.jd +++ b/docs/html/guide/topics/ui/drag-drop.jd @@ -873,7 +873,7 @@ imageView.setOnDragListener(mDragListen); ... -protected class myDragEventListener implements View.OnDragEventListener { +protected class myDragEventListener implements View.OnDragListener { // This is the method that the system calls when it dispatches a drag event to the // listener. @@ -899,18 +899,15 @@ protected class myDragEventListener implements View.OnDragEventListener { v.invalidate(); // returns true to indicate that the View can accept the dragged data. - return(true); + return true; - } else { + } - // Returns false. During the current drag and drop operation, this View will - // not receive events again until ACTION_DRAG_ENDED is sent. - return(false); + // Returns false. During the current drag and drop operation, this View will + // not receive events again until ACTION_DRAG_ENDED is sent. + return false; - } - break; - - case DragEvent.ACTION_DRAG_ENTERED: { + case DragEvent.ACTION_DRAG_ENTERED: // Applies a green tint to the View. Return true; the return value is ignored. @@ -919,79 +916,70 @@ protected class myDragEventListener implements View.OnDragEventListener { // Invalidate the view to force a redraw in the new tint v.invalidate(); - return(true); - - break; + return true; - case DragEvent.ACTION_DRAG_LOCATION: + case DragEvent.ACTION_DRAG_LOCATION: // Ignore the event - return(true); - - break; - - case DragEvent.ACTION_DRAG_EXITED: - - // Re-sets the color tint to blue. Returns true; the return value is ignored. - v.setColorFilter(Color.BLUE); - - // Invalidate the view to force a redraw in the new tint - v.invalidate(); + return true; - return(true); + case DragEvent.ACTION_DRAG_EXITED: - break; - - case DragEvent.ACTION_DROP: + // Re-sets the color tint to blue. Returns true; the return value is ignored. + v.setColorFilter(Color.BLUE); - // Gets the item containing the dragged data - ClipData.Item item = event.getClipData().getItemAt(0); + // Invalidate the view to force a redraw in the new tint + v.invalidate(); - // Gets the text data from the item. - dragData = item.getText(); + return true; - // Displays a message containing the dragged data. - Toast.makeText(this, "Dragged data is " + dragData, Toast.LENGTH_LONG); + case DragEvent.ACTION_DROP: - // Turns off any color tints - v.clearColorFilter(); + // Gets the item containing the dragged data + ClipData.Item item = event.getClipData().getItemAt(0); - // Invalidates the view to force a redraw - v.invalidate(); + // Gets the text data from the item. + dragData = item.getText(); - // Returns true. DragEvent.getResult() will return true. - return(true); + // Displays a message containing the dragged data. + Toast.makeText(this, "Dragged data is " + dragData, Toast.LENGTH_LONG); - break; + // Turns off any color tints + v.clearColorFilter(); - case DragEvent.ACTION_DRAG_ENDED: + // Invalidates the view to force a redraw + v.invalidate(); - // Turns off any color tinting - v.clearColorFilter(); + // Returns true. DragEvent.getResult() will return true. + return true; - // Invalidates the view to force a redraw - v.invalidate(); + case DragEvent.ACTION_DRAG_ENDED: - // Does a getResult(), and displays what happened. - if (event.getResult()) { - Toast.makeText(this, "The drop was handled.", Toast.LENGTH_LONG); + // Turns off any color tinting + v.clearColorFilter(); - } else { - Toast.makeText(this, "The drop didn't work.", Toast.LENGTH_LONG); + // Invalidates the view to force a redraw + v.invalidate(); - }; + // Does a getResult(), and displays what happened. + if (event.getResult()) { + Toast.makeText(this, "The drop was handled.", Toast.LENGTH_LONG); - // returns true; the value is ignored. - return(true); + } else { + Toast.makeText(this, "The drop didn't work.", Toast.LENGTH_LONG); - break; + } - // An unknown action type was received. - default: - Log.e("DragDrop Example","Unknown action type received by OnDragListener."); + // returns true; the value is ignored. + return true; + // An unknown action type was received. + default: + Log.e("DragDrop Example","Unknown action type received by OnDragListener."); break; - }; - }; + } + + return false; + } }; </pre> diff --git a/docs/html/images/google/datastore-logo.png b/docs/html/images/google/datastore-logo.png Binary files differnew file mode 100644 index 0000000..a0fc0a0 --- /dev/null +++ b/docs/html/images/google/datastore-logo.png diff --git a/docs/html/images/google/gcs-small.png b/docs/html/images/google/gcs-small.png Binary files differnew file mode 100644 index 0000000..b8dbe0d --- /dev/null +++ b/docs/html/images/google/gcs-small.png diff --git a/docs/html/images/google/gcs.png b/docs/html/images/google/gcs.png Binary files differnew file mode 100644 index 0000000..7355d64 --- /dev/null +++ b/docs/html/images/google/gcs.png diff --git a/docs/html/images/gpfe-start-0.jpg b/docs/html/images/gpfe-start-0.jpg Binary files differindex e97381d..bb68aaa 100644 --- a/docs/html/images/gpfe-start-0.jpg +++ b/docs/html/images/gpfe-start-0.jpg diff --git a/docs/html/images/home/auto.png b/docs/html/images/home/auto.png Binary files differnew file mode 100644 index 0000000..7ea01b0 --- /dev/null +++ b/docs/html/images/home/auto.png diff --git a/docs/html/images/home/tv.png b/docs/html/images/home/tv.png Binary files differnew file mode 100644 index 0000000..3cf2034 --- /dev/null +++ b/docs/html/images/home/tv.png diff --git a/docs/html/images/home/wear.png b/docs/html/images/home/wear.png Binary files differnew file mode 100644 index 0000000..dfaded7 --- /dev/null +++ b/docs/html/images/home/wear.png diff --git a/docs/html/images/tools-home.png b/docs/html/images/tools-home.png Binary files differindex 291a361..86a7414 100644 --- a/docs/html/images/tools-home.png +++ b/docs/html/images/tools-home.png diff --git a/docs/html/images/tools/android-studio.png b/docs/html/images/tools/android-studio.png Binary files differdeleted file mode 100644 index 4d93a86..0000000 --- a/docs/html/images/tools/android-studio.png +++ /dev/null diff --git a/docs/html/images/tools/laptop-studio.png b/docs/html/images/tools/laptop-studio.png Binary files differnew file mode 100644 index 0000000..3684ff0 --- /dev/null +++ b/docs/html/images/tools/laptop-studio.png diff --git a/docs/html/images/tools/wizard2.png b/docs/html/images/tools/wizard2.png Binary files differnew file mode 100644 index 0000000..921d58c --- /dev/null +++ b/docs/html/images/tools/wizard2.png diff --git a/docs/html/images/tools/wizard3.png b/docs/html/images/tools/wizard3.png Binary files differnew file mode 100644 index 0000000..d5749d5 --- /dev/null +++ b/docs/html/images/tools/wizard3.png diff --git a/docs/html/images/tools/wizard4.png b/docs/html/images/tools/wizard4.png Binary files differnew file mode 100644 index 0000000..2709f7b --- /dev/null +++ b/docs/html/images/tools/wizard4.png diff --git a/docs/html/images/tools/wizard5.png b/docs/html/images/tools/wizard5.png Binary files differnew file mode 100644 index 0000000..105cf2a --- /dev/null +++ b/docs/html/images/tools/wizard5.png diff --git a/docs/html/images/tools/wizard6.png b/docs/html/images/tools/wizard6.png Binary files differnew file mode 100644 index 0000000..8b0691c --- /dev/null +++ b/docs/html/images/tools/wizard6.png diff --git a/docs/html/images/tools/wizard7.png b/docs/html/images/tools/wizard7.png Binary files differnew file mode 100644 index 0000000..83396cf --- /dev/null +++ b/docs/html/images/tools/wizard7.png diff --git a/docs/html/index.jd b/docs/html/index.jd index a4b0683..2f01538 100644 --- a/docs/html/index.jd +++ b/docs/html/index.jd @@ -1,159 +1,102 @@ fullpage=true page.viewport_width=970 -no_footer_links=true -carousel=true excludeFromSuggestions=true page.metaDescription=The official site for Android developers. Provides the Android SDK and documentation for app developers and designers. page.customHeadTag=<meta name="google-site-verification" content="sa-bIAI6GKvct3f61-WpRguHq-aNjtF7xJjMTSi79as" /> @jd:body - -<div class="wrap"> - <!-- Slideshow --> - <div class="slideshow-container slideshow-home col-16"> - <a href="" class="slideshow-prev">Prev</a> - <a href="" class="slideshow-next">Next</a> - <div class="frame"> - <ul> - <!-- set explicit widths as needed to prevent overflow issues --> - - - <li class="item carousel-home"> - <div class="content-left col-10" style="width:580px;"> - <a href="{@docRoot}wear/index.html"> - <img src="{@docRoot}images/home/aw_dac.png" style="margin-top:50px" > - </a> - </div> - <div class="content-right col-5" style="width:280px;"> - <h1>Introducing Android Wear</h1> - <p>We’re extending the Android platform to wearables. You can start building richer wearable experiences for your apps today using the enhanced Notification APIs in this Developer Preview.</p> - <p>We can’t wait to see what you will create.</p> - <p><a href="{@docRoot}wear/index.html" class="button">Learn more</a></p> - </div> - </li> - - - <li class="item carousel-home"> - <div class="content-left col-11" style="padding-top:65px;"> - <script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> - <div style="box-shadow: 3px 10px 18px 1px #999;width:600px;height:336px"> - <div id="ytapiplayer"> - <a href="http://www.youtube.com/watch?v=WWArLD6nqrk"><img width=600 src="{@docRoot}images/video-kiwi.jpg"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. --> - </div> - <script type="text/javascript"> - var params = { allowScriptAccess: "always" }; - var atts = { id: "ytapiplayer" }; - swfobject.embedSWF("//www.youtube.com/v/WWArLD6nqrk?enablejsapi=1&playerapiid=ytplayer&version=3&HD=1;rel=0;showinfo=0;modestbranding;origin=developer.android.com;autohide=1", - "ytapiplayer", "600", "336", "8", null, null, params, atts); - - // Callback used to pause/resume carousel based on video state - function onytplayerStateChange(newState) { - var isPaused = $("#pauseButton").hasClass("paused"); - if ((newState == 1) || (newState == 3)) { - // if playing or buffering, pause the carousel - if (!isPaused) { - $("#pauseButton").click(); - } - } else { - // otherwise, make sure carousel is running - if (isPaused) { - $("#pauseButton").click(); - } - } - } - - // Callback received when YouTube player loads to setup callback (above) - function onYouTubePlayerReady(playerId) { - var ytplayer = document.getElementById("ytapiplayer"); - ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); - } - - </script> - </div> - </div> - <div class="content-right col-4"> - <h1 style="white-space:nowrap;line-height:1.2em;">Developer Story: <br />Kiwi, Inc.</h1> - <p>Game developer Kiwi has had five titles in the top 25 grossing on Google Play. Hear how Google Play - has helped them double revenue every six months.</p> - <p><a href="{@docRoot}distribute/stories/index.html" class="button">Watch more videos </a></p> - </div> - </li> - - <li class="item carousel-home"> - <div class="content-left col-7" style="width:400px;"> - <a href="{@docRoot}about/versions/kitkat.html"> - <img src="{@docRoot}images/home/kk-hero.jpg" width="242" style="padding-top:72px;"> - </a> - </div> - <div class="content-right col-4" style="width:340px;"> - <h1>Android 4.4 KitKat!</h1> - <p>A new version of Android is here, with great new features, APIs, and tools for developers.</p> - <p>Android 4.4 is built to run on more devices than ever before, and gives you more ways to showcase your content and create beautiful, useful, and innovative apps.</p> - <p>Learn about what's new in the Platform Highlights and see the API Overview for details.</p> - <p><a href="{@docRoot}about/versions/kitkat.html" class="button">Check out the highlights</a></p> - </div> - </li> - - <li class="item carousel-home"> - <div class="content-left col-11" style="padding-top:65px;"> - <a href="https://www.youtube.com/watch?v=sONcojECWXs&list=PLWz5rJ2EKKc-2quE-o0enpILZF3nBZg_K&index=1"> - <img src="{@docRoot}images/title-devbytes-kk.jpg" style="margin-top:0px;width:600px;"> - </a> - </div> - <div class="content-right col-4"> - <h1 style="white-space:nowrap;line-height:1.2em;">DevBytes: <br />Android 4.4</h1> - <p>Join the DevBytes team for a look at what's new in Android 4.4 KitKat — new ways to make your apps beautiful, printing, storage access framework, and more.</p> - <p><a href="https://www.youtube.com/watch?v=sONcojECWXs&list=PLWz5rJ2EKKc-2quE-o0enpILZF3nBZg_K&index=1" class="button">Watch the video </a></p> - </div> - </li> - - <li class="item carousel-home"> - <div class="content-left col-19" style="width:580px;"> - <a href="{@docRoot}design/patterns/new.html"> - <img src="{@docRoot}design/media/design_elements_landing.png" style="margin-top:30px"> - </a> - </div> - <div class="content-right col-4" style="width:280px;"> - <h1>Design for Android KitKat</h1> - <p>Android KitKat brings a refreshed UI with updated styles, patterns, and gestures to use in your apps. </p> - <p>We've updated the Android Design guidelines and added new pages on branding, fullscreen, and more. </p> - <p><a href="{@docRoot}design/patterns/new.html" class="button">See what's new</a></p> - </div> - </li> - - <li class="item carousel-home"> - <div class="content-left col-11" style="padding-top:65px;"> - <a href="http://www.youtube.com/watch?v=6QHkv-bSlds&list=PLWz5rJ2EKKc8j2B95zGMb8muZvrIy-wcF&index=1"> - <img src="{@docRoot}images/title-adia-kk.png" style="margin-top:0px;width:600px;"> - </a> - </div> - <div class="content-right col-4"> - <h1 style="white-space:nowrap;line-height:1.2em;">ADIA: <br />Android 4.4</h1> - </p>Join the Android Design in Action team for a walkthrough of new developer features, UX changes, and updates to design guidelines in Android 4.4.</p> - <p><a href="http://www.youtube.com/watch?v=6QHkv-bSlds&list=PLWz5rJ2EKKc8j2B95zGMb8muZvrIy-wcF&index=1" class="button">Watch the video </a></p> - </div> - </li> - </ul> +<!-- Top full-bleed carousel --> +<div class="home-new-carousel-1" style="margin-top:40px"> + <div class="fullscreen-carousel-content"> + <div class="vcenter"> + <div class="wrap clearfix"> + + <div class="static resource-flow-layout wrap col-16"> + <div class="resource resource-card resource-card-18x6"> + <div class="card-bg" style="background-image: url('/preview/images/l-dev-prev.png');"></div> + <div class="card-info"> + <div class="section"></div> + <div class="title">Android L Developer Preview</div> + <div class="description ellipsis" style="height: 285px;"> + <div class="text" style="height: auto;"> + <p style="font-size:16px;">Get an early look at the next Android release and + start using new APIs so your apps are ready when the platform officially launches.</p> + <p> + <a href="{@docRoot}preview/index.html" class="landing-button landing-secondary">Learn more</a></p> + </div> + </div> + </div> + </div> </div> - </div> - -<!-- /End slideshow --> - <a href="" id="pauseButton" style="display:none">pause</a> - - -</div> -<div class="wrap" style="padding-bottom:20px"> - <!-- Section links --> - <div class="home-sections"> - <ul> - <li><a href="{@docRoot}about/index.html">About Android</a></li> - <li><a href="{@docRoot}sdk/index.html">Get the SDK</a></li> - <li><a href="http://source.android.com">Open Source</a></li> - <li><a href="{@docRoot}support.html">Support</a></li> - <li class="last"><a href="{@docRoot}legal.html">Legal</a></li> - </ul> - </div> - <!-- /Section links --> -</div> + <div class="resource-widget resource-flow-layout wrap col-16 no-section" + data-query="collection:index/primary" + data-resourceStyle="card" + data-sortOrder="-timestamp" + data-maxResults="3" + data-cardSizes="6x2,6x2,6x2"> + </div> <!-- end .resource-widget --> + </div> <!-- end .wrap --> + </div> <!-- end .vcenter --> + </div> <!-- end .fullscreen-carousel-content --> +</div> <!-- end .fullscreen-carousel --> + +<div class="actions-bar" style="margin-top:30px"> + <div class="wrap"> + <div class="actions"> + <div><a href="{@docRoot}sdk/index.html">Get the SDK</a></div> + <div><a href="{@docRoot}samples/index.html">Browse Samples</a></div> + <div><a href="//www.youtube.com/user/androiddevelopers">Watch Videos</a></div> + <div><a href="{@docRoot}distribute/googleplay/developer-console.html">Manage Your Apps</a></div> + </div><!-- end .actions --> + </div><!-- end .wrap --> +</div><!-- end .actions-bar --> + + + +<div class="landing-rest-of-page"> + <div class="landing-section"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Develop for Multiple Form Factors</div> + <div class="landing-subhead" style="margin-top: 20px;"> + Android runs on hundreds of millions of handheld devices around the world, <br /> + and it now supports these exciting, new form-factors. + </div> + </div> + <div class="landing-body" style="margin-top: 80px;"> + <div class="landing-breakout cols"> + <div class="col-3-wide"> + <img src="{@docRoot}images/home/wear.png"> + <p class="landing-small" style="margin-top:30px"> + Provide information on-the-go for your users, whenever they need it. + </p> + <p class="landing-small"> + <a href="{@docRoot}wear/index.html">Learn about Android Wear</a> + </p> + </div> + <div class="col-3-wide"> + <img src="{@docRoot}images/home/tv.png"> + <p class="landing-small" style="margin-top:30px"> + Build your apps for the big screen and bring your content to life. + </p> + <p class="landing-small"> + <a href="{@docRoot}tv/index.html">Learn about Android TV</a> + + </p> + </div> + <div class="col-3-wide"> + <img src="{@docRoot}images/home/auto.png"> + <p class="landing-small" style="margin-top:30px"> + Extend your music apps to automobile + entertainment systems. + </p> + <p class="landing-small"> + <a href="{@docRoot}auto/index.html">Learn about Android Auto</a> + </p> + </div> + </div> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section -->
\ No newline at end of file diff --git a/docs/html/jd_collections.js b/docs/html/jd_collections.js index 5ee01f3..a92236e 100644 --- a/docs/html/jd_collections.js +++ b/docs/html/jd_collections.js @@ -1,4 +1,20 @@ var RESOURCE_COLLECTIONS = { + "index/primary": { + "title": "", + "resources": [ + "distribute/essentials/quality/tablets.html", + "distribute/engage/game-services.html", + "distribute/googleplay/edu/about.html" + ] + }, + "index/devices": { + "title": "", + "resources": [ + "wear/index.html", + "tv/index.html", + "auto/index.html" + ] + }, "launch/static": { "title": "", "resources": [ @@ -29,14 +45,14 @@ var RESOURCE_COLLECTIONS = { "resources": [ "distribute/googleplay/edu/about.html", "distribute/googleplay/edu/start.html", - "distribute/googleplay/edu/faq.html" + "https://developers.google.com/edu/faq" ] }, "distribute/essentials": { "resources": [ "distribute/essentials/quality/core.html", "distribute/essentials/quality/tablets.html", - "distribute/essentials/gpfe-guidelines.html", + "https://developers.google.com/edu/guidelines", "distribute/essentials/optimizing-your-app.html", "distribute/essentials/best-practices/apps.html", "distribute/essentials/best-practices/games.html" @@ -149,16 +165,18 @@ var RESOURCE_COLLECTIONS = { "title": "About Google Play for Education / Developers", "resources": [ "distribute/googleplay/edu/start.html", - "distribute/essentials/gpfe-guidelines.html", - "distribute/googleplay/edu/faq.html", - "distribute/essentials/quality/tablets.html" + "https://developers.google.com/edu/guidelines", + "https://developers.google.com/edu/faq", + "distribute/essentials/quality/tablets.html", + "https://developers.google.com/edu/", + "https://www.google.com/edu/tablets/#tablets-family" ] }, "distribute/googleplay/gpfe/dev": { "title": "About Google Play for Education / Developers", "resources": [ "distribute/googleplay/edu/about.html", - "distribute/essentials/gpfe-guidelines.html", + "https://developers.google.com/edu/guidelines", "distribute/essentials/quality/tablets.html", "distribute/googleplay/developer-console.html", "http://play.google.com/about/developer-distribution-agreement-addendum.html", @@ -190,7 +208,7 @@ var RESOURCE_COLLECTIONS = { "resources": [ "distribute/googleplay/developer-console.html", "distribute/googleplay/edu/start.html", - "distribute/googleplay/edu/faq.html" + "https://developers.google.com/edu/faq" ] }, "distribute/essentials/eduessentials/educators": { @@ -570,7 +588,7 @@ var RESOURCE_COLLECTIONS = { "resources": [ "distribute/essentials/quality/core.html", "distribute/essentials/quality/tablets.html", - "distribute/essentials/gpfe-guidelines.html" + "https://developers.google.com/edu/guidelines" ] }, "distribute/toolsreference/launchchecklist/rating": { diff --git a/docs/html/jd_extras.js b/docs/html/jd_extras.js index d8db5bf..03bbea1 100644 --- a/docs/html/jd_extras.js +++ b/docs/html/jd_extras.js @@ -15,6 +15,17 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([ { + "title":"Android L Developer Preview", + "titleFriendly":"", + "summary":"<p style='font-size:18px;'>Get an early look at the next release and get your apps ready when the platform officially launches.</p>", + "url":"preview/index.html", + "group":"", + "keywords": [], + "tags": [], + "image":"preview/images/l-dev-prev.png", + "type":"" + }, + { "title":"Developer Registration", "titleFriendly":"", "summary":"Additional information about the registration process.", @@ -208,7 +219,7 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([ "keywords": [], "type": "support", "titleFriendly": "" - }, + }, { "lang": "en", "group": "", @@ -571,7 +582,7 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([ "image":"http://chart.googleapis.com/chart?chl=GL%201.1%20only%7CGL%202.0%7CGL%203.0&chf=bg%2Cs%2C00000000&chd=t%3A0.1%2C93.5%2C6.4&chco=c4df9b%2C6fad0c&chs=400x250&cht=p", "lang":"en", "type":"about" - }, + }, { "lang": "en", "group": "", @@ -700,7 +711,7 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([ "timestamp": 1383243492000, "image": "http://i1.ytimg.com/vi/vzvpcEffvaE/maxresdefault.jpg", "title": "Introducing Google Play for Education", - "summary": "Google Play for Education is a destination where schools can find great, teacher-approved, educational apps and videos on Play Store. Teachers can filter content by subject matter, grade and other criteria. Bulk purchase and instant distribution let educators bring your apps directly to classrooms and schools.", + "summary": "Google Play for Education is a destination where schools can find great, teacher-approved, educational content—from videos and books, to educational apps—all in one place. Teachers can filter content by subject matter, grade and other criteria. Bulk purchase and instant distribution let educators bring your apps directly to classrooms and schools.", "keywords": [], "type": "youtube", "titleFriendly": "" @@ -1128,5 +1139,57 @@ DISTRIBUTE_RESOURCES = DISTRIBUTE_RESOURCES.concat([ "keywords": ["analytics, user behavior"], "type": "sdk", "titleFriendly": "" + }, + { + "lang": "en", + "group": "", + "tags": [], + "url": "https://developers.google.com/edu/guidelines", + "timestamp": null, + "image": "http://developer.android.com/distribute/images/edu-guidelines.jpg", + "title": "Education Guidelines", + "summary": "These guidelines and requirements help you develop great apps for students, which offer compelling content and an intuitive user experience on Android tablets.", + "keywords": [], + "type": "", + "titleFriendly": "" + }, + { + "lang": "en", + "group": "", + "tags": [], + "url": "https://developers.google.com/edu/faq", + "timestamp": null, + "image": "http://developer.android.com/distribute/images/gpfe-faq.jpg", + "title": "Education FAQ", + "summary": "Answers to common questions you might have about Google Play for Education.", + "keywords": [], + "type": "", + "titleFriendly": "" + }, + { + "lang": "en", + "group": "", + "tags": [], + "url": "https://developers.google.com/edu/", + "timestamp": null, + "image": "https://developers.google.com/edu/images/home-android.png", + "title": "Chrome Apps in Google Play for Education", + "summary": "Find out more about Chrome apps in Google Play for Education.", + "keywords": [], + "type": "", + "titleFriendly": "" + }, + { + "lang": "en", + "group": "", + "tags": [], + "url": "https://www.google.com/edu/tablets/#tablets-family", + "timestamp": null, + "image": "https://www.google.com/edu/images/tablets/big-tablet.png", + "title": "Google Play for Education Tablets", + "summary": "Google Play for Education leverages a diverse set up tablets approved for the classroom which may help inform you how to build educational apps.", + "keywords": [], + "type": "", + "titleFriendly": "" } -]);
\ No newline at end of file +]);
\ No newline at end of file diff --git a/docs/html/jd_tag_helpers.js b/docs/html/jd_tag_helpers.js index ca01386..7538e4d 100644 --- a/docs/html/jd_tag_helpers.js +++ b/docs/html/jd_tag_helpers.js @@ -7,6 +7,7 @@ function mergeArrays() { } var ALL_RESOURCES = mergeArrays( + ABOUT_RESOURCES, DESIGN_RESOURCES, DISTRIBUTE_RESOURCES, GOOGLE_RESOURCES, @@ -63,6 +64,7 @@ function buildResourceLookupMap(resourceDict) { // Type lookups var ALL_RESOURCES_BY_TYPE = { + 'about': ABOUT_RESOURCES, 'design': DESIGN_RESOURCES, 'distribute': DISTRIBUTE_RESOURCES, 'google': GOOGLE_RESOURCES, @@ -78,6 +80,7 @@ var IS_RESOURCE_OF_TYPE = buildResourceLookupMap(ALL_RESOURCES_BY_TYPE); // Tag lookups var ALL_RESOURCES_BY_TAG = mergeMaps( + {map:ABOUT_BY_TAG,arr:ABOUT_RESOURCES}, {map:DESIGN_BY_TAG,arr:DESIGN_RESOURCES}, {map:DISTRIBUTE_BY_TAG,arr:DISTRIBUTE_RESOURCES}, {map:GOOGLE_BY_TAG,arr:GOOGLE_RESOURCES}, diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd new file mode 100644 index 0000000..20764be --- /dev/null +++ b/docs/html/preview/api-overview.jd @@ -0,0 +1,914 @@ +page.title=API Overview +excludeFromSuggestions=true +sdk.platform.apiLevel=20 +@jd:body + + +<div id="qv-wrapper"> +<div id="qv"> + +<h2>In this document + <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> + <span class="more">show more</span> + <span class="less" style="display:none">show less</span></a></h2> + +<ol id="toc44" class="hide-nested"> + <li><a href="#Behaviors">Important Behavior Changes</a> + <ol> + <li><a href="#ART">New Android Runtime (ART)</a></li> + <li><a href="#BehaviorNotifications">If your app implements notifications...</a></li> + <li><a href="#BehaviorMediaControl">If your app uses RemoteControlClient...</a></li> +<li><a href="#BehaviorGetRecentTasks">If your app uses ActivityManager.getRecentTasks()...</a></li> + </ol> + </li> + <li><a href="#UI">User Interface</a> + <ol> + <li><a href="#MaterialDesign">Material design support</a></li> + <li><a href="#LockscreenNotifications">Lockscreen notifications</a></li> + <li><a href="#NotificationsMetadata">Notifications metadata</a></li> + <li><a href="#Recents">Concurrent documents and activities in the Recents screen</a></li> + <li><a href="#WebView">WebView updates</a></li> + </ol> + </li> + <li><a href="#UserInput">User Input</a> + <ol> + <li><a href="#IME">IME bug fixes and improvements</a></li> + </ol> + </li> + <li><a href="#Animations">Animation & Graphics</a> + <ol> + <li><a href="#OpenGLES-3-1">Support for OpenGL ES 3.1</a></li> + <li><a href="#AndroidExtensionPack">Android Extension Pack</a></li> + </ol> + </li> + <li><a href="#Multimedia">Multimedia</a> + <ol> + <li><a href="#Camera-v2">Camera API for advanced camera capabilities</a></li> + <li><a href="#AudioPlayback">Audio playback</a></li> + <li><a href="#MediaPlaybackControl">Media playback control</a></li> + </ol> + </li> + <li><a href="#Storage">Storage</a> + <ol> + <li><a href="#DirectorySelection">Directory selection</a></li> + </ol> + </li> + <li><a href="#Wireless">Wireless and Connectivity</a> + <ol> + <li><a href="#Multinetwork">Multiple network connections</a></li> + <li><a href="#BluetoothBroadcasting">Bluetooth broadcasting</a></li> + <li><a href="#NFCEnhancements">NFC enhancements</a></li> + </ol> + </li> + <li><a href="#Power">Power Efficiency</a> + <ol> + <li><a href="#JobScheduler">Scheduling Jobs</a></li> + <li><a href="#PowerMeasurementTools">Developer tools for power measurement</a> + </ol> + </li> + <li><a href="#Enterprise">Enterprise</a> + <ol> + <li><a href="#ManagedProvisioning">Managed provisioning</a></li> + <li><a href="#TaskLocking">Task locking</a></li> + </ol> + </li> + <li><a href="#Printing">Printing Framework</a> + <ol> + <li><a href="#PDFRender">Render PDF as bitmap</a></li> + </ol> + </li> + <li><a href="#TestingA11y">Testing & Accessibility</a> + <ol> + <li><a href="#TestingA11yImprovements">Testing and accessibility improvements</a></li> + </ol> + </li> + <li><a href="#Manifest">Manifest Declarations</a> + <ol> + <li><a href="#ManifestFeatures">Declarable required features</a></li> + </ol> + </li> +</ol> + +</div> +</div> + +<p>The L Developer Preview gives you an advance look at the upcoming release +for the Android platform, which offers new features for users and app +developers. This document provides an introduction to the most notable APIs.</p> + +<p>The L Developer Preview is intended for <strong>developer early +adopters</strong> and <strong>testers</strong>. If you are interested in +influencing the direction of the Android framework, +<a href="{@docRoot}preview/setup-sdk.html">give the L Developer Preview a +try</a> and send us your feedback!</p> + +<p class="caution"><strong>Caution:</strong> Do not not publish apps +that use the L Developer Preview to the Google Play store.</p> + +<p class="note"><strong>Note:</strong> This document often refers to classes and +methods that do not yet have reference material available on <a +href="{@docRoot}">developer.android.com</a>. These API elements are +formatted in {@code code style} in this document (without hyperlinks). For the +preliminary API documentation for these elements, download the <a +href="{@docRoot}preview/l-developer-preview-reference.zip">preview +reference</a>.</p> + +<h2 id="Behaviors">Important Behavior Changes</h2> + +<p>If you have previously published an app for Android, be aware that your app + might be affected by changes in the upcoming release.</p> + +<h3 id="ART">New Android Runtime (ART)</h3> + +<p>The 4.4 release introduced a new, experimental Android runtime, ART. Under +4.4, ART was optional, and the default runtime remained Dalvik. With the L +Developer Preview, ART is now the default runtime.</p> + +<p>For an overview of ART's new features, see +<a href="https://source.android.com/devices/tech/dalvik/art.html">Introducing +ART</a>. Some of the major new features are:</p> + +<ul> + <li>Ahead-of-Time (AOT) compilation</li> + <li>Improved garbage collection (GC)</li> + <li>Improved debugging support</li> +</ul> + +<p>Most Android apps should just work without change under ART. However, some +techniques that work on Dalvik do not work on ART. For information about the +most important issues, see +<a href="{@docRoot}guide/practices/verifying-apps-art.html">Verifying App +Behavior on the Android Runtime (ART)</a>. Pay particular attention if:</p> + +<ul> + <li>Your app uses Java Native Interface (JNI) to run C/C++ code.</li> + <li>You use development tools that generate non-standard code (such as some + obfuscators).</li> + <li>You use techniques that are incompatible with compacting garbage + collection. (ART does not currently implement compacting GC, but + compacting GC is under development in the Android Open-Source + Project.)</li> +</ul> + +<h3 id="BehaviorNotifications">If your app implements notifications...</h3> + +<p>Notifications are drawn with dark text atop white (or very light) +backgrounds to match the new material design widgets. Make sure that all your +notifications look right with the new color scheme:</p> + +<div class="figure" style="width:320px"> + <img src="images/hun-example.png" + srcset="images/hun-example@2x.png 2x" + alt="" width="320" height="541" id="figure1" /> + <p class="img-caption"> + <strong>Figure 1.</strong> Fullscreen activity showing a heads-up notification + </p> +</div> + +<ul> + + <li>Update or remove assets that involve color.</li> + + <li>The system automatically inverts action icons in notifications. Use + {@code android.app.Notification. Builder.setColor()} to set an accent color + in a circle behind your {@link android.app.Notification#icon} image.</li> + + <li>The system ignores all non-alpha channels in action icons and the main + notification icon. You should assume that these icons are alpha-only.</li> + +</ul> + +<p>If you are currently adding sounds and vibrations to your notifications by +using the {@link android.media.Ringtone}, {@link android.media.MediaPlayer}, +or {@link android.os.Vibrator} classes, remove this code so that +the system can present notifications correctly in Do +not Disturb mode. Instead, use the {@link android.app.Notification.Builder} +methods instead to add sounds and vibration.</p> + +<p>Notifications now appear in a small floating window +(also called a <em>heads-up notification</em>) when the device is active +(that is, the device is unlocked and its screen is on). These notifications +appear similar to the compact form of your notification, except that the +heads-up notification also shows action buttons. Users can act on, or dismiss, +a heads-up notification without leaving the current app.</p> + +<p>Examples of conditions that may trigger heads-up notifications include:</p> + +<ul> + <li>The user's activity is in fullscreen mode (the app uses +{@link android.app.Notification#fullScreenIntent}), or</li> + <li>The notification has high priority and uses ringtones or + vibrations</li> +</ul> + +<p>If your app implements notifications under those scenarios, make sure that +heads-up notifications are presented correctly.</p> + +<h3 id="BehaviorMediaControl">If your app uses RemoteControlClient...</h3> + +<p>Lockscreens in the L Developer Preview do not show transport controls for +your {@link android.media.RemoteControlClient}. Instead, your app can provide +media playback control from the lockscreen through a notification. This +gives your app more control over the presentation of media buttons, while +providing a consistent experience for users across the lockscreen and +unlocked device.</p> + +<p>The L Developer Preview introduces a new +{@code android.app.Notification.MediaStyle} template which is recommended for +this purpose. {@code MediaStyle} converts notification actions that you added +with +{@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, + android.app.PendingIntent) +Notification.Builder.addAction()} into compact buttons embedded in your app's +media playback notifications.</p> + +<p>If you are using the new +{@code android.media.session.MediaSession} class +(see <a href="#MediaPlaybackControl">Media Playback Control</a> below), attach +your session token with {@code Notification.MediaStyle.setMediaToken()} to +inform the system that this notification controls an ongoing media session.</p> + +<p>Call {@code +Notification.Builder.setVisibility(Notification.VISIBILITY_PUBLIC)} to mark a +notification as safe to show atop any lockscreen (secure or otherwise). For more +information, see <a href="#LockscreenNotifications">Lockscreen Notifications</a>.</p> + +<h3 id="BehaviorGetRecentTasks">If your app uses ActivityManager.getRecentTasks()...</h3> + +<p>With the introduction of the new <em>concurrent documents and activities +tasks</em> feature in the upcoming release (see <a href="#Recents">Concurrent +documents and activities in Recents screen</a> below), +the {@link android.app.ActivityManager#getRecentTasks +ActivityManager.getRecentTasks()} method is now deprecated to improve user +privacy. For backward compatibility, this method still returns a small subset of +its data, including the calling application’s own tasks and possibly some other +non-sensitive tasks (such as Home). If your app is using this method to retrieve +its own tasks, use {@code android.app.ActivityManager.getAppTasks()} instead to +retrieve that information.</p> + +<h2 id="UI">User Interface</h2> + +<h3 id="MaterialDesign">Material design support</h3> + +<p>The upcoming release adds support for Android's new <em>material</em> design +style. You can create apps with material design that are visually dynamic and +have UI element transitions that feel natural to users. This support includes:</p> + +<ul> + + <li>The material theme</li> + <li>View shadows</li> + <li>The {@code RecyclerView} widget</li> + <li>Drawable animation and styling effects</li> + <li>Material design animation and activity transition effects</li> + <li>Animators for view properties based on the state of a view</li> + <li>Customizable UI widgets and app bars with color palettes that you control</li> +</ul> + +<p>To learn more about adding material design functionality to your app, see +<a href="{@docRoot}preview/material/index.html">Material Design</a>.</p> + +<h3 id="LockscreenNotifications">Lockscreen notifications</h3> +<p>Lockscreens in the L Developer Preview have the ability to present +notifications. Users can choose via <em>Settings</em> whether to allow +sensitive notification content to be shown over a secure lockscreen.</p> + +<p>Your app can control the level of detail visible when its notifications are +displayed over the secure lockscreen. To control the visibility level, call +{@code android.app.Notification.Builder.setVisibility()} and specify one of these +values:</p> + +<ul> +<li>{@code VISIBILITY_PRIVATE}. Shows basic information, such as the +notification’s icon, but hides the notification’s full content.</li> +<li>{@code VISIBILITY_PUBLIC}. Shows the notification’s full content.</li> +<li>{@code VISIBILITY_SECRET}. Shows nothing, excluding even the +notification’s icon.</li> +</ul> + +<p>When {@code VISIBILITY_PRIVATE} is set, you can also provide a redacted +version of the notification content that hides personal details. For example, +an SMS app might display a notification that shows "You have 3 new text messages." +but hides the message content and senders. To provide this alternative +notification, first create the replacement notification using +{@link android.app.Notification.Builder}. When you create the private +notification object, attach the replacement notification to it through the +{@code Notification.Builder.setPublicVersion()} method.</p> + +<h3 id="NotificationsMetadata">Notifications metadata</h3> +<p>The L Developer Preview uses metadata associated with your app notifications +to sort the notifications more intelligently. The metadata you set also +controls how the system presents your app notifications when the user is in <em>Do +Not Disturb</em> mode. To set the metadata, call the following methods in +{@code android.app.Notification.Builder} when you construct the +notification:</p> + +<ul> +<li>{@code setCategory()}. Depending on the message category, this tells +the system how to handle your app notifications when the device is +in <em>Do not Disturb</em> mode (for example, if your notification represents an +incoming call, instant message, or alarm). +<li>{@code setPriority()}. Notifications with the priority field set to +{@code PRIORITY_MAX} or {@code PRIORITY_HIGH} will appear in a small floating +window if the notification also has sound or vibration.</li> +<li>{@code addPerson()}. Allows you to add a list of people to a notification. +Your app can use this to signal to the system that it should group together +notifications from the specified people, or rank notifications from these +people as being more important.</li> +</ul> + +<h3 id="Recents">Concurrent documents and activities in the Recents screen</h3> + +<p>In previous releases, the +<a href="{@docRoot}design/get-started/ui-overview.html">Recents screen</a> +could only display a single task for each app that the user interacted with +most recently. The L Developer Preview enables your app to open more tasks as +needed for additional concurrent activities for documents. +This feature facilitates multitasking +by letting users quickly switch between individual activities and documents +from the Recents screen, with a consistent switching experience across all apps. +Examples of such concurrent tasks might include open tabs in a web +browser app, documents in a productivity app, concurrent matches in +a game, or chats in a messaging app. Your app can manage its tasks +through the {@code android.app.ActivityManager.AppTask} class.</p> + +<p>To insert a logical break so that the system treats your activity as a new +task, use {@code android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT} when +launching the activity with {@link android.app.Activity#startActivity(android.content.Intent) +startActivity()}. You can also get this behavior by declaring the +<a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> +attribute {@code documentLaunchMode="intoExisting"} or {@code ="always"} in your +manifest.</p> + +<p>You can also mark that a task should be removed from the Recents screen +when all its activities are closed. To do this, use {@code +android.content.Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS} when starting the +root activity for +the task. You can also set this behavior for an activity by declaring the +<a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> +attribute {@code autoRemoveFromRecents=“true”} in your manifest.</p> + +<p>To avoid cluttering the Recents screen, you can set the maximum number of +tasks from your app that can appear in that screen. To do this, set the +<a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a> +attribute {@code android:maxRecent}. The current maximum that can be specified +is 100 tasks per user.</a></p> + +<h3 id="WebView">WebView updates</h3> +<p>The L Developer Preview updates the {@link android.webkit.WebView} +implementation to Chromium M36, bringing security and stability enhancements, +as well as bug fixes. The default user-agent string for a +{@link android.webkit.WebView} running on the L Developer Preview has +been updated to incorporate 36.0.0.0 as the version number.</p> + +<p>Additionally, this release brings support for the +<a href="https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html">WebAudio</a>, +<a href="https://www.khronos.org/webgl/">WebGL</a>, and +<a href="http://www.webrtc.org/">WebRTC</a> open standards. To learn more about +the new features included in this release, see <a href="https://developer.chrome.com/multidevice/webview/overview">WebView for Android</a>.</p> + +<h2 id="UserInput">User Input</h2> + +<h3 id="IME">IME bug fixes and improvements</h3> + +<p>Beginning in the L Developer Preview, users can more easily switch between +all <a href="{@docRoot}guide/topics/text/creating-input-method.html">input +method editors (IME)</a> supported by the platform. Performing the designated +switching action (usually touching a Globe icon on the soft keyboard) will cycle +among all such IMEs. This change takes place in +{@link android.view.inputmethod.InputMethodManager#shouldOfferSwitchingToNextInputMethod +InputMethodManager.shouldOfferSwitchingToNextInputMethod()}.</p> + +<p>In addition, the framework now checks whether the next IME includes a +switching mechanism at all (and, thus, whether that IME supports switching to +the IME after it). An +IME with a switching mechanism will not cycle to an IME without one. This +change takes place in +{@link android.view.inputmethod.InputMethodManager#switchToNextInputMethod +InputMethodManager.switchToNextInputMethod}. + +<p>To see an example of how to use the updated IME-switching APIs, refer to the +updated soft-keyboard implementation sample in this release.</p> + +<h2 id="Animations">Animation & Graphics</h2> + +<h3 id="OpenGLES-3-1">Support for OpenGL ES 3.1</h3> +<p>The L Developer Preview adds Java interfaces and native support for OpenGL +ES 3.1. Key new functionality provided in OpenGL ES 3.1 includes:</p> + +<ul> +<li>Compute shaders +<li>Separate shader objects +<li>Indirect draw commands +<li>Multisample and stencil textures +<li>Shading language improvements +<li>Extensions for advanced blend modes and debugging +<li>Backward compatibility with OpenGL ES 2.0 and 3.0 +</ul> + +<p>The Java interface for OpenGL ES 3.1 on Android is provided with {@code GLES31}. When +using OpenGL ES 3.1, be sure that you declare it in your manifest file with the +<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> +tag and the {@code android:glEsVversion} attribute. For example:</p> + +<pre> +<manifest> + <uses-feature android:glEsVersion="0x00030001" /> + ... +</manifest> +</pre> + +<p>For more information about using OpenGL ES, including how to check the +device’s supported OpenGL ES version at runtime, see the +<a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API guide</a>.</p> + +<h3 id="AndroidExtensionPack">Android Extension Pack</h3> + +<p>In addition to OpenGL ES 3.1, this release provides an extension pack with Java interfaces and +native support for advanced graphics functionality. These extensions are treated as a single +package by Android. (If the {@code ANDROID_extension_pack_es31} extension is present, your app can +assume all extensions in the package are present and enable the shading language features with +a single {@code #extension} statement.</p> +<p>The extension pack supports:</p> +<ul> +<li>Guaranteed fragment shader support for shader storage buffers, images, and + atomics (fragment shader support is optional in OpenGL ES 3.1.)</li> +<li>Tessellation and geometry shaders</li> +<li>ASTC (LDR) texture compression format</li> +<li>Per-sample interpolation and shading</li> +<li>Different blend modes for each color attachment in a frame buffer</li> +</ul> + +<p>The Java interface for the extension pack is provided with {@code GLES31Ext}. +In your app manifest, you can declare that support for the extension pack is +required, with the +<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> +tag, but the precise syntax is not finalized in the L Developer Preview.</p> + +<h2 id="Multimedia">Multimedia</h2> + +<h3 id="Camera-v2">Camera API for advanced camera capabilities</h3> + +<p>The L Developer Preview introduces the new {@code android.hardware.camera2} +API to facilitate fine-grain photo capture and image processing. You can now +programmatically access the camera devices available to the system with {@code +CameraManager.getCameraIdList()} and connect to a specific device with {@code +CameraManager.openCamera()}. To start capturing images, create a {@code +CameraCaptureSession} and specify the {@link android.view.Surface} objects for +the captured images. The {@code CameraCaptureSession} can be configured to take +single shots or multiple images in a burst.</p> + +<p>To be notified when new images are captured, implement the +{@code CameraCaptureSession.CaptureListener()} interface and set it in your +capture request. Now when the system completes the image capture request, your +{@code CameraCaptureSession.CaptureListener()} receives a call to +{@code onCaptureCompleted()}, providing you with the image capture metadata in a +{@code CaptureResult}.</p> + +<p>To see an example of how to use the updated Camera API, refer to the {@code Camera2Basic} +and {@code Camera2Video} implementation samples in this release.</p> + +<h3 id="AudioPlayback">Audio playback</h3> +<p>This release includes the following changes to + {@link android.media.AudioTrack}:</p> +<ul> + <li>Your app can now supply audio data in floating-point format +({@code android.media.AudioFormat.ENCODING_PCM_FLOAT}). This permits greater +dynamic range, more consistent precision, and greater headroom. Floating-point +arithmetic is especially useful during intermediate calculations. Playback +end-points use integer format for audio data, and with lower bit-depth. (In the +L Developer Preview, portions of the internal pipeline are not yet +floating-point.) + <li>Your app can now supply audio data as a {@link java.nio.ByteBuffer}, in +the same format as provided by {@link android.media.MediaCodec}. + <li>The {@code WRITE_NON_BLOCKING} option can simplify buffering and + multithreading for some apps. +</ul> + +<h3 id="MediaPlaybackControl">Media playback control</h3> +<p>You can now build your own media controller app with the new +{@code android.media.session.MediaController} class, which provides +simplified transport controls APIs that replace those in +{@link android.media.RemoteControlClient}. The {@code MediaController} class +allows thread-safe control of playback from a non-UI process, making it easier +to control your media playback service from your app’s user interface. + +<p>You can also create multiple controllers to send playback commands, +media keys, and other events to the same ongoing +{@code android.media.session.MediaSession}. When you add a controller, you must +call {@code MediaSession.getSessionToken()} to request an access +token in order for your app to interact with the session.</p> + +<p>You can now send transport commands such as "play", "stop", "skip", and +"set rating" by using {@code MediaController.TransportControls}. To handle +in-bound media transport commands from controllers attached to the session, +override the callback methods in +{@code MediaSession.TransportControlsCallback}.</p> + +<p>You can also create rich notifications that allow playback control tied to a +media session with the new {@code android.app.Notification.MediaStyle} class. By +using the new notification and media APIs, you will ensure that the System UI +knows about your playback and can extract and show album art.</p> + +<h2 id="Storage">Storage</h2> + +<h3 id="DirectorySelection">Directory selection</h3> + +<p>The L Developer Preview extends the <a href="{@docRoot}guide/topics/providers/document-provider.html">Storage Access Framework</a> to let users select an entire directory subtree, +giving apps read/write access to all contained documents without requiring user +confirmation for each item.</p> + +<p>To select a directory subtree, build and send an +{@code android.intent.action.OPEN_DOCUMENT_TREE} {@link android.content.Intent}. +The system displays all +{@link android.provider.DocumentsProvider} instances that support subtree selection, +letting the user browse and select a directory. The returned URI represents access to the selected +subtree. You can then use {@code DocumentsContract.buildChildDocumentsUriUsingTree()} +and {@code DocumentsContract.buildDocumentUriUsingTree()} along with +{@code ContentResolver.query()} to explore the subtree.</p> + +<p>The new {@code DocumentsContract.createDocument()} method lets you create +new documents or directories anywhere under the subtree. To manage +existing documents, use {@code DocumentsContract.renameDocument()} and +{@code DocumentsContract.deleteDocument()}. Check {@code DocumentsContract.Document.COLUMN_FLAGS} +to verify provider support for these calls before issuing them.</p> + +<p>If you're implementing a {@link android.provider.DocumentsProvider} and want +to support subtree selection, implement {@code DocumentsProvider.isChildDocument()} +and include {@code Documents.Contract.FLAG_SUPPORTS_IS_CHILD} in your +{@code Root.COLUMN_FLAGS}.</p> + +<p>The L Developer Preview also introduces new package-specific directories on +shared storage where your app can place media files for inclusion in +{@link android.provider.MediaStore}. The new +{@code android.content.Context.getExternalMediaDirs()} returns paths to these +directories on all shared storage devices. Similarly to +{@link android.content.Context#getExternalFilesDir(java.lang.String) Context.getExternalFilesDir()}, +no additional permissions are needed by your app to access the returned paths. The +platform periodically scans for new media in these directories, but you can also +use {@link android.media.MediaScannerConnection} to explicitly scan for new +content.</p> + +<h2 id="Wireless">Wireless & Connectivity</h2> + +<h3 id="Multinetwork">Multiple network connections</h3> +<p>The L Developer Preview provides new multi-networking APIs. These let your app +dynamically scan for available networks with specific capabilities, and +establish a connection to them. This is useful when your app requires a +specialized network, such as an SUPL, MMS, or carrier-billing network, or if +you want to send data using a particular type of transport protocol.</p> + +<p>To select and connect to a network dynamically from your app follow these +steps:</p> + +<ol> + <li>Create a {@link android.net.ConnectivityManager}.</li> + <li>Create a + {@code android.net.NetworkRequest} to specify the network features and transport + type your app is interested in.</li> + <li>To scan for suitable networks, call + {@code ConnectivityManager.requestNetwork()} or + {@code ConnectivityManager.registerNetworkCallback()}, and pass in the + {@code NetworkRequest} object and an implementation of + {@code ConnectivityManager.NetworkCallbackListener}.</li> + +</ol> + +<p>When the system detects a suitable network, it connects to the network and +invokes the {@code NetworkCallbackListener.onAvailable()} callback. You can use +the {@code android.net.Network} object from the callback to get additional +information about the network, or to direct traffic to use the selected +network.</p> + +<h3 id="BluetoothBroadcasting">Bluetooth broadcasting</h3> +<p>Android 4.3 introduced platform support for + <a href="{@docRoot}guide/topics/connectivity/bluetooth-le.html">Bluetooth Low Energy</a> +(BLE) in the central role. In the L Developer Preview, an Android device can now +act as a Bluetooth LE <em>peripheral device</em>. Apps can use this capability +to make their presence known to +nearby devices. For instance, you can build apps that allow a device to +function as a pedometer or health monitor and communicate its data with another +BLE device.</p> + +<p>The new {@code android.bluetooth.le} APIs enable your apps to broadcast +advertisements, scan for responses, and form connections with nearby BLE devices. +You must add the {@code android.permission.BLUETOOTH_ADMIN} permission in your +manifest in order for your app to use the new advertising and scanning features.</a> + +<p>To begin Bluetooth LE advertising so that other devices can discover +your app, call {@code android.bluetooth.le.BluetoothAdvertiser.startAdvisertising()} +and pass in an implementation of the +{@code android.bluetooth.le.AdvertiseCallback} class. The callback object +receives a report of the success or failure of the advertising operation.</p> + +<p> The L Developer Preview introduces the {@code +android.bluetooth.le.ScanFilter} class so that your app can scan for only the +specific types of devices it is interested in. To begin scanning for Bluetooth +LE devices, call {@code android.bluetooth.le.BluetoothLeScanner.startScan()} and +pass in a list of filters. In the method call, you must also provide an +implementation of {@code android.bluetooth.le.ScanCallback} to report if a +Bluetooth LE advertisement is found. </p> + +<h3 id="NFCEnhancements">NFC enhancements</h3> +<p>The L Developer Preview adds these enhancements to enable wider and more +flexible use of NFC:</p> + +<ul> +<li>Android Beam is now available in the share menu. +<li>Your app can invoke the Android Beam on the user’s device to share data by +calling {@code android.nfc.NfcAdapter.invokeBeam()}. This avoids the need for +the user to manually tap the device against another NFC-capable device to +complete the data transfer. +<li>You can use the new {@code android.nfc.NdefRecord.createTextRecord()} method +to create an NDEF record containing UTF-8 text data. +<li>If you are developing a payment app, you now have the ability to +register an NFC application ID (AID) dynamically by calling +{@code android.nfc.cardemulation.CardEmulation.registerAidsForService()}. +You can also use {@code android.nfc.cardemulation.CardEmulation.setPreferredService()} +to set the preferred card emulation service that should be used when a specific +activity is in the foreground. +</ul> + +<h2 id="Power">Power Efficiency</h2> + +<h3 id="JobScheduler">Scheduling jobs</h3> +<p>The L Developer Preview provides a new {@code android.app.job.JobScheduler} +API that lets you optimize battery life by defining jobs for the system to run +asynchronously at a later time or under specified conditions (such as when the +device is charging). This is useful in such situations as:</p> +<ul> + <li>The app has non-user-facing work that you can defer.</li> + <li>The app has work you'd prefer to do when the unit is plugged in.</li> + <li>The app has a task that requires network access (or requires a Wi-Fi + connection).</li> + <li>The app has a number of tasks that you want to run as a batch on a regular + schedule.</li> + +</ul> + +<p>A unit of work is encapsulated by a {@code android.app.job.JobInfo} object. +This object provides an exact description of the criteria to be used for +scheduling.</p> + +<p>Use the {@code android.app.job.JobInfo.Builder} to configure how the +scheduled task should run. You can schedule the task to run under specific +conditions, such as:</p> + +<ul> + <li>The device is charging</li> + <li>The device is connected to an unmetered network</li> + <li>The system deems the device to be idle</li> + <li>Completion with a minimum delay or within a specific deadline.</li> +</ul> + +<p>For example, you can add code like this to run your task on an +unmetered network:</p> + +<pre> +JobInfo uploadTask = new JobInfo.Builder(mJobId, mServiceComponent) + .setRequiredNetworkCapabilities(JobInfo.NetworkType.UNMETERED) + .build(); + +JobScheduler jobScheduler = + (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE) +jobScheduler.schedule(uploadTask); +</pre> + +<p>To see an example of how to use the {@code JobScheduler} API, refer to the +{@code JobSchedulerSample} implementation sample in this release.</p> + +<h3 id="PowerMeasurementTools">Developer tools for power measurement</h3> +<p>The L Developer Preview provides several new developer tools and APIs to help +you better measure and understand your app's power usage.</p> + +<dl> +<dt><strong>batterystats</strong></dt> +<dd> +<p>The {@code dumpsys batterystats} command allows you to generate interesting +statistical data about battery usage on a device, organized by unique user ID +(UID). The statistics generated by the tool include:</p> + +<ul> +<li>History of battery related events +<li>Global statistics for the device +<li>Approximated power use per UID and system component +<li>Per-app mobile ms per packet +<li>System UID aggregated statistics +<li>App UID aggregated statistics +</ul> + +<p>Use the {@code --help} option to learn about the various options for +tailoring the output. For example, to print battery usage +statistics for a given app package since the device was last charged, run this +command: +<pre> +$ adb shell dumpsys batterystats --charged <package-name> +</pre> +</dd> + +<dt><strong>Battery Historian</strong></dt> +<dd> +<p>The Battery Historian tool ({@code historian.par}) analyzes Android +bug reports from the L Developer Preview and creates an HTML visualization of +power-related events. It can +also visualize power consumption data from a power monitor, and attempts to +map power usage to the wake locks seen. You can find the Battery Historian tool +in {@code <sdk>/tools}.</p> + +<img src="images/battery_historian.png" + srcset="images/battery_historian@2x.png 2x" + alt="" width="760" height="462" + id="figure2" /> +<p class="img-caption"> + <strong>Figure 2.</strong>HTML visualization generated by the Battery + Historian tool. +</p> + +<p>For best results, you should first enable full wake lock reporting, to allow +the Battery Historian tool to monitor uninterrupted over an extended period of +time:</p> +<pre> +$ adb shell dumpsys batterystats --enable full-wake-history +</pre> + +<p>You should also reset battery statistics at the beginning of a +measurement:</p> +<pre> +$ adb shell dumpsys batterystats --reset +</pre> + +<p>To generate an HTML visualization:</p> +<pre> +$ historian.par [-p powerfile] bugreport.txt > out.html +</pre> +</dd> + +</dl> + +<h2 id="Enterprise">Enterprise</h2> +<h3 id="ManagedProvisioning">Managed provisioning</h3> + +<div class="figure" style="width:360px"> + <img src="images/managed_apps_launcher.png" + srcset="images/managed_apps_launcher@2x.png 2x" + alt="" width="360" height="609" id="figure3" /> + <p class="img-caption"> + <strong>Figure 3.</strong> Launcher screen showing managed apps (marked with + a lock badge) + </p> +</div> + +<p>The L Developer Preview provides new functionality for running apps within +an enterprise environment. A +<a href="{@docRoot}guide/topics/admin/device-admin.html">device administrator</a> can +initiate a managed provisioning process to add a co-present but separate <em>Android +work profile</em> to a device, if the user has an existing personal account. +Apps that are associated with Android work profiles will appear alongside +non-managed apps in the user’s Launcher, Recent apps screen, and notifications.</p> + +<p>To start the managed provisioning process, send {@code +ACTION_PROVISION_MANAGED_PROFILE} in an {@link android.content.Intent}. If the +call is successful, the system triggers the {@code +android.app.admin.DeviceAdminReceiver. onProfileProvisioningComplete()} callback. +You can then call {@code app.admin.DevicePolicyManager. setProfileEnabled()} to +enable this Android work profile.</p> + +<p>A device administrator can associate a user with more than one Android +work profile. To get a list of the Android work profiles associated with the +user, call {@code android.os.UserManager. getUserProfiles()}.</p> + +<p>If you are developing a Launcher app, you can use the new {@code +android.content.pm.LauncherApps} class to get a list of launchable activities +for the current user and any associated Android work profiles. Your Launcher can make +the managed apps visually prominent by appending a “work” badge to the icon +drawable with {@code android.os.UserManager. getBadgeDrawableForUser()}.</p> + +<p>To see an example of how to use the new functionality, refer to the +{@code BasicManagedProfile} implementation sample in this release.</p> + +<h3 id="TaskLocking">Task locking</h3> +<p>The L Developer Preview introduces a new task locking API that +lets you temporarily restrict users from leaving your app or being interrupted +by notifications. This could be used, for example, if you are developing an +education app to support high stakes assessment requirements on Android. +Once your app activates this mode, users will not be able to see +notifications, access other apps, or return to the Home screen, until your +app exits the mode.</p> + +<p>To prevent unauthorized usage, only authorized apps can activate task locking. +Furthermore, task locking authorization must be granted by a +specially-configured <em>device owner</em> app, through the {@code android.app.admin.DevicePolicyManager.setLockTaskComponents()} method.</p> + +<p>To set up a device owner, follow these steps:</p> +<ol> +<li>Attach a device running an <a href="https://source.android.com/source/building-running.html">Android {@code userdebug} build</a> to your development machine.</li> +<li>Install your device owner app.</li> +<li>Create a {@code device_owner.xml} file and save it to the {@code /data/system} +directory on the device. +<pre> +$ adb root +$ adb shell stop +$ rm /tmp/device_owner.xml +$ echo "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>" +>> /tmp/device_owner.xml +$ echo "&device-owner package=\"<your_device_owner_package>\" +name=\"*<your_organization_name>\" />" >> /tmp/device_owner.xml +$ adb push /tmp/device_owner.xml /data/system/device_owner.xml +$ adb reboot +</pre> +</li> +</ol> + +<p>Before using the task locking API in your app, verify that your activity is +authorized by calling {@code DevicePolicyManager.isLockTaskPermitted()}.</p> + +<p>To activate task locking, call +{@code android.app.Activity.startLockTask()} from your authorized activity.</p> + +<p>When task locking is active, the following behavior takes effect:</p> + +<ul> +<li>The status bar is blank, and user notifications and status information is +hidden.</li> +<li>The Home and Recent Apps buttons are hidden.</li> +<li>Other apps may not launch new activities.</li> +<li>The current app may start new activities, as long as doing so does not +create new tasks.</li> +<li>The user remains locked on your app until an authorized activity calls +{@code Activity.stopLockTask()}.</li> +</ul> + +<h2 id="Printing">Printing Framework</h2> + +<h3 id="PDFRender">Render PDF as bitmap</h3> +<p>You can now render PDF document pages into bitmap images for printing by +using the new {@code android.graphics.pdf.PdfRenderer} class. You must specify a +{@link android.os.ParcelFileDescriptor} that is seekable (that is, the content +can be randomly accessed) on which the system writes the the printable content. +Your app can obtain a page for rendering with {@code openPage()}, then call +{@code render()} to turn the opened {@code PdfRenderer.Page} into a bitmap. You +can also set additional parameters if you only want to convert a portion of the +document into a bitmap image (for example, to implement +<a href="http://en.wikipedia.org/wiki/Tiled_rendering">tiled rendering</a> in +order to zoom in on the document).</p> + +<h2 id="TestingA11y">Testing & Accessibility </h2> + +<h3 id="TestingA11yImprovements">Testing and accessibility improvements</h3> +<p>The L Developer Preview adds the following support for testing and +accessibility:</p> + +<ul> +<li>You can use the new {@code android.app.UiAutomation.getWindowAnimationFrameStats()} +and {@code android.app.UiAutomation.getWindowContentFrameStats()} methods to +capture frame statistics for window animations and content. This lets you +write instrumentation tests to evaluate if the app under test is rendering +frames at a sufficient refresh frequency to provide a smooth user experience. + +<li>You can execute shell commands from your instrumentation test with the new +{@code android.app.UiAutomation.executeShellCommand()}. The command execution +is similar to running {@code adb shell} from a host connected to the device. This +allows you to use shell based tools such as {@code dumpsys}, {@code am}, +{@code content}, and {@code pm}. + +<li>Accessibility services and test tools that use the accessibility APIs +(such as <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator</a>) +can now retrieve detailed information about the properties of windows on the +screen that sighted users can interact with. To retrieve a list of +{@code android.view.accessibility.AccessibilityWindowInfo} objects +representing the windows information, call the new +{@code android.accessibilityservice.AccessibilityService.getWindows()} method. +<li>You can use the new {@code android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} to define standard or customized +actions to perform on an {@link android.view.accessibility.AccessibilityNodeInfo}. +The new {@code AccessibilityAction} class replaces the actions-related APIs +previously found in {@code AccessibilityNodeInfo}. +</ul> + +<h2 id="Manifest">Manifest Declarations</h2> + +<h3 id="ManifestFeatures">Declarable required features</h3> +<p>The following values are now supported in the +<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> +element, so you can ensure that your app is installed only on devices that provide the features +your app needs.</p> + +<ul> +<li>{@code FEATURE_LEANBACK}. Declares that your app must be installed only on +devices that support the +<a href="{@docRoot}training/tv/index.html">Android TV</a> user interface. +Example: +<pre> +<uses-feature android:name="android.software.leanback" + android:required="true" /> +</pre> + +<li>{@code FEATURE_WEBVIEW}. Declares that your app must only be installed on +devices that fully implement the {@code android.webkit.*} APIs. Example: +<pre> +<uses-feature android:name="android.software.webview" + android:required="true" /> +</pre> +</ul> + +<p class="note">For a detailed view of all API changes in the L Developer Preview, see the +<a href="{@docRoot}preview/reference.html">API Differences Report</a>.</p> diff --git a/docs/html/preview/google-play-services-wear.html b/docs/html/preview/google-play-services-wear.html new file mode 100644 index 0000000..ad8891f --- /dev/null +++ b/docs/html/preview/google-play-services-wear.html @@ -0,0 +1,95 @@ +<html><head> + + +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta name="viewport" content="width=device-width"> + +<meta name="Description" content="Google Play services will fully roll out to the hundreds of millions of Android devices in early July. Because of this, we usually wait to release the Google Play services SDK until all users receive the most updated Google Play services on their devices…"> +<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> +<title>Google Play services Preview for Wear | Android Developers</title> + +<!-- STYLESHEETS --> +<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" title="roboto"> +<link href="/assets/css/default.css" rel="stylesheet" type="text/css"> +</head> +<body> +<div class="col-12" id="doc-col"> + +<h1 itemprop="name">Google Play services Preview for Wear</h1> + + + + + + + <div id="jd-content"> + <div class="jd-descr" itemprop="articleBody"> +<p>The Google Play services app is currently being rolled out to the hundreds of millions of +Android devices and will complete in early July. Because of this, we usually wait to release the Google Play +services SDK until all users receive the app. This guarantees that your newly-updated apps can +run on the most devices as possible.</p> + +<p>However, if want to develop for Android Wear now, complete the following steps +to get special access to all the things you need to start developing, without waiting +for the rollout to complete. </p> + +<p class="warning"><b>Warning</b>: Do not publish any apps that use the new Google Play services +APIs until the rollout is complete. Your apps will break on most user devices, which will +degrade your user rating.</b> +</p> + +<h2 style="margin-bottom: 0px;">1. Get Whitelisted for the Preview</h2><hr> + +<p>If you attended Google I/O, your registered Gmail account is automatically whitelisted for these +preview resources. If you didn't attend Google I/O, sign up below to get access:</p> + +<a href="https://groups.google.com/forum/?hl=en#!forum/io14androidweardev">Get Whitelisted</a> + +<h2 style="margin-bottom: 0px;">2. Download Required Apps</h2><hr> +<p>You'll need the following apps to get the most out of Android Wear:</p> + + +<p>Here's a list of the apps you need:</p> +<ul> +<li><a href="https://play.google.com/apps/testing/com.google.android.gms">Google Play services</a>: Allows your Wear device to properly communicate with your handheld device. This is +required to use the Android Wear Companion App.</li> + <li><a href="https://play.google.com/apps/testing/com.google.android.wearable.app">Android Wear + Companion</a>: The main user app to pair a handheld to a wearable and to provide syncing + of notifications and data.</li> + <li><a href="https://play.google.com/apps/testing/com.google.android.googlequicksearchbox">Google + Search</a>: A preview release of the Google Search handheld app that Wear communicates with + to carry out searches.</li> + <li><a href="https://play.google.com/apps/testing/com.google.android.keep">Google Keep</a>: To enable the "Take a note" command</li> + <li><a href="https://play.google.com/apps/testing/com.google.samples.apps.iosched">Google I/O 2014</a></li> + </ul> + +<p>To enable the preview versions of the apps, click each app link above and follow these +instructions:</p> + +<ol> + <li>Click the <b>Become a Tester</b> button to opt-in to the preview version of the app. The page + confirms that you're a tester after clicking.</li> + <li>Click the <b>Download <app name> from the Play Store</b> link to go to Google Play + Store download page to get the app. The + following screenshot shows how the opt-in process looks like: +<img style="margin-top:40px" src="/preview/images/opt-in.png"></li> + <li>When Google Play services is rolled out to all devices, go back to the app links provided + to opt-out of the preview versions of the apps. Check back here in a week for the status of + the rollout.</li> +</ol> + + + +<h2 style="margin-bottom: 0px;">3. Start Building</h2><hr> +<p>Check out the <a href="/training/building-wearables">Building Apps for Wearables</a> +training classes for information on how to build for Wear.</p> + </div> + + + + + </div> <!-- end jd-content --> +</div><!-- end doc-content --> +</div> <!-- end body-content --> +</body> +</html>
\ No newline at end of file diff --git a/docs/html/preview/images/art.png b/docs/html/preview/images/art.png Binary files differnew file mode 100644 index 0000000..c48f039 --- /dev/null +++ b/docs/html/preview/images/art.png diff --git a/docs/html/preview/images/battery_historian.png b/docs/html/preview/images/battery_historian.png Binary files differnew file mode 100644 index 0000000..f1d4e40 --- /dev/null +++ b/docs/html/preview/images/battery_historian.png diff --git a/docs/html/preview/images/battery_historian@2x.png b/docs/html/preview/images/battery_historian@2x.png Binary files differnew file mode 100644 index 0000000..8c8a87f --- /dev/null +++ b/docs/html/preview/images/battery_historian@2x.png diff --git a/docs/html/preview/images/bugs.png b/docs/html/preview/images/bugs.png Binary files differnew file mode 100644 index 0000000..46adf05 --- /dev/null +++ b/docs/html/preview/images/bugs.png diff --git a/docs/html/preview/images/hero.jpg b/docs/html/preview/images/hero.jpg Binary files differnew file mode 100644 index 0000000..1c52989 --- /dev/null +++ b/docs/html/preview/images/hero.jpg diff --git a/docs/html/preview/images/hun-example.png b/docs/html/preview/images/hun-example.png Binary files differnew file mode 100644 index 0000000..251b938 --- /dev/null +++ b/docs/html/preview/images/hun-example.png diff --git a/docs/html/preview/images/hun-example@2x.png b/docs/html/preview/images/hun-example@2x.png Binary files differnew file mode 100644 index 0000000..5b98a36 --- /dev/null +++ b/docs/html/preview/images/hun-example@2x.png diff --git a/docs/html/preview/images/l-dev-prev.png b/docs/html/preview/images/l-dev-prev.png Binary files differnew file mode 100644 index 0000000..eae6ede --- /dev/null +++ b/docs/html/preview/images/l-dev-prev.png diff --git a/docs/html/preview/images/managed_apps_launcher.png b/docs/html/preview/images/managed_apps_launcher.png Binary files differnew file mode 100644 index 0000000..b5ef407 --- /dev/null +++ b/docs/html/preview/images/managed_apps_launcher.png diff --git a/docs/html/preview/images/managed_apps_launcher@2x.png b/docs/html/preview/images/managed_apps_launcher@2x.png Binary files differnew file mode 100644 index 0000000..90d7d51 --- /dev/null +++ b/docs/html/preview/images/managed_apps_launcher@2x.png diff --git a/docs/html/preview/images/material.png b/docs/html/preview/images/material.png Binary files differnew file mode 100644 index 0000000..2d807d4 --- /dev/null +++ b/docs/html/preview/images/material.png diff --git a/docs/html/preview/images/notifications.png b/docs/html/preview/images/notifications.png Binary files differnew file mode 100644 index 0000000..2fb2fea --- /dev/null +++ b/docs/html/preview/images/notifications.png diff --git a/docs/html/preview/images/opt-in.png b/docs/html/preview/images/opt-in.png Binary files differnew file mode 100644 index 0000000..51754af --- /dev/null +++ b/docs/html/preview/images/opt-in.png diff --git a/docs/html/preview/images/updates.png b/docs/html/preview/images/updates.png Binary files differnew file mode 100644 index 0000000..f165c5a --- /dev/null +++ b/docs/html/preview/images/updates.png diff --git a/docs/html/preview/images/volta.png b/docs/html/preview/images/volta.png Binary files differnew file mode 100644 index 0000000..9125081 --- /dev/null +++ b/docs/html/preview/images/volta.png diff --git a/docs/html/preview/index.html b/docs/html/preview/index.html new file mode 100644 index 0000000..4f3f150 --- /dev/null +++ b/docs/html/preview/index.html @@ -0,0 +1,361 @@ +<!DOCTYPE html> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<html> +<head> + + +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="viewport" content="width=970" /> + +<meta name="Description" content="Test and build your apps against the next version of Android to ensure they're ready when the platform officially launches."> +<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> +<title>Android L Developer Preview | Android Developers</title> + +<!-- STYLESHEETS --> +<link rel="stylesheet" +href="//fonts.googleapis.com/css?family=Roboto+Condensed"> +<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" + title="roboto"> +<link href="/assets/css/default.css" rel="stylesheet" type="text/css"> + + + +<!-- JAVASCRIPT --> +<script src="//www.google.com/jsapi" type="text/javascript"></script> +<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script> +<script type="text/javascript"> + var toRoot = "/"; + var metaTags = []; + var devsite = false; +</script> +<script src="/assets/js/docs.js" type="text/javascript"></script> + +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-5831155-1', 'android.com'); + ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker); + ga('send', 'pageview'); + ga('universal.send', 'pageview'); // Send page view for new tracker. +</script> + +</head> + +<body class="gc-documentation + +" itemscope itemtype="http://schema.org/Article"> + + +<a name="top"></a> +<div id="body-content"> +<div class="fullpage" > +<div id="jd-content"> + <div class="jd-descr" itemprop="articleBody"> + <style> +.fullpage>#footer, +#jd-content>.content-footer.wrap { + display:none; +} +</style> + +<style> +#footer { + display: none; +} +.content-footer { + display: none; +} +</style> + + <div class="landing-rest-of-page"> + <div class="landing-section" style="padding-top:30px"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Android L Developer Preview</div> + <div class="landing-subhead"> + Get an early look at the next release and get your apps ready when the + platform officially launches. + </div> + + <img src="/preview/images/l-dev-prev.png" style=" margin:0px 0 0 40px" width="860px"/> + <div class="col-6" style="margin-left:660px; margin-top:-105px"> + <a href="/preview/setup-sdk.html" class="landing-button landing-primary" style="position:absolute;z-index:100;float:right;margin-top: 0px;">Get Started</a><!-- + <p>Set up your environment and check out all the docs to get up and running.</p>--> + + + </div> + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + + +<div class="landing-section landing-gray-background" style="margin-top:-135px; padding-bottom:20px"> + <div class="wrap"> + <div class="cols"> +<div class="landing-body" style="margin-top:-80px" > + + <div class="landing-breakout cols"> + <div class="col-4"> + <p>A New UI Design</p> + <p class="landing-small"> + Create a consistent experience across mobile and the web with + <b>material design</b>, the new Google-wide standard. + </p> + <p class="landing-small"> + <a href="/preview/material/index.html">Learn about material</a> + </p> + </div> + <div class="col-4"> + <p>A New Runtime</p> + <p class="landing-small"> + Test your apps and get them ready for <b>ART</b> (<b>A</b>ndroid <b>R</b>un<b>t</b>ime), + the default runtime in the next release. + </p> + <p class="landing-small"> + <a href="/preview/api-overview.html#ART">Learn about ART</a> + </p> + </div> + <div class="col-4"> + <p style="width:230px">Enhanced Notifications</p> + <p class="landing-small"> + Get control over where notifications appear, + how they look, and how they sync to non-handheld devices. + </p> + <p class="landing-small"> + <a href="/preview/api-overview.html#UI">Learn about notifications</a> + </p> + </div> + <div class="col-4"> + <p>Increased Efficiency</p> + <p class="landing-small"> + <b>Project Volta</b> is our effort to make the platform energy efficient and + to give you more control over resource usage. + </p> + <p class="landing-small"> + <a href="/preview/api-overview.html#Power">Learn about Project Volta</a> + </p> + </div> + </div> + <p style="margin-left:20px">See the <a href="/preview/api-overview.html">API overview</a> for more information + on the rest of the new and updated features.</p> + </div> + </div></div></div> + <div class="landing-section"> + <div class="wrap"> + <div class="cols"> + <div class="landing-body"> + <div class="col-3-wide"> + <a target="_blank" href="https://code.google.com/p/android-developer-preview/"> + <img class="landing-social-image" src="/preview/images/bugs.png" alt=""> + </a> + <div class="landing-social-copy"> + <p>Issue Tracker</p> + <p class="landing-small"> + Let us know when you encounter problems, so we can fix them and make + the platform better for you and your users. + </p><p class="landing-small"> + <a href="https://code.google.com/p/android-developer-preview/"> + Report Issues</a> + </p> + <p></p> + </div> + </div> + <div class="col-3-wide"> + <a target="_blank" href="http://plus.google.com"> + <img class="landing-social-image" src="//www.google.com/images/icons/product/gplus-128.png" alt=""> + </a> + <div class="landing-social-copy"> + <p>Google+ </p> + <p class="landing-small"> + Join the community of Android developers testing out the L Developer Preview and + share your thoughts and experiences. + </p><p class="landing-small"> + <a href="https://plus.google.com/communities/113159138894928487684"> + Discuss on Google+</a> + </p> + </div> + </div> + <div class="col-3-wide"> + <a target="_blank" href="/preview/support.html"> + <img class="landing-social-image" src="/preview/images/updates.png" alt=""> + </a> + <div class="landing-social-copy"> + <p>Support and Updates</p> + <p class="landing-small"> + Updates to the L Developer Preview are delivered + in the Android SDK Manager. Check back periodically + for news about the changes. + </p> + <p class="landing-small"> + <a href="/preview/support.html">Get Support</a> + </p> + </div> + </div> + </div> + </div> + </div> + </div> + + <div class="content-footer wrap" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> + <div class="layout-content-col col-16" style="padding-top:4px"> + <style>#___plusone_0 {float:right !important;}</style> + <div class="g-plusone" data-size="medium"></div> + </div> + </div> + <div id="footer" class="wrap" style="width:940px;position:relative;top:-35px;z-index:-1"> + <div id="copyright"> + Except as noted, this content is + licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> + Creative Commons Attribution 2.5</a>. For details and + restrictions, see the <a href="/license.html">Content + License</a>. + </div> + </div> + </div> <!-- end landing-body-content --> + + <script> + $("a.landing-down-arrow").on("click", function(e) { + $("body").animate({ + scrollTop: $(".preview-hero").height() + 76 + }, 1000, "easeOutQuint"); + e.preventDefault(); + }); + </script> + </div> + + <div class="content-footer wrap" + itemscope itemtype="http://schema.org/SiteNavigationElement"> + + <div class="paging-links layout-content-col col-10"> + + </div> + <div class="layout-content-col plus-container col-2" > + <style>#___plusone_0 {float:right !important;}</style> + <div class="g-plusone" data-size="medium"></div> + + </div> + + </div> + + + + + </div> <!-- end jd-content --> + +<div id="footer" class="wrap" style="width:940px"> + + + <div id="copyright"> + + Except as noted, this content is + licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> + Creative Commons Attribution 2.5</a>. For details and + restrictions, see the <a href="/license.html">Content + License</a>. + </div> + + +</div> <!-- end footer --> +</div><!-- end doc-content --> + +</div> <!-- end body-content --> + + + + + + <script src="https://developer.android.com/ytblogger_lists_unified.js" type="text/javascript"></script> + <script src="/jd_lists_unified.js" type="text/javascript"></script> + <script src="/jd_extras.js" type="text/javascript"></script> + <script src="/jd_collections.js" type="text/javascript"></script> + <script src="/jd_tag_helpers.js" type="text/javascript"></script> + +</body> +</html> diff --git a/docs/html/preview/license.jd b/docs/html/preview/license.jd new file mode 100644 index 0000000..5ff52ba --- /dev/null +++ b/docs/html/preview/license.jd @@ -0,0 +1,143 @@ +page.title=License Agreement + +@jd:body + +<p> +To get started with the Android SDK Preview, you must agree to the following terms and conditions. +As described below, please note that this is a preview version of the Android SDK, subject to change, that you use at your own risk. The Android SDK Preview is not a stable release, and may contain errors and defects that can result in serious damage to your computer systems, devices and data. +</p> + +<p> +This is the Android SDK Preview License Agreement (the “License Agreement”). +</p> +<div class="sdk-terms" style="height:auto;border:0;padding:0;width:700px"> +1. Introduction + +1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. + +1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. + +1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. + +2. Accepting the License Agreement + +2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement. + +2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement. + +2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview. + +2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity. + +3. Preview License from Google + +3.1 Subject to the terms of the License Agreement, Google grants you a royalty-free, non-assignable, non-exclusive, non-sublicensable, limited, revocable license to use the Preview, personally or internally within your company or organization, solely to develop applications to run on the Android platform. + +3.2 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. + +3.3 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview. + +3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the Preview. + +3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights. + +3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you. + +3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. + +3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview. + +4. Use of the Preview by You + +4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications. + +4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). + +4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so. + +4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party. + +4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. + +4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. + +4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released. + +5. Your Developer Credentials + +5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. + +6. Privacy and Information + +6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. + +6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/. + +7. Third Party Applications + +7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. + +7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. + +7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. + +8. Using Google APIs + +8.1 Google APIs + +8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. + +8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. + +9. Terminating the License Agreement + +9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below. + +9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials. + +9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you. + +9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of: +(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and +(B) Google issues a final release version of the Android SDK. + +9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely. + +10. DISCLAIMERS + +10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. + +10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE. + +10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + +11. LIMITATION OF LIABILITY + +11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. + +12. Indemnification + +12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement. + +13. Changes to the License Agreement + +13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available. + +14. General Legal Terms + +14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview. + +14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. + +14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. + +14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. + +14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. + +14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google. + +14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. + + +</div>
\ No newline at end of file diff --git a/docs/html/preview/material/animations.jd b/docs/html/preview/material/animations.jd new file mode 100644 index 0000000..b8d063b --- /dev/null +++ b/docs/html/preview/material/animations.jd @@ -0,0 +1,441 @@ +page.title=Animations + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#touch">Touch Feedback</a></li> + <li><a href="#reveal">Reveal Effect</a></li> + <li><a href="#transitions">Activity Transitions</a></li> + <li><a href="#curvedmotion">Curved Motion</a></li> + <li><a href="#viewstate">Animating View State Changes</a></li> + <li><a href="#drawabletint">Drawable Tinting</a></li> + <li><a href="#colorextract">Extracting Colors from an Image</a></li> +</ol> +</div> +</div> + +<p>Animations in material design give users feedback on their actions and provide visual +continuity as users interact with your app. The material theme provides some default animations +for buttons and activity transitions, and the Android L Developer Preview provides additional +APIs that let you customize these animations and create new ones:</p> + +<ul> +<li>Touch feedback</li> +<li>Reveal effect</li> +<li>Activity transitions</li> +<li>Curved motion</li> +<li>View state changes</li> +</ul> + + +<h2 id="touch">Touch Feedback</h2> + +<p>The default touch feedback animations for buttons use the new +<code>RippleDrawable</code> class, which transitions between different states with a ripple +effect.</p> + +<p>In most cases, this functionality should be applied in your view XML by specifying the +background as <code>?android:attr/selectableItemBackground</code> for a bounded ripple or +<code>?android:attr/selectableItemBackgroundBorderless</code> for a ripple that extends beyond +the view bounds. You can also create a <code>RippleDrawable</code> and set +it as the background of your view. Alternatively, you can define a <code>RippleDrawable</code> +as an XML resource using the <code>ripple</code> element. The +Android L Developer Preview animates the selection color with a ripple effect.</p> + +<p>You can assign a color to <code>RippleDrawable</code> objects. To change the default touch +feedback color, use the theme's <code>android:colorControlHighlight</code> attribute.</p> + + +<h2 id="reveal">Reveal Effect</h2> + +<p>The <code>ViewAnimationUtils.createCircularReveal</code> method enables you to animate a +clipping circle to reveal or hide a view.</p> + +<p>To reveal a previously invisible view using this effect:</p> + +<pre> +// previously invisible view +View myView = findViewById(R.id.my_view); + +// get the center for the clipping circle +int cx = (myView.getLeft() + myView.getRight()) / 2; +int cy = (myView.getTop() + myView.getBottom()) / 2; + +// get the final radius for the clipping circle +int finalRadius = myView.getWidth(); + +// create and start the animator for this view +// (the start radius is zero) +ValueAnimator anim = + ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); +anim.start(); +</pre> + +<p>To hide a previously visible view using this effect:</p> + +<pre> +// previously visible view +final View myView = findViewById(R.id.my_view); + +// get the center for the clipping circle +int cx = (myView.getLeft() + myView.getRight()) / 2; +int cy = (myView.getTop() + myView.getBottom()) / 2; + +// get the initial radius for the clipping circle +int initialRadius = myView.getWidth(); + +// create the animation (the final radius is zero) +ValueAnimator anim = + ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, 0); + +// make the view invisible when the animation is done +anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + myView.setVisibility(View.INVISIBLE); + } +}); + +// start the animation +anim.start(); +</pre> + + +<h2 id="transitions">Activity Transitions</h2> + +<p>You can specify custom animations for enter and exit transitions and for +transitions of shared elements between activities.</p> + +<ul> +<li>An <strong>enter</strong> transition determines how views in an activity enter the scene. +For example, in the <em>explode</em> enter transition, the views enter the scene from the outside +and fly in towards the center of the screen.</li> + +<li>An <strong>exit</strong> transition determines how views in an activity exit the scene. For + example, in the <em>explode</em> exit transition, the views exit the scene away from the +center.</li> + +<li>A <strong>shared elements</strong> transition determines how views that are shared between +two activities transition between these activities. For example, if two activities have the same +image in different positions and sizes, the <em>moveImage</em> shared element transition +translates and scales the image smoothly between these activities.</li> +</ul> + +<p>The Android L Developer Preview supports these enter and exit transitions:</p> + +<ul> +<li><em>explode</em> - Moves views in or out from the center of the scene.</li> +<li><em>slide</em> - Moves views in or out from one of the edges of the scene.</li> +<li><em>fade</em> - Mades views in or out of the scene.</li> +</ul> + +<p>Any transition that extends the <code>android.transition.Visibility</code> class is supported +as an enter or exit transition. For more information, see the API reference for the +<code>android.transition.Transition</code> class.</p> + +<p>The Android L Developer Preview also supports these shared elements transitions:</p> + +<ul> +<li><em>changeBounds</em> - Animates the changes in layout bounds of target views.</li> +<li><em>changeClipBounds</em> - Animates the changes in clip bounds of target views.</li> +<li><em>changeTransform</em> - Animates the changes in scale and rotation of target views.</li> +<li><em>moveImage</em> - Animates changes in size and scale type for an image view.</li> +</ul> + +<p>When you enable activity transitions in your app, the default cross-fading transition is +activated between the entering and exiting activities.</p> + +<img src="/preview/material/images/SceneTransition.png" alt="" + id="figure1" style="width:600px;margin-top:20px"/> +<p class="img-caption"> + <strong>Figure 1</strong> - A scene transition with one shared element. +</p> + +<h3>Specify custom transitions</h3> + +<p>First, enable window content transitions with the <code>android:windowContentTransitions</code> +attribute when you define a style that inherits from the material theme. You can also specify +enter, exit, and shared element transitions in your style definition:</p> + +<pre> +<style name="BaseAppTheme" parent="android:Theme.Material"> + <!-- enable window content transitions --> + <item name="android:windowContentTransitions">true</item> + + <!-- specify enter and exit transitions --> + <item name="android:windowEnterTransition">@transition/explode</item> + <item name="android:windowExitTransition">@transition/explode</item> + + <!-- specify shared element transitions --> + <item name="android:windowSharedElementEnterTransition"> + @transition/move_image</item> + <item name="android:windowSharedElementExitTransition"> + @transition/move_image</item> +</style> +</pre> + +<p>The <code>move_image</code> transition in this example is defined as follows:</p> + +<pre> +<!-- res/transition/move_image.xml --> +<!-- (see also Shared Transitions below) --> +<transitionSet xmlns:android="http://schemas.android.com/apk/res/android"> + <moveImage/> +</transitionSet> +</pre> + +<p>The <code>moveImage</code> element corresponds to the <code>android.transition.MoveImage</code> +class. For more information, see the API reference for <code>android.transition.Transition</code>. +</p> + +<p>To enable window content transitions in your code instead, call the +<code>Window.requestFeature</code> method:</p> + +<pre> +// inside your activity (if you did not enable transitions in your theme) +getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); + +// set an exit transition +getWindow().setExitTransition(new Explode()); +</pre> + +<p>To specify transitions in your code, call these methods with a <code>Transition</code> +object:</p> + +<ul> + <li><code>Window.setEnterTransition</code></li> + <li><code>Window.setExitTransition</code></li> + <li><code>Window.setSharedElementEnterTransition</code></li> + <li><code>Window.setSharedElementExitTransition</code></li> +</ul> + +<p>The <code>setExitTransition</code> and <code>setSharedElementExitTransition</code> methods +define the exit transition for the calling activity. The <code>setEnterTransition</code> and +<code>setSharedElementEnterTransition</code> methods define the enter transition for the called +activity.</p> + +<p>To get the full effect of a transition, you must enable window content transitions on both the +calling and called activities. Otherwise, the calling activity will start the exit transition, +but then you'll see a window transition (like scale or fade).</p> + +<p>To start an enter transition as soon as possible, use the +<code>Window.setAllowEnterTransitionOverlap</code> method on the called activity. This lets you +have more dramatic enter transitions. The same applies for the calling activity and exit +transitions with the <code>Window.setAllowExitTransitionOverlap</code> method.</p> + +<h3>Start an activity using transitions</h3> + +<p>If you enable transitions and set an exit transition for an activity, the transition is activated +when you launch another activity with the <code>startActivity</code> method. If you have set an +enter transition for the second activity, the transition is also activated when the activity +starts.</p> + +<h3>Shared elements transitions</h3> + +<p>To make a screne transition animation between two activities that have a shared element:</p> + +<ol> +<li>Enable window content transitions in your style.</li> +<li>Specify a shared elements transition in your style.</li> +<li>Define your transition as an XML resource.</li> +<li>Assign a common name to the shared elements in both layouts with the + <code>android:viewName</code> attribute.</li> +<li>Use the <code>ActivityOptions.makeSceneTransitionAnimation</code> method.</li> +</ol> + +<pre> +// get the element that receives the click event +final View imgContainerView = findViewById(R.id.img_container); + +// get the common element for the transition in this activity +final View androidRobotView = findViewById(R.id.image_small); + +// define a click listener +imgContainerView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(this, Activity2.class); + // create the transition animation - the images in the layouts + // of both activities are defined with android:viewName="robot" + ActivityOptions options = ActivityOptions + .makeSceneTransitionAnimation(this, androidRobotView, "robot"); + // start the new activity + startActivity(intent, options.toBundle()); + } +}); +</pre> + +<p>For shared dynamic views that you generate in your code, use the <code>View.setViewName</code> +method to specify a common element name in both activities.</p> + +<p>To reverse the scene transition animation when you finish the second activity, call the +<code>Activity.finishAfterTransition</code> method instead of <code>Activity.finish</code>.</p> + +<h3>Multiple shared elements</h3> + +<p>To make a scene transition animation between two activities that have more than one shared +element, define the shared elements in both layouts with the <code>android:viewName</code> +attribute (or use the <code>View.setViewName</code> in both activities), and create an +<code>ActivityOptions</code> object as follows:</p> + +<pre> +ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, + Pair.create(view1, "agreedName1"), + Pair.create(view2, "agreedName2")); +</pre> + + +<h2 id="curvedmotion">Curved Motion</h2> + +<p>Animations in material design rely on curves for time interpolation and spatial movement +patterns. The Android L Developer Preview provides new APIs that enable you to define custom +timing curves and curved motion patterns for animations.</p> + +<p>The <code>PathInterpolator</code> class is a new interpolator based on a Bézier curve or a +<code>Path</code> object. This interpolator specifies a motion curve in a 1x1 square, with anchor +points at (0,0) and (1,1) and control points as specified using the constructor arguments. You can +also define a <code>PathInterpolator</code> as an XML resource:</p> + +<pre> +<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android" + android:controlX1="0.4" + android:controlY1="0" + android:controlX2="1" + android:controlY2="1"/> +</pre> + +<p>The Android L Developer Preview provides XML resources for the three basic curves in the +material design specification:</p> + +<ul> + <li><code>@interpolator/fast_out_linear_in.xml</code></li> + <li><code>@interpolator/fast_out_slow_in.xml</code></li> + <li><code>@interpolator/linear_out_slow_in.xml</code></li> +</ul> + +<p>You can pass a <code>PathInterpolator</code> object to the +<code>Animator.setInterpolation</code> method.</p> + +<p>The <code>ObjectAnimator</code> class has new constructors that enable you to animate +coordinates along a path using two or more properties at once. For example, the following animator +uses a <code>Path</code> object to animate the X and Y properties of a view:</p> + +<pre> +ObjectAnimator mAnimator; +mAnimator = ObjectAnimator.ofFloat(view, View.X, View.Y, path); +... +mAnimator.start(); +</pre> + + +<h2 id="viewstate">Animating View State Changes</h2> + +<p>The new <code>StateListAnimator</code> class lets you define animators that run when the state +of a view changes. The following example shows how to define an <code>StateListAnimator</code> as +an XML resource:</p> + +<pre> +<!-- animate the translationZ property of a view when pressed --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true"> + <set> + <objectAnimator android:propertyName="translationZ" + android:duration="100" + android:valueTo="2" + android:valueType="floatType"/> + <!-- you could have other objectAnimator elements + here for "x" and "y", or other properties --> + </set> + </item> + <item android:state_enabled="true" + android:state_pressed="false" + android:state_focused="true"> + <set> + <objectAnimator android:propertyName="translationZ" + android:duration="100" + android:valueTo="2" + android:valueType="floatType"/> + </set> + </item> +</selector> +</pre> + +<p class="note"><strong>Note:</strong> There is a known issue in the L Developer Preview release +that requires valueFrom values to be provided in StateListAnimator animations to get the correct +behavior.</p> + +<p>The new <code>AnimatedStateListDrawable</code> class lets you create drawables that show +animations between state changes of the associated view. Some of the system widgets in the +Android L Developer Preview use these animations by default. The following example shows how +to define an <code>AnimatedStateListDrawable</code> as an XML resource:</p> + +<pre> +<!-- res/drawable/myanimstatedrawable.xml --> +<animated-selector + xmlns:android="http://schemas.android.com/apk/res/android"> + + <!-- provide a different drawable for each state--> + <item android:id="@+id/pressed" android:drawable="@drawable/drawableP" + android:state_pressed="true"/> + <item android:id="@+id/focused" android:drawable="@drawable/drawableF" + android:state_focused="true"/> + <item android:id="@id/default" + android:drawable="@drawable/drawableD"/> + + <!-- specify a transition --> + <transition android:fromId="@+id/default" android:toId="@+id/pressed"> + <animation-list> + <item android:duration="15" android:drawable="@drawable/dt1"/> + <item android:duration="15" android:drawable="@drawable/dt2"/> + ... + </animation-list> + </transition> + ... +</animated-selector> +</pre> + + +<h2 id="drawabletint">Drawable Tinting</h2> + +<p>The Android L Developer Preview enables you to define bitmaps or nine-patches as alpha masks and +to tint them using a color resource or a theme attribute that resolves to a color resource (for +example, <code>?android:attr/colorPrimary</code>). You can create these assets only once and color them +automatically to match your theme.</p> + +<p>To apply a tint to a bitmap, use the <code>setTint</code> method or the <code>android:tint</code> +attribute for <code>BitmapDrawable</code> and <code>NinePatchDrawable</code>.</p> + +<p>The <code>setTint</code> method also lets you set the Porter-Duff mode used to blend the +tint color for <code>NinePatchDrawable</code> and <code>BitmapDrawable</code> objects in your code. +To set the tint mode in your layouts, use the <code>android:tintMode</code> attribute.</p> + + +<h2 id="colorextract">Extracting Prominent Colors from an Image</h2> + +<p>The Android L Developer Preview Support Library includes the <code>Palette</code> class, +which lets you extract prominent colors from an image. This class extracts the following +prominent colors:</p> + +<ul> +<li>Vibrant</li> +<li>Vibrant dark</li> +<li>Vibrant light</li> +<li>Muted</li> +<li>Muted dark</li> +<li>Muted light</li> +</ul> + +<p>To extract these colors, pass a <code>Bitmap</code> object to the +<code>Palette.generate</code> static method in the background thread where you load your images. +If you can't use that thread, call the <code>Palette.generateAsync</code> method instead and +provide a listener.</p> + +<p>To retrieve the prominent colors from the image, use the getter methods in the +<code>Palette</code> class, such as <code>Palette.getVibrantColor</code>.</p> + +<p>For more information, see the API reference for the +<code>android.support.v7.graphics.Palette</code> class.</p>
\ No newline at end of file diff --git a/docs/html/preview/material/compatibility.jd b/docs/html/preview/material/compatibility.jd new file mode 100644 index 0000000..fb97112 --- /dev/null +++ b/docs/html/preview/material/compatibility.jd @@ -0,0 +1,82 @@ +page.title=Compatibility + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#materialtheme">Material Theme</a></li> + <li><a href="#layouts">Layouts</a></li> + <li><a href="#widgets">UI Widgets</a></li> + <li><a href="#animation">Animation APIs</a></li> +</ol> +</div> +</div> + +<p>The new material design features (like the material theme and activity transitions) are only +available in the Android L Developer Preview. However, you can design your apps to make use of +these features when running on devices with the Android L Developer Preview and still be +compatible with previous releases of Android.</p> + + +<h2 id="materialtheme">Material Theme</h2> + +<p>The material theme is only available in the Android L Developer Preview. To configure your +app to use the material theme on devices running the Android L Developer Preview and an older +theme on devices running earlier versions of Android:</p> + +<ol> +<li>Define a theme that inherits from an older theme (like Holo) in +<code>res/values/styles.xml</code>.</li> +<li>Define a theme with the same name that inherits from the material theme in +<code>res/values-v21/styles.xml</code>.</li> +<li>Set this theme as your app's theme in the manifest file.</li> +</ol> + +<p class="note"><strong>Note:</strong> If you do not provide an alternative theme in this manner, +your app will not run on earlier versions of Android.</p> + + +<h2 id="layouts">Layouts</h2> + +<p>If the layouts that you design according to the material design guidelines do not use any +of the new XML attributes from the Android L Developer Preview, they will work on previous +versions of Android. Otherwise, you can provide alternative layouts. You can also provide +alternative layouts to customize how your app looks on earlier versions of Android.</p> + +<p>Create your layout files for the Android L Developer Preview inside <code>res/layout-v21/</code> +and your alternative layout files for earlier versions of Android inside <code>res/layout/</code>. +Alternative layouts have the same file name.</p> + +<p>To avoid duplication of code, define your styles inside <code>res/values/</code> and modify the +styles in <code>res/values-v21/</code> for the new APIs.</p> + + +<h2 id="widgets">UI Widgets</h2> + +<p>The <code>RecyclerView</code> and <code>CardView</code> widgets are included in the Android L +Developer Preview Support Library, so they are available in earlier versions of Android with +these limitations:</p> + +<ul> +<li><code>CardView</code> falls back to a programmatic shadow implementation using additional padding.</li> +<li><code>CardView</code> does not clip its children views that intersect with rounded corners.</li> +</ul> + +<p>These limitations do not apply to the Android L Developer Preview.</p> + + +<h2 id="animation">Animation APIs</h2> + +<p>The following new APIs are only available in the Android L Developer Preview:</p> + +<ul> +<li>Activity transitions</li> +<li>Touch feedback</li> +<li>Reveal animations</li> +<li>Path-based animations</li> +</ul> + +<p>To preserve compatibility with earlier verisons of Android, check the system version at +runtime before you invoke these APIs.</p>
\ No newline at end of file diff --git a/docs/html/preview/material/get-started.jd b/docs/html/preview/material/get-started.jd new file mode 100644 index 0000000..7d0625e --- /dev/null +++ b/docs/html/preview/material/get-started.jd @@ -0,0 +1,147 @@ +page.title=Get Started + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#applytheme">Apply the Material Theme</a></li> + <li><a href="#layouts">Design Your Layouts</a></li> + <li><a href="#depth">Specify Elevation in Your Views</a></li> + <li><a href="#widgets">Use the New UI Widgets</a></li> + <li><a href="#animations">Customize Your Animations</a></li> +</ol> +</div> +</div> + +<p>To create apps with material design:</p> + +<ol> + <li style="margin-bottom:10px"> + Take a look at the <a href="http://www.google.com/design/spec">material design + specification</a>.</li> + <li style="margin-bottom:10px"> + Apply the material <strong>theme</strong> to your app.</li> + <li style="margin-bottom:10px"> + Define additional <strong>styles</strong> to customize the material theme.</li> + <li style="margin-bottom:10px"> + Create your <strong>layouts</strong> following material design guidelines.</li> + <li style="margin-bottom:10px"> + Specify the <strong>elevation</strong> of your views to cast appropriate shadows.</li> + <li style="margin-bottom:10px"> + Use the new <strong>widgets</strong> for complex views, such as lists and cards.</li> + <li style="margin-bottom:10px"> + Use the new APIs to customize the <strong>animations</strong> in your app.</li> +</ol> + +<h3>Update Your App for the Android L Developer Preview</h3> + +<p>To update an existing app for the Android L Developer Preview, design new layouts following +material design guidelines and consider how you can improve the user experience for your app by +incorporating depth, touch feedback and animations in your UI.</p> + +<h3>Create New Apps for the Android L Developer Preview</h3> + +<p>If you are creating a new app for the Android L Developer Preview, the <a +href="http://www.google.com/design/spec">material design guidelines</a> provide you with a +cohesive design framework for your app. Follow these guidelines and +use the new functionality in the Android framework to design and develop your app.</p> + + +<h2 id="applytheme">Apply the Material Theme</h2> + +<p>To apply the material theme in your app, specify a style that inherits from +<code>android:Theme.Material</code>:</p> + +<pre> +<!-- res/values/styles.xml --> +<resources> + <!-- your app's theme inherits from the Material theme --> + <style name="AppTheme" parent="android:Theme.Material"> + <!-- theme customizations --> + </style> +</resources> +</pre> + +<p>The material theme provides new system widgets that let you set their color palette and default +animations for touch feedback and activity transitions. For more details, see +<a href="{@docRoot}preview/material/theme.html">Material Theme</a>.</p> + + +<h2 id="layouts">Design Your Layouts</h2> + +<p>In addition to applying and customizing the material theme, your layouts should conform to +the <a href="http://www.google.com/design/spec">material design guidelines</a>. When you design +your layouts, pay special attention to the following:</p> + +<ul> +<li>Baseline grids</li> +<li>Keylines</li> +<li>Spacing</li> +<li>Touch target size</li> +<li>Layout structure</li> +</ul> + + +<h2 id="depth">Specify Elevation in Your Views</h2> + +<p>Views can cast shadows, and the elevation value of a view +determines the size of its shadow and its drawing order. To set the elevation of a view, use the +<code>android:elevation</code> attribute in your layouts:</p> + +<pre> +<TextView + android:id="@+id/my_textview" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/next" + android:background="@color/white" + <strong>android:elevation</strong>="5dp" /> +</pre> + +<p>The new <code>translationZ</code> property lets you create animations that reflect temporary +changes in the elevation of a view. For example, this is useful to respond to touch gestures.</p> + +<p>For more details, see <a href="{@docRoot}preview/material/views-shadows.html">Views and +Shadows</a>.</p> + + +<h2 id="widgets">Use the New UI Widgets</h2> + +<p><code>RecyclerView</code> is a more advanced version of <code>ListView</code> that provides +performance improvements and is easier to use. <code>CardView</code> lets you show pieces of +information inside cards with a consistent look across apps. To include a <code>CardView</code> +in your layout:</p> + +<pre> +<android.support.v7.widget.CardView + android:id="@+id/card_view" + android:layout_width="200dp" + android:layout_height="200dp" + card_view:cardCornerRadius="3dp"> + ... +</android.support.v7.widget.CardView> +</pre> + +<p>For more information, see <a href="{@docRoot}preview/material/ui-widgets.html">UI Widgets</a>.</p> + + +<h2 id="animations">Customize Your Animations</h2> + +<p>The Android L Developer Preview includes new APIs to create custom animations in your app. +For example, you can enable activity transitions and define an exit transition inside an +activity:</p> + +<pre> +// inside your activity +getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); + +// set an exit transition +getWindow().setExitTransition(new Explode()); +</pre> + +<p>When you start another activity from this activity, the exit transition is activated.</p> + +<p>To learn about all the features in the new APIs, see <a +href="{@docRoot}preview/material/animations.html">Animations</a>.</p>
\ No newline at end of file diff --git a/docs/html/preview/material/images/MaterialDark.png b/docs/html/preview/material/images/MaterialDark.png Binary files differnew file mode 100644 index 0000000..f1018af --- /dev/null +++ b/docs/html/preview/material/images/MaterialDark.png diff --git a/docs/html/preview/material/images/MaterialLight.png b/docs/html/preview/material/images/MaterialLight.png Binary files differnew file mode 100644 index 0000000..4ed7d5c --- /dev/null +++ b/docs/html/preview/material/images/MaterialLight.png diff --git a/docs/html/preview/material/images/RecyclerView.png b/docs/html/preview/material/images/RecyclerView.png Binary files differnew file mode 100644 index 0000000..364951d --- /dev/null +++ b/docs/html/preview/material/images/RecyclerView.png diff --git a/docs/html/preview/material/images/SceneTransition.png b/docs/html/preview/material/images/SceneTransition.png Binary files differnew file mode 100644 index 0000000..ecaf472 --- /dev/null +++ b/docs/html/preview/material/images/SceneTransition.png diff --git a/docs/html/preview/material/images/ThemeColors.png b/docs/html/preview/material/images/ThemeColors.png Binary files differnew file mode 100644 index 0000000..bbcecf2 --- /dev/null +++ b/docs/html/preview/material/images/ThemeColors.png diff --git a/docs/html/preview/material/images/card_travel.png b/docs/html/preview/material/images/card_travel.png Binary files differnew file mode 100644 index 0000000..19752a8 --- /dev/null +++ b/docs/html/preview/material/images/card_travel.png diff --git a/docs/html/preview/material/images/list_mail.png b/docs/html/preview/material/images/list_mail.png Binary files differnew file mode 100644 index 0000000..bd107ff --- /dev/null +++ b/docs/html/preview/material/images/list_mail.png diff --git a/docs/html/preview/material/index.jd b/docs/html/preview/material/index.jd new file mode 100644 index 0000000..d9a276f --- /dev/null +++ b/docs/html/preview/material/index.jd @@ -0,0 +1,128 @@ +page.title=Material Design +page.type=design + +@jd:body + +<p itemprop="description">The Android L Developer Preview includes support for material design +apps. Material design is a comprehensive guide for visual, motion, and interaction design across +platforms and devices. To use material design in your Android apps, follow the guidelines defined +in the <a href="http://www.google.com/design/spec">material design specification</a> and use the +new components and functionality available in the Android L Developer Preview.</p> + +<p>The Android L Developer Preview provides the following elements for you to build material +design apps:</p> + +<ul> + <li>A new theme</li> + <li>New widgets for complex views</li> + <li>New APIs for custom shadows and animations</li> +</ul> + + +<h3>Material Theme</h3> + +<p>The material theme provides a new style for your app, system widgets that let you set +their color palette, and default animations for touch feedback and activity transitions.</p> + +<!-- two columns --> +<div style="width:700px;margin-top:25px;margin-bottom:20px"> +<div style="float:left;width:250px;margin-left:40px;margin-right:60px;"> + <img src="{@docRoot}preview/material/images/MaterialDark.png" width="500" height="238"/> + <div style="width:140px;margin:0 auto"> + <p style="margin-top:8px">Dark Material theme</p> + </div> +</div> +<div style="float:left;width:250px;margin-right:0px;"> + <img src="{@docRoot}preview/material/images/MaterialLight.png" width="500" height="238"/> + <div style="width:140px;margin:0 auto"> + <p style="margin-top:8px">Light Material theme</p> + </div> +</div> +<br style="clear:left"/> +</div> + + +<h3>New Widgets</h3> + +<p>The Android L Developer Preview includes two new widgets for displaying complex views:</p> + +<!-- two columns --> +<div style="width:700px;margin-top:25px;margin-bottom:20px"> +<div style="float:left;width:250px;margin-left:40px;margin-right:60px;"> + <img src="{@docRoot}preview/material/images/list_mail.png" width="500" height="426"/> + <p>The new <code>RecyclerView</code> widget is a more advanced version of <code>ListView</code> + that provides performance improvements for dynamic views and is easier to use.</p> +</div> +<div style="float:left;width:250px;margin-right:0px;"> + <img src="{@docRoot}preview/material/images/card_travel.png" width="500" height="426"/> + <p>The new <code>CardView</code> widget lets you display important pieces of information inside + cards that have a consistent look and feel.</p> +</div> +<br style="clear:left"/> +</div> + + +<h3>View Shadows</h3> + +<p>In addition to the X and Y properties, views in the Android L Developer Preview have a Z +property. This new property represents the elevation of a view, which determines:</p> + +<ul> +<li>The size of the shadow - Views with higher Z values cast bigger shadows.</li> +<li>The drawing order - Views with higher Z values appear on top of other views.</li> +</ul> + +<div style="width:290px;margin-left:35px;float:right"> + <div class="framed-nexus5-port-span-5"> + <video class="play-on-hover" autoplay> + <source src="/preview/material/videos/ContactsAnim.mp4"/> + <source src="/preview/material/videos/ContactsAnim.webm"/> + <source src="/preview/material/videos/ContactsAnim.ogv"/> + </video> + </div> + <div style="font-size:10pt;margin-left:20px;margin-bottom:30px"> + <em>Click on the device screen to replay the movie</em> + </div> +</div> + +<h3>Animations</h3> + +<p>The Android L Developer Preview provides new APIs that let you create custom animations for +touch feedback in UI controls, view state changes, and activity transitions.</p> + +<p>The new animation APIs let you:</p> + +<ul> +<li style="margin-bottom:15px"> +Respond to touch events in your views with <strong>touch feedback</strong> animations. +</li> +<li style="margin-bottom:15px"> +Hide and show views with <strong>reveal effect</strong> animations. +</li> +<li style="margin-bottom:15px"> +Switch between activities with custom <strong>activity transition</strong> animations. +</li> +<li style="margin-bottom:15px"> +Create more natural animations with <strong>curved motion</strong>. +</li> +<li style="margin-bottom:15px"> +Animate changes in one or more view properties with <strong>view state change</strong> animations. +</li> +<li style="margin-bottom:15px"> +Show animations in <strong>state list drawables</strong> between view state changes. +</li> +</ul> + +<p>Touch feedback animations are built into several standard views, such as buttons. The new APIs +let you customize these animations and add animations to your custom views.</p> + + +<h3>New Capabilities for Drawables</h3> + +<p>The Android L Developer Preview supports <strong>drawable tinting</strong>: you can define +bitmaps as an alpha mask and tint them using a color resource. You create these assets only +once and color each instance to match your theme. Drawables also now support specifying most XML +properties as <strong>theme attributes</strong>.</p> + +<p>The Android L Developer Preview Support Library includes a <strong>color extraction</strong> +library that lets you automatically extract prominent colors from a bitmap image.</p>
\ No newline at end of file diff --git a/docs/html/preview/material/theme.jd b/docs/html/preview/material/theme.jd new file mode 100644 index 0000000..5e4bcdf --- /dev/null +++ b/docs/html/preview/material/theme.jd @@ -0,0 +1,99 @@ +page.title=Material Theme + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#colorpalette">Customize the Colot Palette</a></li> + <li><a href="#statusbar">Customize the Status Bar</a></li> + <li><a href="#inheritance">Theme Individual Views</a></li> +</ol> +</div> +</div> + +<p>The new material theme provides:</p> + +<ul> + <li>System widgets that let you set their color palette</li> + <li>Touch feedback animations for the system widgets</li> + <li>Activity transition animations</li> +</ul> + +<p>You can customize the look of the material theme +according to your brand identity with a color palette you control. You can tint the action bar and +the status bar using theme attributes, as shown in Figure 1.</p> + +<div style="float:right;margin-left:25px;margin-top:-50px"> +<img src="{@docRoot}preview/material/images/ThemeColors.png" style="width:250px"/> +<p class="img-caption" style="margin-bottom:0px"> +<strong>Figure 1.</strong> Customizing the material theme.</p> +</div> + +<p>The system widgets have a new design and touch feedback animations. You can customize the +color palette, the touch feedback animations, and the activity transitions for your app.</p> + +<p>The material theme is defined as:</p> + +<ul> + <li><code>@android:style/Theme.Material</code> (dark version)</li> + <li><code>@android:style/Theme.Material.Light</code> (light version)</li> + <li><code>@android:style/Theme.Material.Light.DarkActionBar</code></li> +</ul> + +<p>For a list of material styles that you can use, see the API reference for +<code>android.R.style</code>.</p> + +<p class="note"> +<strong>Note:</strong> The material theme is only available in the Android L Developer Preview. +For more information, see <a href="{@docRoot}preview/material/compatibility.html">Compatibility</a>. +</p> + + +<h2 id="colorpalette">Customize the Color Palette</h2> + +<p style="margin-bottom:30px">To customize the theme's base colors to fit your brand, define +your custom colors using theme attributes when you inherit from the material theme:</p> + +<pre> +<resources> + <!-- inherit from the material theme --> + <style name="AppTheme" parent="android:Theme.Material"> + <!-- Main theme colors --> + <!-- your app's branding color (for the app bar) --> + <item name="android:colorPrimary">@color/primary</item> + <!-- darker variant of colorPrimary (for status bar, contextual app bars) --> + <item name="android:colorPrimaryDark">@color/primary_dark</item> + <!-- theme UI controls like checkboxes and text fields --> + <item name="android:colorAccent">@color/accent</item> + </style> +</resources> +</pre> + + +<h2 id="statusbar">Customize the Status and Navigation Bar</h2> + +<p>The material theme lets you easily customize the status bar, so you can specify a +color that fits your brand and provides enough contrast to show the white status icons. To +set a custom color for the status bar, use the <code>android:statusBarColor</code> attribute when +you extend the material theme. By default, <code>android:statusBarColor</code> inherits the +value of <code>android:colorPrimaryDark</code>.</p> + +<p>To handle the color of the status bar yourself (for example, by adding a gradient in the +background), set the <code>android:statusBarColor</code> attribute to +<code>@android:color/transparent</code> and adjust the window flags as required. You can +also use the <code>Window.setStatusBarColor</code> method for animations or fading.</p> + +<p class="note"><strong>Note:</strong> +The status bar should almost always have a clear delineation from the primary toolbar, except for +full-bleed imagery cases and when you use a gradient as a protection. +</p> + + +<h2 id="inheritance">Theme Individual Views</h3> + +<p>Elements in XML layout definitions can specify the <code>android:theme</code> attribute, +which references a theme resource. This attribute modifies the theme for the element and any +elements inflated below it, which is useful to alter theme color palettes in a specific portion +of an interface.</p>
\ No newline at end of file diff --git a/docs/html/preview/material/ui-widgets.jd b/docs/html/preview/material/ui-widgets.jd new file mode 100644 index 0000000..31604d6 --- /dev/null +++ b/docs/html/preview/material/ui-widgets.jd @@ -0,0 +1,198 @@ +page.title=UI Widgets + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#recyclerview">RecyclerView</a></li> + <li><a href="#cardview">CardView</a></li> +</ol> +</div> +</div> + +<p>The support library in the Android L Developer Preview contains two new widgets, +<code>RecyclerView</code> and <code>CardView</code>. Use these widgets to show complex lists +and cards in your app. These widgets have material design style by default.</p> + + +<h2 id="recyclerview">RecyclerView</h2> + +<p><code>RecyclerView</code> is a more advanced and flexible version of <code>ListView</code>. +This widget is a container for large sets of views that can be recycled and scrolled very +efficiently. Use the <code>RecyclerView</code> widget when you have lists with elements that +change dynamically.</p> + +<p><code>RecyclerView</code> is easy to use, because it provides:</p> + +<ul> + <li>A layout manager for positioning items</li> + <li>Default animations for common item operations</li> +</ul> + +<p>You also have the flexibility to define custom layout managers and animations for this +widget.</p> + +<p>To use the <code>RecyclerView</code> widget, you have to specify an adapter and a layout +manager. To create an adapter, you extend the <code>RecyclerView.Adapter</code> class. The details +of the implementation depend on the specifics of your dataset and the type of views. For more +information, see the <a href="#rvexamples">examples</a> below.</p> + +<img src="/preview/material/images/RecyclerView.png" alt="" id="figure1" style="width:550px"/> +<p class="img-caption"> + <strong>Figure 1</strong> - The <code>RecyclerView</code> widget. +</p> + +<p>A <strong>layout manager</strong> positions item views inside a <code>RecyclerView</code> and +determines when to reuse item views that are no longer visible to the user. To reuse (or +<em>recycle</em>) a view, a layout manager may ask the adapter to replace the content of the +view with a different element from the dataset. Recycling views in this manner improves +performance by avoiding the creation of unnecessary views or performing expensive +<code>findViewById</code> lookups. +</p> + +<p><code>RecyclerView</code> provides <code>LinearLayoutManager</code>, which shows the items in a +vertical or horizontal scrolling list. To create a custom layout, you extend the +<code>RecyclerView.LayoutManager</code> class.</p> + +<h3>Animations</h3> + +<p>Animations for adding and removing items are enabled by default in <code>RecyclerView</code>. +To customize these animations, extend the <code>RecyclerView.ItemAnimator</code> class and use +the <code>RecyclerView.setItemAnimator</code> method.</p> + +<h3 id="rvexamples">Examples</h3> + +<p>To include a <code>RecyclerView</code> in your layout:</p> + +<pre> +<!-- A RecyclerView with some commonly used attributes --> +<android.support.v7.widget.RecyclerView + android:id="@+id/my_recycler_view" + android:scrollbars="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"/> +</pre> + +<p>To get the <code>RecyclerView</code> object in your activity:</p> + +<pre> +public class MyActivity extends Activity { + private RecyclerView mRecyclerView; + private RecyclerView.Adapter mAdapter; + private RecyclerView.LayoutManager mLayoutManager; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.my_activity); + mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view); + + // improve performance if you know that changes in content + // do not change the size of the RecyclerView + mRecyclerView.setHasFixedSize(true); + + // use a linear layout manager + mLayoutManager = new LinearLayoutManager(this); + mRecyclerView.setLayoutManager(mLayoutManager); + + // specify an adapter (see also next example) + mAdapter = new MyAdapter(myDataset); + mRecyclerView.setAdapter(mAdapter); + } + ... +} +</pre> + +<p>To create a simple adapter:</p> + +<pre> +public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { + private String[] mDataset; + + // Provide a reference to the type of views that you are using + // (custom viewholder) + public static class ViewHolder extends RecyclerView.ViewHolder { + public TextView mTextView; + public ViewHolder(TextView v) { + super(v); + mTextView = v; + } + } + + // Provide a suitable constructor (depends on the kind of dataset) + public MyAdapter(String[] myDataset) { + mDataset = myDataset; + } + + // Create new views (invoked by the layout manager) + @Override + public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, + int viewType) { + // create a new view + View v = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.my_text_view, null); + // set the view's size, margins, paddings and layout parameters + ... + ViewHolder vh = new ViewHolder(v); + return vh; + } + + // Replace the contents of a view (invoked by the layout manager) + @Override + public void onBindViewHolder(ViewHolder holder, int position) { + // - get element from your dataset at this position + // - replace the contents of the view with that element + holder.mTextView.setText(mDataset[position]); + + } + + // Return the size of your dataset (invoked by the layout manager) + @Override + public int getItemCount() { + return mDataset.length; + } +} +</pre> + + +<h2 id="cardview">CardView</h2> + +<p><code>CardView</code> extends the <code>FrameLayout</code> class and lets you show information +inside cards that have a consistent look on any app. <code>CardView</code> widgets can have +shadows and rounded corners.</p> + +<p>To create a card with a shadow, use the <code>android:elevation</code> attribute. +<code>CardView</code> uses real elevation and dynamic shadows +and falls back to a programmatic shadow implementation on earlier versions. For more information, +see <a href="{@docRoot}preview/material/compatibility.html">Compatibility</a>.</p> + +<p>Here's how to specify properties of <code>CardView</code>:</p> + +<ul> + <li>To set the corner radius in your layouts, use the <code>android:cardCornerRadius</code> + attribute.</li> + <li>To set the corner radius in your code, use the <code>CardView.setRadius</code> method.</li> + <li>To set the background color of a card, use the <code>android:cardBackgroundColor</code> +attribute.</li> +</ul> + +<p>To include a <code>CardView</code> in your layout:</p> + +<pre> +<!-- A CardView that contains a TextView --> +<android.support.v7.widget.CardView + xmlns:card_view="http://schemas.android.com/apk/res-auto" + android:id="@+id/card_view" + android:layout_gravity="center" + android:layout_width="200dp" + android:layout_height="200dp" + card_view:cardCornerRadius="4dp"> + + <TextView + android:id="@+id/info_text" + android:layout_width="match_parent" + android:layout_height="match_parent" /> +</android.support.v7.widget.CardView> +</pre>
\ No newline at end of file diff --git a/docs/html/preview/material/videos/ContactsAnim.mp4 b/docs/html/preview/material/videos/ContactsAnim.mp4 Binary files differnew file mode 100644 index 0000000..073f9dc --- /dev/null +++ b/docs/html/preview/material/videos/ContactsAnim.mp4 diff --git a/docs/html/preview/material/videos/ContactsAnim.ogv b/docs/html/preview/material/videos/ContactsAnim.ogv Binary files differnew file mode 100644 index 0000000..c5e751b --- /dev/null +++ b/docs/html/preview/material/videos/ContactsAnim.ogv diff --git a/docs/html/preview/material/videos/ContactsAnim.webm b/docs/html/preview/material/videos/ContactsAnim.webm Binary files differnew file mode 100644 index 0000000..2a15ff5 --- /dev/null +++ b/docs/html/preview/material/videos/ContactsAnim.webm diff --git a/docs/html/preview/material/views-shadows.jd b/docs/html/preview/material/views-shadows.jd new file mode 100644 index 0000000..f7682f5 --- /dev/null +++ b/docs/html/preview/material/views-shadows.jd @@ -0,0 +1,95 @@ +page.title=Views and Shadows + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#elevation">View Elevation</a></li> + <li><a href="#shadows">Shadows and Outlines</a></li> + <li><a href="#clip">Clipping Views</a></li> +</ol> +</div> +</div> + +<p>The elevation of a view determines the size of its shadow: +views with higher Z values cast bigger shadows. Views only cast shadows on the Z=0 plane under an +orthographic projection (the views do not scale for different values of Z).</p> + +<p>Elevation is also useful to create animations where widgets temporarily rise above the +view plane when performing some action.</p> + + +<h2 id="elevation">View Elevation</h2> + +<p>The Z value for a view has two components, elevation and translation. The elevation is the +static component, and the translation is used for animations:</p> + +<p><code>Z = elevation + translationZ</code></p> + +<p>To set the elevation of a view:</p> + +<ul> + <li>In a layout definition, use the <code>android:elevation</code> attribute.</li> + <li>In the code of an activity, use the <code>View.setElevation</code> method.</li> +</ul> + +<p>To set the translation of a view, use the <code>View.setTranslationZ</code> method.</p> + +<p>The new <code>ViewPropertyAnimator.z</code> and <code>ViewPropertyAnimator.translationZ</code> +methods enable you to easily animate the elevation of views. For more information, see +the API reference for <code>ViewPropertyAnimator</code> and the <a +href="{@docRoot}guide/topics/graphics/prop-animation.html#object-animator">Property Animation</a> +developer guide.</p> + +<p>The Z values are measured in the same units as the X and Y values.</p> + + +<h2 id="shadows">Shadows and Outlines</h2> + +<p>The bounds of a view's background drawable determine the default shape of its shadow. +<strong>Outlines</strong> represent the outer shape of a graphics object and define the ripple +area for touch feedback.</p> + +<p>For example, if you define a view with a background drawable:</p> + +<pre> +<TextView + android:id="@+id/myview" + ... + android:elevation="2dp" + android:background="@drawable/myrect" /> +</pre> + +<p>where the background drawable is defined as a rectangle with rounded corners:</p> + +<pre> +<!-- res/drawable/myrect.xml --> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="#42000000" /> + <corners android:radius="5dp" /> +</shape> +</pre> + +<p>Then this view and drawable cast the appropiate shadow.</p> + +<p>You can also create outlines in your code using the methods in the <code>Outline</code> class, +and you can assign them to views with the <code>View.setOutline</code> method.</p> + +<p>To prevent a view from casting a shadow, set its outline to <code>null</code>.</p> + + +<h2 id="clip">Clipping Views</h2> + +<p>Clip a view to its outline area using the +<code>View.setClipToOutline</code> method. Only rectangle, circle, and round rectangle outlines +support clipping, as determined by the <code>Outline.canClip</code> method.</p> + +<p>To clip a view to the shape of a drawable, set the drawable as the background of the view +(as shown above) and call the <code>View.setClipToOutline</code> method.</p> + +<p>Because clipping views is an expensive operation, don't animate the shape you use to +clip a view. To achieve this effect, use a <a +href="{@docRoot}preview/material/animations.html#reveal">Reveal Effect</a> animation.</p>
\ No newline at end of file diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs new file mode 100644 index 0000000..75703a8 --- /dev/null +++ b/docs/html/preview/preview_toc.cs @@ -0,0 +1,88 @@ +<ul id="nav"> + + + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html">Set up the SDK + </a></div> + </li> + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/api-overview.html">API Overview + </a></div> + </li> + <li class="nav-section"> + + <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/material/index.html">Material Design + </a></div> + <ul> + <li><a href="<?cs var:toroot ?>preview/material/get-started.html">Get Started</a></li> + <li><a href="<?cs var:toroot ?>preview/material/theme.html">Material Theme</a></li> + <li><a href="<?cs var:toroot ?>preview/material/ui-widgets.html">UI Widgets</a></li> + <li><a href="<?cs var:toroot ?>preview/material/views-shadows.html">Views and Shadows</a></li> + <li><a href="<?cs var:toroot ?>preview/material/animations.html">Animations</a></li> + <li><a href="<?cs var:toroot ?>preview/material/compatibility.html">Compatibility</a></li> + </ul> + </li> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>preview/tv/index.html">TV</a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>preview/tv/start/index.html"> + Get Started</a></li> + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>preview/tv/ui/index.html"> + User Interface</a></div> + <ul> + <li><a href="<?cs var:toroot ?>preview/tv/ui/layouts.html"> + Layouts</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/ui/navigation.html"> + Navigation</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/ui/browse.html"> + BrowseFragment</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/ui/details.html"> + DetailsFragment</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/ui/in-app-search.html"> + In-App Search</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/ui/recommendations.html"> + Recommendations</a></li> + </ul> + </li> + <li><a href="<?cs var:toroot ?>preview/tv/games/index.html"> + Games on TV</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/start/hardware-features.html"> + Hardware Features</a></li> + <li><a href="<?cs var:toroot ?>preview/tv/adt-1/index.html"> + ADT-1</a></li> + </ul> + </li> + + <li class="nav-section"> + <div class="nav-section-header empty"> + <a href="<?cs var:toroot ?>preview/samples.html">Samples</a> + </div> + </li> + <li class="nav-section"> + <div class="nav-section-header empty"> + + <a href="<?cs var:toroot ?>preview/reference.html">Reference</a> + + </div> + </li> + <li class="nav-section"> + <div class="nav-section-header empty"> + <a href="<?cs var:toroot ?>preview/support.html">Support</a> + </div> + </li> + <li class="nav-section"> + <div class="nav-section-header empty"> + <a href="<?cs var:toroot ?>preview/license.html">License Agreement</a> + </div> + </li> + <li class="nav-section" style="margin: 20px 0 0 3px;"> + <div class="nav-section-header paging-links empty"> + <a href="<?cs var:toroot ?>index.html" class="prev-page-link">Developer Home</a> + </div> + </li> +</ul> diff --git a/docs/html/preview/reference.jd b/docs/html/preview/reference.jd new file mode 100644 index 0000000..f70f7a2 --- /dev/null +++ b/docs/html/preview/reference.jd @@ -0,0 +1,13 @@ +page.title=Reference + +@jd:body + +<p>The reference documentation and API difference report are available as downloadable packages. +</p> + +<ul> + <li><a href="{@docRoot}preview/l-developer-preview-reference.zip">L + Developer Preview reference</a></li> + <li><a href="{@docRoot}preview/l-developer-preview-api-diff.zip">L + Developer Preview difference report</a></li> +</ul>
\ No newline at end of file diff --git a/docs/html/preview/samples.jd b/docs/html/preview/samples.jd new file mode 100644 index 0000000..9bccb31 --- /dev/null +++ b/docs/html/preview/samples.jd @@ -0,0 +1,5 @@ +page.title=Samples + +@jd:body + +<p> </p>
\ No newline at end of file diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd new file mode 100644 index 0000000..78003f5 --- /dev/null +++ b/docs/html/preview/setup-sdk.jd @@ -0,0 +1,125 @@ +page.title=Setting Up the Preview SDK +@jd:body + +<p>The Preview SDK is available from the Android SDK Manager. <!-- Not yet! --> +This document assumes that you are familiar with Android app development, such +as using the Android SDK Manager and creating projects. If you're new to +Android, see <a href="/training/basics/firstapp/index.html">Building Your First +App</a> training lesson first.</a></p> + +<h2 id="downloadSdk">Download the SDK</h2> + +<ol> + <li>Start the Android SDK Manager.</li> + <li>In the <b>Tools</b> section, select the latest Android <b>SDK Tools</b>, + <b>Platform-tools</b>, and <b>Build-tools</b>.</li> + <!-- Android L not yet showing up in Android SDK Manager... --> + <li>Select everything under the <b>Android L Developer Preview</b> section and + click <b>Install packages...</b></li> + <li>Accept the Licensing Agreement for all of the packages and click + <b>Install</b>.</li> +</ol> + +<h2 id="setupHardware">Set Up Hardware and AVDs</h2> + +<p>The Android L developer preview provides you with 32-bit system images +to flash the following devices: +</p> + +<ul> + <li>Nexus 5</li> + <li>Nexus 7 Wi-Fi (version 2, released in 2013)</li> +</ul> + +<p>In addition, you also get the emulator system images, which includes +experimental 64-bit system images along with standard 32-bit system images. +</p> + +<h3 id="installImage">Install the L Preview System Image</h3> + +<p class="warning"><b>Warning:</b> This is a preview version of the Android +system image, and is subject to change. Your use of this system image is +governed by the Android SDK Preview License Agreement. The Android preview +system image is not a stable release, and may contain errors and defects that +can result in damage to your computer systems, devices, and data. The preview +Android system image is not subject to the same testing as the factory OS and +can cause your phone and installed services and applications to stop working. +</p> + + +<ol> + <li>Download and uncompress the Android Developer Preview package. + <p class="table-caption" id="table1"> + <strong>Table 1.</strong> L Developer Preview system images.</p> + <table> + <tr> + <th scope="col">Device</th> + <th scope="col">Download</th> + <th scope="col">MD5 Checksum</th> + <th scope="col">SHA-1 Checksum</th> + </tr> + <tr id="hammerhead"> + <td>Nexus 5 (GSM/LTE) "hammerhead"</td> + <td><!-- TODO --></td> + <td><code>5a6ae77217978cb7b958a240c2e80b57</code></td> + <td><code>ac1d8a8e4f4a1dca5864dc733caa940bffc28616</code></td> + </tr> + <tr id="razor"> + <td>Nexus 7 (Wifi) "razor"</td> + <td><!-- TODO --></td> + <td><code>b293a5d3a4e07beabebcc0be85ad68a2</code></td> + <td><code>d0ddf8ce733ba2a34279cdff8827fd604762c2342d</code></td> + </tr> + </table> + </li> + + <li>Follow the instructions at + <a href="https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a> + to flash the image onto your device.</li> +</ol> + +<h3 id="revertDevice">Revert a Device to Factory Specifications</h3> + + <p>If you want to uninstall the L Preview and revert the device to factory +specifications, go to <a href="http://developers.google.com/android +/nexus/images">developers.google.com/android</a> and download the image you want +to flash to for your device. Follow the instructions on that page to flash the +image to your device.</p> + +<h3 id="setupAVD">Set up an AVD</h3> + +<p>You can set up <a href="{@docRoot}tools/devices/">Android Virtual Devices +(AVD)</a> and use the emulator to build and test apps with the L Preview.</p> + +<p>To create an AVD with the AVD Manager:</p> + +<ol> + <li>Install the L Preview SDK in your development environment, as described + in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview + SDK.</a></li> + <li>Follow the steps in + <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD + Manager</a>. Use the following settings: + <ul> + <li><b>Device:</b> Either Nexus 5 or Nexus 7</li> + <li><b>Target:</b> <!-- Confirm exact text when we have final distro --> + Android L (Preview) - API Level L</li> + </ul> + <!-- Confirm this works when you can download image through SDK manager! --> + </li> +</ol> + +<h2 id="createProject">Create a Project</h2> + +<ol> + <li>Create a new Android project with the following properties: + <ul> + <li>Minimum SDK Version: L</li> + <li>Target SDK Version: L</li> + <li>Build Target: L</li> + </ul> + </li> + <li>Choose the theme <code>Theme.Material</code> + <!-- put in name as it appears in Eclipse menu? --> + +</ol> diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd new file mode 100644 index 0000000..8efc4bc --- /dev/null +++ b/docs/html/preview/support.jd @@ -0,0 +1,108 @@ +page.title=Support + +@jd:body + +<p>If you've encountered bugs or have feedback about the L Developer Preview, +<a href="https://code.google.com/p/android-developer-preview/">create an issue</a> on +our issue tracker.</p> + +<p>For more support, +<a href="https://plus.google.com/communities/113159138894928487684">join +the L Developer Preview Google+ community</a> to discuss your development experiences. + + +<h2 id="ReleaseNotes">Release Notes</h2> +<p>June 25, 2014 - Initial Release of the L Developer Preview</p> + +<h3 id="UserInterface">User interface</h3> +<ul> +<li>If your app launches an activity with +{@link android.app.Activity#startActivity startActivity()} +and an {@link android.content.Intent} set to +{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET}, the +activity shows up as a separate task in the Recent apps screen. This is the +same behavior as though your app used {@code Intent.FLAG_ACTIVITY_NEW_DOCUMENT} +(see <a href="{@docRoot}preview/api-overview.html#Recents">Concurrent +documents and activities in the Recents screen</a>). If you want your activity +to remain in the same task that launched it, use +{@link android.app.Activity#startActivityForResult +startActivityForResult()} instead.</li> +<li>System-rendered shadows for user interface (UI) elements in views may +appear with visible spiky edges. To avoid this visual artifact, use a higher +<a href="{@docRoot}preview/material/views-shadows.html#elevation">view +elevation</a>.</li> +<li>On very tall or wide views, view shadows may appear with additional rough +visual artifacts around the view edges. To minimize this, avoid using view +shadows with very narrow views.</li> +<li>The {@code android.graphics.drawable.RippleDrawable} class does not +respond to pointer location changes, except when the drawable is set as a +{@link android.view.View} background.</li> +</ul> + +<h3 id="Multimedia">Multimedia</h3> +<ul> +<li>The {@code android.hardware.camera2} APIs are supported only on Nexus 5 +devices.</li> +<li>Saving a DNG file with the new {@code android.hardware.camera2.DngCreator} +API fails if lens shading compensation map generation is not enabled. To +capture images to DNG files, add the following code when creating your capture +requests: +<pre> +CaptureRequest.Builder stillCaptureRequest = + mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); + +stillCaptureRequest.set(CaptureRequest.STATISTICS_LENS_SHADING_MAP_MODE, + CaptureRequest.STATISTICS_LENS_SHADING_MAP_MODE_ON); +</pre></li> +<li>The {@code android.media.AudioTrack.write(float[], int, int, int)} method +currently does not work. Use the +{@link android.media.AudioTrack#write(short[], int, int) +AudioTrack.write(short[], int, int)} method instead.</li> +<li>Lockscreen security is currently not enforced when users start a Android +mirroring session from the Quick Settings shade.</li> +</ul> + +<h3 id="UserInput">User input</h3> +<ul><li>The System UI may crash unexpectedly while the device is charging, if + the locale is set to {@code fr} (FRENCH).</li></ul> + +<h3 id="Wireless">Wireless and Connectivity</h3> +<ul> +<li>The {@code android.bluetooth.le} APIs are supported only on Nexus 5 +devices.</li> +<li>You might encounter these issues while using Bluetooth LE scanning: + <ul> + <li><em>Settings</em> does not show all Bluetooth LE devices when a scan + filter is set.</li> + <li>System returns non-intuitive error messages during a Bluetooth LE scan, + when Bluetooth is off.</li> + <li>The {@code BluetoothLeScanner.startScan()} method starts failing after + six concurrent scans with different callbacks.</li> + </ul> +</li> +<li>You might encounter these issues while using Bluetooth LE advertising: + <ul> + <li>The device MAC address does not change for multiple advertising + when the application processor is asleep.</li> + <li>The TX Power Level is always 0 in advertising packets.</li> + </ul> +</li> +</ul> + +<h3 id="Enterprise">Enterprise</h3> +<ul> +<li>The device may crash unexpectedly in these situations when using +Android work functionality: +<ul> +<li>The user attempts to share a web page (via <strong>Menu > Share</strong>) +from a non-Android work Chrome app to a Android work profile Gmail app.</li> +<li>The user attempts to share a web page via Bluetooth from a +Android work profile +Chrome app.</li> +<li>The user attempts to share a web page via Android Beam from a +Android work profile Chrome app.</li> +</ul> +</li> +<li>Deleting a Android work profile may take several minutes to complete. You +cannot create a new Android work profile until the deletion operation is over.</li> +</ul> diff --git a/docs/html/sdk/exploring.jd b/docs/html/sdk/exploring.jd index 7749060..b34c1cf 100644 --- a/docs/html/sdk/exploring.jd +++ b/docs/html/sdk/exploring.jd @@ -5,163 +5,6 @@ walkthru=1 @jd:body -<p>The Android SDK is composed of modular packages that you can download separately using -the Android 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. Simply follow the procedures described in <a -href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms and Packages</a>.</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 once you download them.</p> - - -<h2 id="Packages">Available Packages</h2> - - -<table> - <tr><th>Package</th><th>Description</th><th>File Location</th></tr> - <tr> - <td><a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a></td> - <td>Contains tools for debugging and testing, plus other -utilities that are required to develop an app. If you've just installed the SDK starter package, -then you already have the latest version of this package. Make sure you keep this up to date.</td> - <td>{@code <sdk>/tools/}</td></tr> - <tr><td>SDK Platform-tools</td> - <td>Contains platform-dependent tools for developing and debugging -your application. These tools support the latest features of the Android platform and are typically -updated only when a new platform becomes available. These tools are always backward compatible with -older platforms, but you must be sure that you have the latest version of these tools when you -install a new SDK platform.</td> - <td>{@code <sdk>/platform-tools/}</td> - </tr> - - <tr> - <td>Documentation</td> - <td>An offline copy of the latest documentation for the Android -platform APIs.</td> - <td>{@code <sdk>/docs/}</td> - </tr> - <tr><td>SDK Platform</td> - <td>There's one SDK Platform available for each version of Android. It includes an {@code -android.jar} file with a fully compliant Android library. In order to build an Android app, you must -specify an SDK platform as your build target.</td> - <td>{@code <sdk>/platforms/<android-version>/}</td> - </tr> - <tr> - <td>System Images</td> - <td>Each platform version offers one or more different system images (such as for ARM -and x86). The Android emulator requires a system image to operate. You should always test your -app on the latest version of Android and using the emulator with the latest system image is a -good way to do so.</td> - <td>{@code <sdk>/platforms/<android-version>/}</td> - </tr> - <tr> - <td>Sources for Android SDK</td> - <td>A copy of the Android platform source code that's useful for -stepping through the code while debugging your app.</td> - <td>{@code <sdk>/sources/}</td> - </tr> - <tr> - <td><a href="{@docRoot}tools/samples/index.html">Samples for SDK</a></td> - <td>A collection of sample apps that demonstrate a variety of the -platform APIs. These are a great resource to browse Android app code. The API Demos app in -particular provides a huge number of small demos you should explore.</td> - <td>{@code <sdk>/platforms/<android-version>/samples/}</td> - </tr> - <tr> - <td><a href="http://developers.google.com/android">Google APIs</a></td> - <td>An SDK add-on that provides both a platform you can use to develop an app -using special Google APIs and a system image for the emulator so you can test your app using the -Google APIs.</td> - <td>{@code <sdk>/add-ons/}</td> - </tr> - - <tr> - <td><a href="{@docRoot}tools/support-library/index.html">Android Support</a></td> - <td>A static library you can include in your app sources in order to use powerful -APIs that aren't available in the standard platform. For example, the support library -contains versions of the {@link android.support.v4.app.Fragment} class that's compatible with -Android 1.6 and higher (the class was originally introduced in Android 3.0) and the {@link -android.support.v4.view.ViewPager} APIs that allow you to easily build a side-swipeable UI.</td> - <td>{@code <sdk>/extras/android/support/}</td> - </tr> - <tr> - <td><a href="{@docRoot}google/play/billing/index.html">Google Play Billing</a></td> - <td>Provides the static libraries and samples that allow you to -integrate billing services in your app with Google Play.</td> - <td>{@code <sdk>/extras/google/}</td> - </tr> - <tr> - <td><a href="{@docRoot}google/play/licensing/index.html">Google Play Licensing</a></td> - <td>Provides the static libraries and samples that allow you to perform license verification for -your app when distributing with Google Play.</td> - <td>{@code <sdk>/extras/google/}</td> - </tr> -</table> - -<p>The above table is not comprehensive and you can <a -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. For example, there may be a dependency between the ADT Plugin for -Eclipse and -the SDK Tools package. When you install the SDK Tools -package, you should also upgrade to the required version of ADT (if you -are developing in Eclipse). In this case, the major version number for your ADT plugin should -always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8). -</p> - -<p>The development tools will notify you with debug warnings if there is dependency that you need to -address. The Android SDK Manager also enforces dependencies by requiring that you download 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>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> - -<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> - -<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> -</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> - diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd index 9ee1cca..aa4fd68 100644 --- a/docs/html/sdk/index.jd +++ b/docs/html/sdk/index.jd @@ -206,12 +206,10 @@ This is the Android Software Development Kit License Agreement <div id="next-steps" style="display:none;position:absolute;width:inherit"> - <p>Now that you've downloaded the Android SDK, you don't need to return here - for SDK updates. The SDK tools allow you to - install additional packages and future updates from the SDK Manager.</p> - <p>For instructions about setting up your Android SDK for the first time, - read <a id="next-link" href="{@docRoot}sdk/installing/bundle.html">Setting - Up the ADT Bundle</a>.</p> + <p>You're just a few steps away from building apps for Android!</p> + <p>In a moment, you'll be redirected to <a + id="next-link" href="{@docRoot}sdk/installing/index.html">Installing the + Android SDK</a>.</p> </div><!-- end next-steps --> @@ -232,7 +230,6 @@ This is the Android Software Development Kit License Agreement </div> - </div><!-- end TOS --> @@ -255,16 +252,30 @@ Android SDK components and a version of the Eclipse IDE with built-in <b>ADT (Android Developer Tools)</b> to streamline your Android app development.</p> -<p>With a single download, the ADT Bundle + +<!-- this appears when viewing the online docs --> +<div class="online" style="margin-bottom:85px"> + +<a class="big button subtitle" id="download-bundle-button" +href="" style="width:295px;display:block;margin:25px 0" ></a> + +<p id="not-supported">Choose the SDK package for your OS from the table below.</p> + + + <p>With a single download, the Eclipse ADT bundle includes everything you need to begin developing apps:</p> <ul> <li>Eclipse + ADT plugin</li> <li>Android SDK Tools</li> <li>Android Platform-tools</li> -<li>The latest Android platform</li> -<li>The latest Android system image for the emulator</li> +<li>A version of the Android platform</li> +<li>A version of the Android system image for the emulator</li> </ul> +</div> +<!-- end online --> + + <!-- this appears when viewing the offline docs --> <p class="offline"> @@ -277,52 +288,44 @@ href="http://developer.android.com/sdk/index.html">developer.android.com/sdk/</a <div class="col-7" style="margin-right:0;"> - <img src="{@docRoot}images/sdk-cube.png" alt="" height=264 /> - -<!-- this appears when viewing the online docs --> -<div class="online"> - -<a class="big button subtitle" id="download-bundle-button" -href="" style="display:none;width:265px;margin:0 auto;display:block" ></a> + <img src="{@docRoot}images/tools-home.png" alt="" height="347" width="400" /> +</div><!-- end col-7 --> -<p id="not-supported">Choose the SDK package for your OS from the table below.</p> -</div> -<!-- end online --> -</div><!-- end col-7 --> +<div class="col-7" style="background: #ddd; + padding: 30px 20px; width:350px; margin:20px 0 0 20px;"> + <h3 style="margin-top:0"> + <a href="/sdk/installing/studio.html">Get Android Studio Beta</a> + </h3> + <p> + Android Studio is a new IDE powered by IntelliJ that provides new features and improvements + over ADT. It's currently in beta but will be the official Android IDE once it's ready.</p> + <p style="margin: 0;"> + <a href="/sdk/installing/studio.html">Learn more about Android Studio</a></p> + </div> <!-- alternative SDK options --> -<div class="col-13" style="margin:0;"> - +<div class="col-13" style="margin:-70px 0 0;"> -<!-- this appears only when viewing the online docs --> -<div class="online caution"> -<h3 style="margin:0 0 10px 0;font-size:14px">Android Studio Early Access Preview</h3> -<p>A new Android development environment called Android Studio, -based on IntelliJ IDEA, is now available as an <strong>early access preview</strong>. -For more information, see -<a href="{@docRoot}sdk/installing/studio.html">Getting Started with Android Studio</a>.</p> +<p style="width:340px">If you prefer to use an existing version of Eclipse or another IDE, +you can instead download the stand-alone Android SDK Tools:</p> -</div> -<p>If you prefer to use an existing version of Eclipse or another IDE, -you can instead take a more customized approach to installing -the Android SDK. See the following instructions:</p> <h4 id="ExistingIDE"><a href='' class="expandable" onclick="toggleExpandable(this,'.myide');hideExpandable('.pax,.reqs');return false;" - >USE AN EXISTING IDE</a></h4> + >GET THE SDK FOR AN EXISTING IDE</a></h4> <div class="col-13 myide" style="margin:0 0 15px;display:none;"> @@ -335,13 +338,11 @@ the ADT plugin to it.</p> <a class="button subtitle" id="download-tools-button" href="" style="display:none" ></a> </p> - </div> - <h4 id="Requirements"><a href='' class="expandable" onclick="toggleExpandable(this,'.reqs');hideExpandable('.pax,.myide');return false;" >SYSTEM REQUIREMENTS</a></h4> @@ -361,23 +362,9 @@ the ADT plugin to it.</p> </ul> </div> -<div class="col-6 reqs" style="margin:0 0 15px 20px;display:none;"> -<h5>Eclipse IDE</h5> - <ul> - <li><a href="http://eclipse.org/mobile/">Eclipse</a> 3.7.2 (Indigo) or greater -<p class="note"><strong>Note:</strong> Eclipse 3.6 (Helios) is no longer -supported with the latest version of ADT.</p></li> - <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included -in most Eclipse IDE packages) </li> - <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a> - (JRE alone is not sufficient)</li> - <li><a href="{@docRoot}tools/sdk/eclipse-adt.html">Android Development Tools plugin</a> -(recommended)</li> - <li><strong>Not</strong> compatible with GNU Compiler for Java (gcj)</li> - </ul> - +<div class="col-7 reqs" style="margin:0 0 80px 20px;display:none;"> -<h5>Other development environments</h5> +<h5>Development tools</h5> <ul> <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a> (JRE alone is not sufficient)</li> @@ -387,6 +374,4 @@ in most Eclipse IDE packages) </li> <p class="note"><strong>Note:</strong> Some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are <em>not</em> supported for Android development. </p> -</div><!-- end col-7 reqs --> - - +</div><!-- end reqs -->
\ No newline at end of file diff --git a/docs/html/sdk/installing/adding-packages.jd b/docs/html/sdk/installing/adding-packages.jd index bba936e..e6c0118 100644 --- a/docs/html/sdk/installing/adding-packages.jd +++ b/docs/html/sdk/installing/adding-packages.jd @@ -1,63 +1,226 @@ -page.title=Adding Platforms and Packages +page.title=Adding SDK Packages @jd:body +<style> +ol.large { + margin-left:0; +} +ol.large > li { + list-style-position: inside; + list-style-type:none; + margin:30px 0 0 0; + padding:30px 20px; + background:#eee; +} +ol.large > li:nth-child(odd) { +} +ol.large > li:before { + display:inline; + left:-40px; + float:left; + width:20px; + font-size:20px; + line-height:20px; +} +ol.large > li > h2 { + font-size:20px; + line-height:20px; + padding:0 0 0 20px; + margin:0 0 20px 0; + display:inline-block; + font-weight:normal; +} +ol.large > li:nth-child(1):before { + content:"1. "; +} +ol.large > li:nth-child(2):before { + content:"2. "; +} +ol.large > li:nth-child(3):before { + content:"3. "; +} +ol.large > li:nth-child(4):before { + content:"4. "; +} +ol.large > li:nth-child(5):before { + content:"5. "; +} +ol.large > li:nth-child(6):before { + content:"6. "; +} +</style> -<p>The Android SDK separates tools, platforms, and other components into packages you can - download using the Android SDK Manager. The original -SDK package you've downloaded includes only the SDK Tools. To develop an Android app, -you also need to download at least one Android platform and the latest SDK Platform-tools.</p> -<ol> -<li>Launch the SDK Manager. -<p>If you've used the Windows installer to install the SDK tools, you should already have the -Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following -ways:</p> +<p> +By default, the Android SDK does not include everything you need to start developing. +The SDK separates tools, platforms, and other components into packages you can +download as needed using the +<a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>. +So before you can start, there are a few packages you should add to your Android SDK.</p> + +<p>To start adding packages, launch the Android SDK Manager in one of the following ways:</p> <ul> - <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 -Android SDK, then execute <code>android sdk</code>.</li> + <li>In Eclipse or Android Studio, click <strong>SDK Manager</strong> +<img src="{@docRoot}images/tools/sdk-manager-studio.png" +style="vertical-align:bottom;margin:0;height:17px" /> in the toolbar.</li> + <li>If you're not using Eclipse or Android Studio: + <ul> + <li>Windows: Double-click the <code>SDK Manager.exe</code> file at the root of the Android + SDK directory.</li> + <li>Mac/Linux: Open a terminal and navigate to the <code>tools/</code> directory in the + Android SDK, then execute <code>android sdk</code>.</li> + </ul> + </li> </ul> + +<p>When you open the SDK Manager for the first time, several packages will be selected by +default. Leave these selected, but be sure you have everything you need +to get started by following these steps:</p> + + +<ol class="large"> +<li> + <h2 id="GetTools" class="norule">Get the latest SDK tools</h2> + +<img src="/images/sdk_manager_packages.png" alt="" width="350" style="float:right;margin-left:20px" /> + + <p>As a minimum when setting up the Android SDK, + you should download the latest tools and Android platform:</p> + <ol> + <li>Open the Tools directory and select: + <ul> + <li><strong>Android SDK Tools</strong></li> + <li><strong>Android SDK Platform-tools</strong></li> + <li><strong>Android SDK Build-tools</strong> (highest version)</li> + </ul> + </li> + <li>Open the first Android X.X folder (the latest version) and select: + <ul> + <li><strong>SDK Platform</strong></li> + <li>A system image for the emulator, such as <br> + <strong>ARM EABI v7a System Image</strong></li> + </ul> + </li> + </ol> </li> -<li>The SDK Manager shows all the SDK packages available for you to add to your Android SDK. -As a minimum configuration for your SDK, we recommend you install the following: -<ul> - <li>The latest Tools packages (check the <strong>Tools</strong> folder).</li> - <li>The latest version of Android (check the first <strong>Android</strong> folder).</li> - <li>The Android Support Library (open the <strong>Extras</strong> folder and check - <strong>Android Support Library</strong>).</li> -</ul> +<li> + <h2 id="GetSupportLib" class="norule">Get the support library for additional APIs</h2> -<p>Once you've chosen your packages, click <strong>Install</strong>. The Android SDK Manager -installs the selected packages into your Android SDK environment.</li> -</ol> + <div class="sidebox"> + <p>The support library is required for:</p> + <ul> + <li><a href="{@docRoot}wear/index.html">Android Wear</a></li> + <li><a href="{@docRoot}tv/index.html">Android TV</a></li> + <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li> + </ul> -<p>With these packages installed, you're ready to start developing. -To get started, read <a href="{@docRoot}training/basics/firstapp/index.html" ->Building Your First App</a>.</p> + <p>It also provides these popular APIs:</p> + <ul> + <li><a href="{@docRoot}reference/android/support/v4/widget/DrawerLayout.html">Navigation + drawer</a></li> + <li><a href="{@docRoot}reference/android/support/v4/view/ViewPager.html">Swipe views</a></li> + <li><a href="{@docRoot}reference/android/support/v7/app/ActionBar.html">Backward-compatible + action bar</a></li> + </ul> + </div> -<img src="/images/sdk_manager_packages.png" alt="" height="396" /> -<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>The <a href="{@docRoot}tools/support-library/features.html">Android Support Library</a> + provides an extended set of APIs that are compatible with most versions of Android.</p> + <p>Open the <strong>Extras</strong> directory and select:</p> + <ul> + <li><strong>Android Support Repository</strong></li> + <li><strong>Android Support Library</strong></li> + </ul> + <p> </p> + <p> </p> -<h3>Additional information</h3> +</li> -<ul> - <li>For more information about using the SDK Manager and some of the available packages, -see the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> document.</li> - <li>This web site provides all information you need to develop Android apps, including <a -href="{@docRoot}design/index.html">design guidelines</a>, -<a href="{@docRoot}training/index.html">developer training</a>, <a -href="{@docRoot}reference/packages.html">API reference</a>, and information -about how you can <a href="{@docRoot}distribute/index.html">distribute your app</a>. We recommend -you begin by reading <a href="{@docRoot}training/basics/firstapp/index.html" ->Building Your First App</a>.</li> - <li>For additional resources about developing and distributing your app, see the -<a href="{@docRoot}support.html">Developer Support Resources</a>.</li> -</ul> + +<li> + <h2 id="GetGoogle" class="norule">Get Google Play services for even more APIs</h2> + + <div class="sidebox"> + + <p>The Google Play services APIs provide a variety of features and services for your Android + apps, such as:</p> + <ul> + <li><a href="{@docRoot}google/play-services/plus.html">User authentication</a></li> + <li><a href="{@docRoot}google/play-services/maps.html">Google Maps</a></li> + <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li> + <li><a href="{@docRoot}google/play-services/games.html">Games achievements and + leaderboards</a></li> + <li><a href="{@docRoot}google/play-services/index.html">And much more</a></li> + </ul> + </div> + + <p>To develop with Google APIs, you need the Google Play services package:</p> + <p>Open the <strong>Extras</strong> directory and select:</p> + <ul> + <li><strong>Google Repository</strong></li> + <li><strong>Google Play services</strong></li> + </ul> + + <p class="note"><strong>Note:</strong> Google Play services APIs are not available on all + Android-powered devices, but are available on all devices with Google Play Store. To use these + APIs in the Android emulator, you must also install the the <strong>Google APIs</strong> + system image from the latest Android X.X directory in the SDK Manager.</p> +</li> + + +<li> + <h2 id="Install" class="norule">Install the packages</h2> + <p>Once you've selected all the desired packages, continue to install:</p> + <ol> + <li>Click <strong>Install X packages</strong>.</li> + <li>In the next window, double-click each package name on the left + to accept the license agreement for each.</li> + <li>Click <strong>Install</strong>.</li> + </ol> + <p>The download progress is shown at the bottom of the SDK Manager window. + <strong>Do not exit the SDK Manager</strong> or it will cancel the download.</p> +</li> + +<li> + <h2 id="Build" class="norule">Build something!</h2> + +<p>With the above packages now in your Android SDK, you're ready to build apps +for Android. As new tools and other APIs become available, simply launch the SDK Manager + to download the new packages for your SDK.</p> + +<p>Here are a few options for how you should proceed:</p> + +<div class="cols" style="padding:10px 0"> +<div class="col-4"> +<h3>Get started</h3> +<p>If you're new to Android development, learn the basics of Android apps by following +the guide to <strong><a href="{@docRoot}training/basics/firstapp/index.html" +>Building Your First App</a></strong>.</p> + +</div> +<div class="col-4 box"> +<h3>Build for wearables</h3> +<p>If you're ready to start building apps for Android wearables, see the guide to +<strong><a href="{@docRoot}wear/preview/start.html">Building Apps for Android Wear</a></strong>.</p> + +</div> +<div class="col-4 box"> +<h3>Use Google APIs</h3> +<p>To start using Google APIs, such as Maps or +Play Game services, see the guide to +<strong><a href="{@docRoot}google/play-services/setup.html">Setting Up Google Play +Services</a></strong>.</p> + +</div> +</div><!-- end cols --> + + +</li> + +</ol> diff --git a/docs/html/sdk/installing/bundle.jd b/docs/html/sdk/installing/bundle.jd index 1f7da55..22bdd11 100644 --- a/docs/html/sdk/installing/bundle.jd +++ b/docs/html/sdk/installing/bundle.jd @@ -1,45 +1,3 @@ page.title=Setting Up the ADT Bundle @jd:body - - -<p>The ADT Bundle provides everything you need to start developing apps, including -a version of the Eclipse IDE with built-in <b>ADT (Android Developer Tools)</b> to -streamline your Android app development. -If you haven't already, go download the <a href="{@docRoot}sdk/index.html" ->Android ADT Bundle</a>. (If you downloaded the SDK Tools only, for use with an -existing IDE, you should instead read -<a href="{@docRoot}sdk/installing/index.html">Setting Up an Existing IDE</a>.)</p> - -<h3>Install the SDK and Eclipse IDE</h3> -<ol> -<li>Unpack the ZIP file -(named {@code adt-bundle-<os_platform>.zip}) and save it to an appropriate location, -such as a "Development" directory in your home directory.</li> -<li>Open the {@code adt-bundle-<os_platform>/eclipse/} directory and launch -<strong>eclipse</strong>.</li> -</ol> - -<p>That's it! The IDE is already loaded with the Android Developer Tools plugin and -the SDK is ready to go. To start developing, read <a href="{@docRoot}training/basics/firstapp/index.html" ->Building Your First App</a>.</p> - -<p class="caution"><strong>Caution:</strong> Do not move any of the files or directories -from the {@code adt-bundle-<os_platform>} directory. If you move the {@code eclipse} -or {@code sdk} directory, ADT will not be able to locate the SDK and you'll -need to manually update the ADT preferences.</p> - -<h3>Additional information</h3> - -<p>As you continue developing apps, you may need to install additional versions -of Android for the emulator and other packages such as the library for -Google Play In-app Billing. To install more packages, use -the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</p> - -<p>Everything you need to develop Android apps is on this web site, including <a -href="{@docRoot}design/index.html">design guidelines</a>, -<a href="{@docRoot}training/index.html">developer training</a>, <a -href="{@docRoot}reference/packages.html">API reference</a>, and information -about how you can <a href="{@docRoot}distribute/index.html">distribute your app</a>. -For additional resources about developing and distributing your app, see the -<a href="{@docRoot}support.html">Developer Support Resources</a>.</p>
\ No newline at end of file diff --git a/docs/html/sdk/installing/create-project.jd b/docs/html/sdk/installing/create-project.jd new file mode 100644 index 0000000..c0d523a --- /dev/null +++ b/docs/html/sdk/installing/create-project.jd @@ -0,0 +1,86 @@ +page.title=Creating a Project + +@jd:body + +<p>Android Studio makes it easy to create Android apps for several form factors, such as phone, +tablet, TV, Wear, and Google Glass. The <em>New Project</em> wizard lets you choose the form factors +for your app and populates the project structure with everything you need to get started.</p> + +<p>Follow the steps in this section to create a project in Android Studio.</p> + +<h2>Step 1: Create a New Project</h2> + +<p>If you didn't have a project opened, Android Studio shows the Welcome screen. +To create a new project, click <strong>New Project</strong>.</p> + +<p>If you had a project opened, Android Studio shows the development environment. +To create a new project, click <strong>File</strong> > <strong>New Project</strong>.</p> + +<p>The next window lets you configure the name of your app, the package name, and the location +of your project.</p> + +<img src="{@docRoot}images/tools/wizard2.png" alt="" width="500" height="381"> +<p class="img-caption"><strong>Figure 1.</strong> Choose a name for your project.</p> + +<p>Enter the values for your project and click <strong>Next</strong>.</p> + + +<h2>Step 2: Select Form Factors and API Level</h2> + +<p>The next window lets you select the form factors supported by your app, such as phone, tablet, +TV, Wear, and Google Glass. For each form factor, you can also select the API +Level that your app requires. To get more information, click <strong>Help me choose</strong>.</p> + +<img src="{@docRoot}images/tools/wizard4.png" alt="" width="750" height="510"> +<p class="img-caption"><strong>Figure 2.</strong> Select the API Level.</p> + +<p>The API Level window shows the distribution of mobile devices running each version of Android, +as shown in Figure 2. Click on an API level to see a list of features introduced in the corresponding +version of Android. This helps you choose the minimum API Level that has all the features that +your apps needs, so you can reach as many devices as possible. Then click <strong>OK</strong>.</p> + +<img src="{@docRoot}images/tools/wizard3.png" alt="" width="500" height="480"> +<p class="img-caption"><strong>Figure 3.</strong> Choose form factors for your app.</p> + +<p>Then, on the Form Factors Window, click <strong>Next</strong>.</p> + + +<h2>Step 3: Add an Activity</h2> + +<p>The next screen lets you select an activity type to add to your app, as shown in Figure 4. +This screen depends on the form factors you selected earlier.</p> + +<img src="{@docRoot}images/tools/wizard5.png" alt="" width="720" height="504"> +<p class="img-caption"><strong>Figure 4.</strong> Add an activity to your app.</p> + +<p>Choose an activity type and click <strong>Next</strong>.</p> + + +<h2>Step 4: Configure Your Activity</h2> + +<p>The next screen lets you configure the activity to add to your app, as shown in Figure 6.</p> + +<img src="{@docRoot}images/tools/wizard6.png" alt="" width="450" height="385"> +<p class="img-caption"><strong>Figure 6.</strong> Choose a name for your activity.</p> + +<p>Enter the activity name, the layout name, and the activity title. Then click +<strong>Finish</strong>.</p> + + +<h2>Step 5: Develop Your App</h2> + +<p>Android Studio creates the default structure for your project and opens the development +environment. If your app supports more than one form factor, Android Studio creates a module for +each of them, as shown in Figure 7.</p> + +<img src="{@docRoot}images/tools/wizard7.png" alt="" width="750" height="509"> +<p class="img-caption"><strong>Figure 7.</strong> The default project structure for a mobile app.</p> + +<p>Now you are ready to develop your app. Fore more information, see the following links:</p> + +<ul> +<li><a href="{@docRoot}training/">Training Lessons</a></li> +<li><a href="{@docRoot}training/building-wearables.html">Building Apps for Wearables</a></li> +<li><a href="{@docRoot}tv/">Android TV</a></li> +<li><a href="https://developers.google.com/glass/">Google Glass</a></li> +</ul> diff --git a/docs/html/sdk/installing/index.jd b/docs/html/sdk/installing/index.jd index 6b63ba7..304b53d 100644 --- a/docs/html/sdk/installing/index.jd +++ b/docs/html/sdk/installing/index.jd @@ -1,19 +1,217 @@ -page.title=Setting Up an Existing IDE +page.title=Installing the Android SDK @jd:body +<style> +p.paging-links { + margin:0 0 40px; +} +.paging-links .next-page-link { + right:initial; +} +.procedure-box { + padding:20px 20px 5px; + margin-bottom:1em; + background:#eee; +} +.landing-button { + min-width: 155px; + text-align: center; +} +</style> + + + +<!-- ################### ADT BUNDLE ####################### --> +<div id="adt" heading="Installing the Eclipse ADT Bundle" style="display:none"> + + +<p>The Eclipse ADT Bundle provides everything you need to start developing apps, including +the Android SDK tools and a version of the Eclipse IDE with built-in ADT +(Android Developer Tools) to streamline your Android app development.</p> + +<p>If you didn't download the Eclipse ADT bundle, go <a href="{@docRoot}sdk/index.html" +><b>download the Eclipse ADT bundle now</b></a>, or switch to the +<a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio +install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools +install</a> instructions</i>.</p> + +<div class="procedure-box"> +<p><b>To set up the ADT Bundle:</b></p> +<ol> +<li>Unpack the ZIP file +(named {@code adt-bundle-<os_platform>.zip}) and save it to an appropriate location, +such as a "Development" directory in your home directory.</li> +<li>Open the {@code adt-bundle-<os_platform>/eclipse/} directory and launch +<strong>Eclipse</strong>.</li> +</ol> + +<p class="caution"><strong>Caution:</strong> Do not move any of the files or directories +from the {@code adt-bundle-<os_platform>} directory. If you move the {@code eclipse/} +or {@code sdk/} directory, ADT will not be able to locate the SDK and you'll +need to manually update the ADT preferences.</p> +</div> + +<p>Eclipse with ADT is now ready and loaded with the Android developer tools, but there are still +a couple packages you should add to make your Android SDK complete.</p> + +<p class="paging-links"> +<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> +Continue: Adding SDK Packages</a></p> + + +</div> +<!-- ################ END ADT BUNDLE ##################### --> + + + + + + +<!-- ################ STUDIO ##################### --> +<div id="studio" heading="Installing Android Studio" style="display:none"> + +<p>Android Studio provides everything you need to start developing apps, including +the Android SDK tools and the Android Studio IDE (powered by IntelliJ) to +streamline your Android app development.</p> + +<p>If you didn't download Android Studio, go <a href="{@docRoot}sdk/installing/studio.html" +><b>download Android Studio now</b></a>, or switch to the +<a href="{@docRoot}sdk/installing/index.html?pkg=adt">Eclipse ADT +install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools +install</a> instructions.</p> + + +<p>Before you set up Android Studio, be sure you have installed +JDK 6 or greater (the JRE alone is not sufficient). To check if you +have JDK installed (and which version), open a terminal and type <code>javac -version</code>. +If the JDK is not available or the version is lower than 6, +<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" class="external-link" +>go download JDK</a>.</p> + + +<div class="procedure-box"> + +<p id="instructions-toggle" +style="float:right;font-size:13px"><a href='' onclick='showAll();return false;' +>[ Show instructions for all platforms ]</a></p> + +<div class="win docs" style="display:none"> + +<p><b>To set up Android Studio on Windows:</b></p> + <ol> + <li>Launch the downloaded EXE file, {@code android-studio-bundle-<version>.exe}.</li> + <li>Follow the setup wizard to install Android Studio. + + <p>On some Windows systems, the launcher script does not find where Java is installed. + If you encounter this problem, + you need to set an environment variable indicating the correct location.</p> + <p>Select <strong>Start menu > Computer > System Properties > + Advanced System Properties</strong>. Then open <strong>Advanced tab > Environment + Variables</strong> and add a new system variable <code>JAVA_HOME</code> that points to + your JDK folder, for example <code>C:\Program Files\Java\jdk1.7.0_21</code>.</p> + </p> + </li> + + </ol> + + +<p>The individual tools and +other SDK packages are saved within the Android Studio application directory. +If you need to access the tools directly, use a terminal to navigate into the application and locate +the {@code sdk/} directory. For example:</p> +<p><code>\Users\<user>\AppData\Local\Android\android-studio\sdk\</code></p> + + + +</div><!-- end windows --> + + +<div class="mac docs" style="display:none"> + +<p><b>To set up Android Studio on Mac OSX:</b></p> + <ol> + <li>Open the downloaded DMG file, {@code android-studio-bundle-<version>.dmg}.</li> + <li>Drag and drop Android Studio into the Applications folder. + <p> + Depending on your security settings, when you attempt to open Android Studio, you might + see a warning that says the package is damaged and should be moved to the trash. If this + happens, go to <strong>System Preferences > Security & Privacy</strong> and under + <strong>Allow applications downloaded from</strong>, select <strong>Anywhere</strong>. + Then open Android Studio again.</p> + </li> + </ol> + +<p>The individual tools and +other SDK packages are saved within the Android Studio application directory. +If you need access the tools directly, use a terminal to navigate into the application and locate +the {@code sdk/} directory. For example:</p> +<p><code>/Applications/Android\ Studio.app/sdk/</code></p> + + +</div><!-- end mac --> + + +<div class="linux docs" style="display:none"> + +<p><b>To set up Android Studio on Linux:</b></p> + + <ol> + <li>Unpack the downloaded Tar file, {@code android-studio-bundle-<version>.tgz}, into an appropriate + location for your applications. + <li>To launch Android Studio, navigate to the {@code android-studio/bin/} directory + in a terminal and execute {@code studio.sh}. + <p>You may want to add {@code android-studio/bin/} to your PATH environmental + variable so that you can start Android Studio from any directory.</p> + </li> + </ol> + +</div><!-- end linux --> +</div><!-- end procedure box --> + +<p>Android Studio is now ready and loaded with the Android developer tools, but there are still a +couple packages you should add to make your Android SDK complete.</p> + +<p class="paging-links"> +<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> +Continue: Adding SDK Packages</a></p> + + +</div> +<!-- ################ END STUDIO ##################### --> + + -<p>You should have already downloaded the <a href="{@docRoot}sdk/index.html#ExistingIDE" ->Android SDK Tools</a>. (If you downloaded the ADT Bundle, you should instead read -<a href="{@docRoot}sdk/installing/bundle.html">Setting Up the ADT Bundle</a>.)</p> -<p>The SDK Tools package is not the complete SDK environment. It includes only the core SDK tools, which you can -use to download the rest of the SDK packages (such as the latest system image).</p> -<div id="win" class="docs" style="display:none"> -<h3>Getting started on Windows</h3> + + +<!-- ################ JUST SDK TOOLS ##################### --> +<div id="tools" heading="Installing the Stand-alone SDK Tools" style="display:none"> + + +<p>The stand-alone SDK Tools package does not include a complete Android development environment. +It includes only the core SDK tools, which you can access from a command line or with a plugin +for your favorite IDE (if available).</p> + +<p>If you didn't download the SDK tools, go <a href="{@docRoot}sdk/index.html" +><b>download the SDK now</b></a>, +or switch to the <a href="{@docRoot}sdk/installing/index.html?pkg=adt">Eclipse ADT +install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio +install</a> instructions.</p> + + +<div class="procedure-box"> +<p id="instructions-toggle" +style="float:right;font-size:13px"><a href='' onclick='showAll();return false;' +>[ Show instructions for all platforms ]</a></p> + +<div class="win docs" style="display:none"> + +<p><b>To get started on Windows:</b></p> + <p>Your download package is an executable file that starts an installer. The installer checks your machine for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary. The installer then saves the Android SDK Tools into a default location (or you can specify the location).</p> @@ -21,15 +219,9 @@ use to download the rest of the SDK packages (such as the latest system image).< <ol> <li>Double-click the executable ({@code .exe} file) to start the install.</li> <li>Make a note of the name and location in which it saves the SDK on your system—you will need to -refer to the SDK directory later, when setting up the ADT plugin and when using +refer to the SDK directory later when using the SDK tools from the command line.</li> -<li>Once the installation completes, the installer offers to start the Android SDK Manager. -If you'll be using Eclipse, <strong>do not</strong> start the Android SDK Manager, -and instead move on to <a href="{@docRoot}sdk/installing/installing-adt.html" ->Installing the Eclipse Plugin</a>. -<p>If you're using a different IDE, -start the SDK Manager and read <a href="{@docRoot}sdk/installing/adding-packages.html" ->Adding Platforms and Packages</a>.</p> +<li>Once the installation completes, the installer starts the Android SDK Manager. </li> </ol> @@ -37,51 +229,37 @@ start the SDK Manager and read <a href="{@docRoot}sdk/installing/adding-packages -<div id="mac" class="docs" style="display:none"> +<div class="mac docs" style="display:none"> -<h3>Getting started on Mac</h3> +<p><b>To get started on Mac OSX:</b></p> -<ol> -<li>Unpack the ZIP file you've downloaded. By default, it's unpacked +<p>Unpack the ZIP file you've downloaded. By default, it's unpacked into a directory named <code>android-sdk-mac_x86</code>. Move it to an appropriate location on your machine, -such as a "Development" directory in your home directory. +such as a "Development" directory in your home directory.</p> <p>Make a note of the name and location of the SDK directory on your system—you will need to -refer to the SDK directory later, when setting up the ADT plugin and when using +refer to the SDK directory later when using the SDK tools from the command line.</p> -</li> -<li>If you're using Eclipse, move on to <a href="{@docRoot}sdk/installing/installing-adt.html" ->Installing the Eclipse Plugin</a>. Otherwise, if you're using a different IDE, -read <a href="{@docRoot}sdk/installing/adding-packages.html" ->Adding Platforms and Packages</a>.</li> -</ol> </div> -<div id="linux" class="docs" style="display:none"> +<div class="linux docs" style="display:none"> -<h3>Getting started on Linux</h3> +<p><b>To get started on Linux:</b></p> -<ol> -<li>Unpack the {@code .tgz} file you've downloaded. By default, the SDK files are unpacked +<p>Unpack the {@code .tgz} file you've downloaded. By default, the SDK files are unpacked into a directory named <code>android-sdk-linux_x86</code>. Move it to an appropriate location on your machine, -such as a "Development" directory in your home directory. +such as a "Development" directory in your home directory.</p> <p>Make a note of the name and location of the SDK directory on your system—you will need to -refer to the SDK directory later, when setting up the ADT plugin and when using +refer to the SDK directory later when using the SDK tools from the command line.</p> -</li> -<li>If you're using Eclipse, move on to <a href="{@docRoot}sdk/installing/installing-adt.html" ->Installing the Eclipse Plugin</a>. Otherwise, if you're using a different IDE, -read <a href="{@docRoot}sdk/installing/adding-packages.html" ->Adding Platforms and Packages</a>.</li> -</ol> -<h5 id="Troubleshooting"><a href='' class="expandable" +<h5 id="Troubleshooting" style="margin-bottom:15px"><a href='' class="expandable" onclick="toggleExpandable(this,'#ubuntu-trouble');return false;" >Troubleshooting Ubuntu</a></h5> @@ -122,38 +300,122 @@ sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386</pre> </div><!-- end ubuntu trouble --> +</div><!-- end linux --> +</div><!-- end procedure box --> + + +<p>The Android SDK tools are now ready to begin developing apps, but there are still a +couple packages you should add to make your Android SDK complete.</p> + +<p class="paging-links"> +<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> +Continue: Adding SDK Packages</a></p> + + +</div> +<!-- ################ END JUST TOOLS ##################### --> + + + + + +<!-- ################ DEFAULT ##################### --> + + +<div id="default" style="display:none"> + +<p>If you haven't already, <b><a href="{@docRoot}sdk/index.html">download +the Android SDK</a></b>. </p> + +<p>Then, select which SDK package you want to install:</p> + +<div class="cols" style="margin:30px 0 60px"> +<div class="col-4" style="margin-left:0"> +<a href="{@docRoot}sdk/installing/index.html?pkg=adt" class="landing-button landing-secondary"> +Eclipse ADT +</a> +</div> + +<div class="col-4"> +<a href="{@docRoot}sdk/installing/index.html?pkg=studio" class="landing-button landing-secondary"> +Android Studio +</a> +</div> + +<div class="col-4"> +<a href="{@docRoot}sdk/installing/index.html?pkg=tools" class="landing-button landing-secondary"> +Stand-alone SDK Tools +</a> </div> +</div> + + +</div> +<!-- ################ END DEFAULT ##################### --> + + + + -<p style="margin-top:2em;"><a href='' onclick='showAll();return false;'>Information for other platforms</a></p> <script> - var $osDocs; - if (navigator.appVersion.indexOf("Win")!=-1) { - $osDocs = $('#win'); - } else if (navigator.appVersion.indexOf("Mac")!=-1) { - $osDocs = $('#mac'); - } else if (navigator.appVersion.indexOf("Linux")!=-1) { - $osDocs = $('#linux'); - } - if ($osDocs.length) { - // reveal only the docs for this OS - $osDocs.show(); - } else { - // not running a compatible OS, so just show all the docs - $('.docs').show(); +// Show proper instructions based on downloaded SDK package +var package = getUrlParam("pkg"); +if (package == "tools") { + // Show the SDK Tools (other IDE) instructions + $("h1").text($("#tools").attr('heading')); + $("#tools").show(); +} else if (package == "adt") { + // Show the ADT instructions + $("h1").text($("#adt").attr('heading')); + $("#adt").show(); +} else if (package == "studio") { + // Show the Android Studio instructions + $("h1").text($("#studio").attr('heading')); + $("#studio").show(); +} else { + // Show the default page content so user can select their setup + $("#default").show(); +} + +// Show the proper instructions based on machine OS +var $osDocs; +if (navigator.appVersion.indexOf("Win")!=-1) { + $osDocs = $('.win'); +} else if (navigator.appVersion.indexOf("Mac")!=-1) { + $osDocs = $('.mac'); +} else if (navigator.appVersion.indexOf("Linux")!=-1) { + $osDocs = $('.linux'); +} + +if ($osDocs.length) { + // reveal only the docs for this OS + $osDocs.show(); +} else { + // not running a compatible OS, so just show all the docs + $('.docs').show(); +} + + +/* Shows all the machine OS instructions */ +function showAll() { + $('.docs').show(); + $("#instructions-toggle").hide(); +} + +/* Returns the value for the given URL parameter */ +function getUrlParam(param) { + var url = window.location.search.substring(1); + var variables = url.split('&'); + for (var i = 0; i < variables.length; i++) { + var paramName = variables[i].split('='); + if (escape(paramName[0]) == param) { + return escape(paramName[1]); + } } +} + + - function showAll() { - $('.docs').each(function() { - if (!$(this).is(':visible')) { - console.log('show') - $(this).show(); - } else { - console.log('hide') - $(this).hide(); - $osDocs.show(); - } - }); - } </script> diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd index 7bf366c..1e87cd8 100644 --- a/docs/html/sdk/installing/installing-adt.jd +++ b/docs/html/sdk/installing/installing-adt.jd @@ -15,19 +15,28 @@ of Eclipse to let you quickly set up new Android projects, build an app UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution. </p> -<p>If you need to install Eclipse, you can download it from <a href= -"http://www.eclipse.org/downloads/">eclipse.org/downloads/</a>.</p> - - -<p class="note"><strong>Note:</strong> If you prefer to work in a different IDE, you do not need to -install Eclipse or ADT. Instead, you can directly use the SDK tools to build and -debug your application.</p> - +<p class="note"><strong>Note:</strong> You should install the ADT plugin +only if you already have an Eclipse installation that you want to continue using. If you do not +have Eclipse installed, you should instead <b><a href="{@docRoot}sdk/index.html">install +the complete Android SDK</a></b>, which includes the latest IDE for Android developers.</p> + +<p>Your existing Eclipse installation must meet these requirements:</p> + <ul> + <li><a href="http://eclipse.org/mobile/">Eclipse</a> 3.7.2 (Indigo) or greater +<p class="note"><strong>Note:</strong> Eclipse 3.6 (Helios) is no longer +supported with the latest version of ADT.</p></li> + <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included +in most Eclipse IDE packages) </li> + <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a> + (JRE alone is not sufficient)</li>oid Development Tools plugin</a> +(recommended)</li> + <li><strong>Not</strong> compatible with GNU Compiler for Java (gcj)</li> + </ul> <h2 id="Download">Download the ADT Plugin</h2> - +<p>To add the ADT plugin to Eclipse:</p> <ol> <li>Start Eclipse, then select <strong>Help</strong> > <strong>Install New Software</strong>.</li> diff --git a/docs/html/sdk/installing/studio.jd b/docs/html/sdk/installing/studio.jd index a6f1115..894514a 100644 --- a/docs/html/sdk/installing/studio.jd +++ b/docs/html/sdk/installing/studio.jd @@ -1,4 +1,4 @@ -page.title=Getting Started with Android Studio +page.title=Android Studio page.tags="studio" @jd:body @@ -7,7 +7,7 @@ page.tags="studio" <div style="position:relative;min-height:660px;"> -<h3 style="color:#f80">EARLY ACCESS PREVIEW</h3> +<h3 style="color:#FF4444;margin:-30px 0 20px">BETA</h3> <div id="tos" style="position:absolute;display:none;width:inherit;"> <div class="col-13" style="margin:0;"> </div><!-- provides top margin for content --> @@ -183,23 +183,21 @@ This is the Android Software Development Kit License Agreement - - <div id="main"> -<div class="figure" style="width:400px;margin-top:-20px"> -<img src="{@docRoot}images/tools/android-studio.png" height="330" width="400" style="margin-bottom:20px" /> +<div class="figure" style="width:400px;margin-top:-75px"> +<img src="{@docRoot}images/tools/laptop-studio.png" height="366" width="400" style="margin-bottom:20px" /> <a class="big button subtitle" id="download-ide-button" -href="" style="display:none;width:265px;margin:0 auto;display:block;font-size:18px" ></a> -<div style="width:290px;padding:10px 40px 0 60px;font-size:12px;line-height:16px"> +href="" style="display:none;width:368px;margin:0 auto;display:block;font-size:18px" ></a> +<div style="margin:20px 0 0 0"> <p style="margin-bottom:8px">This download includes:</p> -<ul> -<li>Android Studio <b>early access preview</b></li> -<li>All the Android SDK Tools to design, test, debug, and profile your app</li> -<li>The latest Android platform to compile your app</li> -<li>The latest Android system image to run your app in the emulator</li> +<ul style="margin-bottom:20px"> +<li>Android Studio Beta</li> +<li>All the Android SDK Tools to design, test, and debug your app</li> +<li>A version of the Android platform to compile your app</li> +<li>A version of the Android system image to run your app in the emulator</li> </ul> </div> @@ -208,36 +206,34 @@ href="" style="display:none;width:265px;margin:0 auto;display:block;font-size:18 <p>Android Studio is a new Android development environment based on IntelliJ -IDEA. Similar to Eclipse with the -ADT Plugin, Android Studio provides integrated Android developer tools -for development and debugging. On top of the +IDEA. It provides new features and improvements over Eclipse ADT +and will be the official Android IDE once it's ready. On top of the capabilities you expect from IntelliJ, Android Studio offers:</p> <ul> - <li>Gradle-based build support.</li> - <li>Android-specific refactoring and quick fixes.</li> - <li>Lint tools to catch performance, usability, version compatibility and other problems.</li> - <li>ProGuard and app-signing capabilities. </li> - <li>Template-based wizards to create common Android designs and components.</li> - <li>A rich layout editor that allows you to drag-and-drop UI components, preview layouts on - multiple screen configurations, and much more.</li> + <li>Flexible Gradle-based build system.</li> + <li>Build variants and multiple APK generation.</li> + <li>Expanded template support for Google Services and various device types.</li> + <li>Rich layout editor with support for theme editing.</li> + <li>Lint tools to catch performance, usability, version compatibility, and other problems.</li> + <li>ProGuard and app-signing capabilities.</li> <li>Built-in support for <a - href="http://android-developers.blogspot.com/2013/06/adding-backend-to-your-app-in-android.html" + href="https://developers.google.com/cloud/devtools/android_studio_templates/" class="external-link">Google Cloud Platform</a>, making it easy to integrate Google Cloud - Messaging and App Engine as server-side components. + Messaging and App Engine. </ul> -<p class="caution"><strong>Caution:</strong> Android Studio is currently available as -an <strong>early access preview</strong>. Several features -are either incomplete or not yet implemented and you may encounter bugs. If you are not +<p class="caution"><strong>Caution:</strong> Android Studio is currently in +<strong>beta</strong>. Some features +are not yet implemented and you may encounter bugs. If you are not comfortable using an unfinished product, you may want to instead -download (or continue to use) the -<a href="{@docRoot}sdk/index.html">ADT Bundle</a> (Eclipse with the ADT Plugin).</p> +download (or continue to use) +<a href="{@docRoot}sdk/index.html">Eclipse with ADT</a>.</p> -<h4 style="clear:right;text-align:right;margin-right:50px"><a href='' class="expandable" +<h4 style="margin-top: 20px;"><a href='' class="expandable" onclick="toggleExpandable(this,'.pax');return false;" - >DOWNLOAD FOR OTHER PLATFORMS</a></h4> + >VIEW ALL DOWNLOADS AND SIZES</a></h4> <div class="pax col-13 online" style="display:none;margin:0;"> @@ -290,6 +286,73 @@ download (or continue to use) the +<h2 style="margin-bottom: 0px;">Android Studio vs. Eclipse ADT Comparison</h2> + +<p> +The following table lists some key differences between Android Studio Beta and +<a href="{@docRoot}sdk/index.html">Eclipse with ADT</a>. +</p> + +<style> +td.yes { + color: #669900; +} +td.no { + color: #CC0000; +} +</style> + +<table> + <tbody><tr> + <th>Feature</th> + <th>Android Studio</th> + <th>ADT</th> + </tr> + <tr> + <td>Build system</td> + <td><a href="http://www.gradle.org/" class="external-link">Gradle</a></td> + <td><a href="http://ant.apache.org/" class="external-link">Ant</a></td> + </tr> + <tr> + + <td>Maven-based build dependencies</td> + <td class="yes">Yes</td> + <td class="no">No</td> + </tr> + + <td>Build variants and multiple-APK generation (great for Android Wear)</td> + <td class="yes">Yes</td> + <td class="no">No</td> + </tr> + + <tr> + <td>Advanced Android code completion and refactoring</td> + <td class="yes">Yes</td> + <td class="no">No</td> + </tr> + <tr> + <td>Graphical layout editor</td> + <td class="yes">Yes</td> + <td class="yes">Yes</td> + </tr> + <tr> + </tr> + + <tr> + <td>APK signing and keystore management</td> + <td class="yes">Yes</td> + <td class="yes">Yes</td> + </tr> + + <tr> + <td>NDK support</td> + <td class="no">Coming soon</td> + <td class="yes">Yes</td> + </tr> + </tbody></table> + + + <h2 id="Updating">Updating from older versions</h2> <p>If you already have Android Studio installed, in most cases, you can upgrade to the latest @@ -298,7 +361,7 @@ version by installing a patch. From within Android Studio, select Check for updates</strong>) to see whether an update is available.</p> <p>If an update is not available, -follow the <a href="#Installing">installation instructions</a> below and replace your existing +click the button above to download and replace your existing installation.</p> <div class="caution"> @@ -311,100 +374,6 @@ If you fail to copy these packages, then you can instead download them again thr the Android SDK Manager.</p> </div> - -<h2 id="Installing">Installing Android Studio</h2> -<p>Android Studio requires JDK 6 or greater (JRE alone is not sufficient). To check if you -have JDK installed (and which version), open a terminal and type <code>javac -version</code>. -If JDK is not available or the version is lower than 6, -<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">download -JDK from here</a>.</p> -<p>To install Android Studio:</p> -<ol> -<li>Download the <strong>Android Studio</strong> package from above.</li> -<li>Install Android Studio and the SDK tools: - <p><b>Windows:</b></p> - <ol> - <li>Launch the downloaded EXE file, {@code android-studio-bundle-<version>.exe}.</li> - <li>Follow the setup wizard to install Android Studio. - - <div class="caution"><p><strong>Known issue:</strong> - On some Windows systems, the launcher script does not find where Java is installed. - If you encounter this problem, - you need to set an environment variable indicating the correct location.</p> - <p>Select <strong>Start menu > Computer > System Properties > - Advanced System Properties</strong>. Then open <strong>Advanced tab > Environment - Variables</strong> and add a new system variable <code>JAVA_HOME</code> that points to - your JDK folder, for example <code>C:\Program Files\Java\jdk1.7.0_21</code>.</p> - </div> - </li> - - </ol> - <p><b>Mac OS X:</b></p> - <ol> - <li>Open the downloaded DMG file, {@code android-studio-bundle-<version>.dmg}.</li> - <li>Drag and drop Android Studio into the Applications folder. - - <div class="caution"><p><strong>Known issue:</strong> - Depending on your security settings, when you attempt to open Android Studio, you might - see a warning that says the package is damaged and should be moved to the trash. If this - happens, go to <strong>System Preferences > Security & Privacy</strong> and under - <strong>Allow applications downloaded from</strong>, select <strong>Anywhere</strong>. - Then open Android Studio again.</p> - </div> - </li> - - </ol> - <p><b>Linux:</b></p> - <ol> - <li>Unpack the downloaded Tar file, {@code android-studio-bundle-<version>.tgz}, into an appropriate - location for your applications. - <li>To launch Android Studio, navigate to the {@code android-studio/bin/} directory - in a terminal and execute {@code studio.sh}. - <p>You may want to add {@code android-studio/bin/} to your PATH environmental - variable so that you can start Android Studio from any directory.</p> - </li> - </ol> -</li> -</ol> - -<p>That's it! You're ready to start developing apps with Android Studio.</p> - -<div class="note"> -<p><strong>Note:</strong> On Windows and Mac, the individual tools and -other SDK packages are saved within the Android Studio application directory. -To access the tools directly, use a terminal to navigate into the application and locate -the {@code sdk/} directory. For example:</p> -<p>Windows: <code>\Users\<user>\AppData\Local\Android\android-studio\sdk\</code></p> -<p>Mac: <code>/Applications/Android\ Studio.app/sdk/</code></p> -</div> - -<p>For a list of some known issues, see <a -href="http://tools.android.com/knownissues">tools.android.com/knownissues</a>.</p> - - -<h2 id="Start">Starting a Project</h2> - -<p>When you launch Android Studio for the first time, you'll see a Welcome -screen that offers several ways to get started:</p> - -<ul> - <li>To start building a new app, click <strong>New Project</strong>. - <p>This starts the New Project wizard, which helps you set up a project using an app template. - </li> - <li>To import an existing Android app project, click <strong>Import Project</strong>. - <p class="note"><strong>Note:</strong> If you previously developed your Android project - with Eclipse, you should first use the new export feature in the ADT plugin to prepare - your project with the new Gradle build system. For more information, read - <a href="{@docRoot}sdk/installing/migrate.html">Migrating from Eclipse</a> and - <a href="{@docRoot}sdk/installing/studio-build.html">Building Your Project with - Gradle</a>.</p> - </li> -</ul> - -<p>For additional help using Android Studio, read <a -href="{@docRoot}sdk/installing/studio-tips.html">Tips and Tricks</a>.</p> - - <p>As you continue developing apps, you may need to install additional versions of Android for the emulator and other packages such as the <a href="{@docRoot}tools/support-library/index.html">Android Support Library</a>. @@ -601,8 +570,8 @@ for possible resolutions to known issues: <a href="http://tools.android.com/know if (os) { /* set up primary ACE download button */ $('#download-ide-button').show(); - $('#download-ide-button').append("Download Android Studio <span class='small'>v0.5.2</span>" - + "<br/> <span class='small'>for " + os + "</span>"); + $('#download-ide-button').append("Download Android Studio Beta <span class='small'>v0.5.2</span>" + + "<br/> <span class='small'>with the Android SDK for " + os + "</span>"); $('#download-ide-button').click(function() {return onDownload(this,true);}).attr('href', bundlename); } else { @@ -644,9 +613,13 @@ for possible resolutions to known issues: <a href="http://tools.android.com/know function onDownloadForRealz(link) { if ($("input#agree").is(':checked')) { - $("#tos").hide(); - $("#main").show(); - location.hash = "Updating"; + $("h1").text('Now redirecting to the install instructions...'); + $("#tos").slideUp(); + $("#jd-content .jd-descr").fadeOut('slow', function() { + setTimeout(function() { + window.location = "/sdk/installing/index.html?pkg=studio"; + }, 1000); + }); _gaq.push(['_trackEvent', 'SDK', 'Android Studio', $("#downloadForRealz").html()]); return true; } else { diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd index e748b12..89b3857 100644 --- a/docs/html/tools/device.jd +++ b/docs/html/tools/device.jd @@ -5,6 +5,7 @@ page.title=Using Hardware Devices <div id="qv"> <h2>In this document</h2> <ol> + <li><a href="#device-developer-options">Enabling On-device Developer Options</a></li> <li><a href="#setting-up">Setting up a Device for Development</a> <ol> <li><a href="#VendorIds">USB Vendor IDs</a></li> @@ -43,6 +44,29 @@ allow you to verify that your application functions properly on different versio platform, in different screen sizes and orientations, and more.</p> +<h2 id="developer-device-options" style="margin-bottom: 0px;">Enabling On-device Developer Options</h2> + +<img src="/images/tools/dev-options-inmilk.png" alt="" style="float:right;margin-left:30px"> + +<p>Android-powered devices have a host of developer options that you can +access on the phone, which let you:</p> +<ul> + <li>Enable debugging over USB.</li> + <li>Quickly capture bug reports onto the device.</li> + <li>Show CPU usage on screen.</li> + <li>Draw debugging information on screen such as layout bounds, + updates on GPU views and hardware layers, and other information.</li> + <li>Plus many more options to simulate app stresses or enable debugging options.</li> +</ul> +<p>To access these settings, open the <em>Developer options</em> in the +system Settings. On Android 4.2 and higher, the Developer options screen is +hidden by default. To make it visible, go to +<b>Settings > About phone</b> and tap <b>Build number</b> seven times. Return to the previous +screen to find Developer options at the bottom.</p> + + + + <h2 id="setting-up">Setting up a Device for Development</h2> <p>With an Android-powered device, you can develop and debug your Android applications just as you diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd index c339943..9eed3eb 100644 --- a/docs/html/tools/help/adb.jd +++ b/docs/html/tools/help/adb.jd @@ -8,6 +8,7 @@ page.tags="adb" <div id="qv"> <h2>In this document</h2> <ol> + <li><a href="#Enabling">Enabling adb Debugging</a></li> <li><a href="#issuingcommands">Syntax</a></li> <li><a href="#commandsummary">Commands</a></li> <li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li> @@ -72,6 +73,19 @@ instances and handles commands from multiple adb clients, you can control any em instance from any client (or from a script).</p> +<h2 id="Enabling">Enabling adb Debugging</h2> + +<p>In order to use adb with a device connected over USB, you must enable +<strong>USB debugging</strong> in the device system settings, under <strong> +Developer options</strong>.</p> + +<p>On Android 4.2 and higher, the Developer options screen is +hidden by default. To make it visible, go to +<b>Settings > About phone</b> and tap <b>Build number</b> seven times. Return to the previous +screen to find <strong>Developer options</strong> at the bottom.</p> + +<p>On some devices, the Developer options screen may be located or named differently.</p> + <p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures @@ -80,6 +94,11 @@ device and acknowledge the dialog. This requires that you have adb version 1.0.3 SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.</p> +<p>For more information about connecting to a device over USB, read +<a href="{@docRoot}tools/device.html">Using Hardware Devices</a>.</p> + + + <h2 id="issuingcommands">Syntax</h2> diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd index 57271bb..b084237 100644 --- a/docs/html/tools/help/sdk-manager.jd +++ b/docs/html/tools/help/sdk-manager.jd @@ -3,7 +3,9 @@ page.title=SDK Manager <p>The Android SDK separates tools, platforms, and other components into packages you can - download using the SDK Manager.</p> + 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>You can launch the SDK Manager in one of the following ways:</p> <ul> @@ -25,6 +27,14 @@ click <strong>Install</strong> to install the selected packages.</p> SDK packages that are available, already installed, or for which an update is available.</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 +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: @@ -69,3 +79,77 @@ matches the API Level of the Android platform that you plan to use.</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 <code>platform-tools</code> to your <code>PATH</code> environment variable.</p> + + +<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> + +<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 +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>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> + +<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> + +<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> +</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> + + + + + + + + + + + + + + + + + diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index b29b87c..93e5976 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -1,54 +1,38 @@ <ul id="nav"> <li class="nav-section"> - <div class="nav-section-header empty"> - <a href="<?cs var:toroot ?>tools/index.html"><span class="en">Developer Tools</span></a> - </div> - </li> - - <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>sdk/index.html"><span class="en">Download</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/bundle.html"> - <span class="en">Setting Up the ADT Bundle</span></a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/index.html"> + <span class="en">Installing the SDK</span></a></li> - <li class="nav-section"> - <div class="nav-section-header"> - <a href="<?cs var:toroot ?>sdk/installing/index.html"><span class="en">Setting Up - an Existing IDE</span></a></div> - <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html"> - <span class="en">Installing the Eclipse Plugin</span></a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html"> - <span class="en">Adding Platforms and Packages</span></a></li> - </ul> - </li> - - <li class="nav-section"> - <div class="nav-section-header"> - <a href="<?cs var:toroot ?>sdk/installing/studio.html">Android Studio</a> - </div> - <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/migrate.html"> - Migrating from Eclipse</a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html"> - Tips and Tricks</a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html"> - Using the Layout Editor</a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html"> - Building Your Project with Gradle</a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/studio-debug.html"> - Debugging with Android Studio</a></li> - </ul> - </li> - <li><a href="<?cs var:toroot ?>sdk/exploring.html"> - <span class="en">Exploring the SDK</span></a></li> - <li><a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">Download the NDK</a> - </li> + <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html"> + <span class="en">Adding SDK Packages</span></a></li> </ul> </li> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>sdk/installing/studio.html">Android Studio</a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>sdk/installing/migrate.html"> + Migrating from Eclipse</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/create-project.html"> + Creating a Project</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html"> + Tips and Tricks</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html"> + Using the Layout Editor</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html"> + Building Your Project with Gradle</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/studio-debug.html"> + Debugging with Android Studio</a></li> + </ul> + </li> + <li class="nav-section"> <div class="nav-section-header"> <a href="<?cs var:toroot ?>tools/workflow/index.html"><span class="en">Workflow</span></a> @@ -174,7 +158,13 @@ class="en">Support Library</span></a></div> class="en">Tools Help</span></a></div> <ul> <li><a href="<?cs var:toroot ?>tools/help/adb.html">adb</a></li> - <li><a href="<?cs var:toroot ?>tools/help/adt.html">ADT</a></li> + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/adt.html">ADT</a></div> + <ul> + <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html"> + <span class="en">Installing the Eclipse Plugin</span></a></li> + </ul> + </li> <li><a href="<?cs var:toroot ?>tools/help/android.html">android</a></li> <li><a href="<?cs var:toroot ?>tools/help/avd-manager.html">AVD Manager</a></li> <li><a href="<?cs var:toroot ?>tools/help/bmgr.html">bmgr</a> @@ -244,6 +234,11 @@ class="en">Platforms</span></a></li> </ul> </li> + <li class="nav-section"> + <div class="nav-section-header empty"> + <a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">NDK</a> + </div> + </li> <li class="nav-section"> <div class="nav-section-header"> diff --git a/docs/html/training/app-indexing/index.jd b/docs/html/training/app-indexing/index.jd index cb4135f..7e7241b 100644 --- a/docs/html/training/app-indexing/index.jd +++ b/docs/html/training/app-indexing/index.jd @@ -59,14 +59,6 @@ in your app by adding intent filters in your app manifest.</li> </li> </ol> -<p class="note"><strong>Note: </strong> -Currently, the Google Search app indexing capability is restricted to -English-only Android apps from developers participating in the early adopter -program. You can sign up to be a participant by submitting the <a -href="https://docs.google.com/a/google.com/forms/d/1itcqPAQqggJ6e4m8aejWLM8Dc5O8P6qybgGbKCNxGV0/viewform" -class="external-link" target="_blank">App Indexing Expression of Interest</a> form. -</p> - <p>This class shows how to enable deep linking and indexing of your application content so that users can open this content directly from mobile search results.</p> diff --git a/docs/html/training/articles/perf-tips.jd b/docs/html/training/articles/perf-tips.jd index 7ff6c5c..1660b7f 100644 --- a/docs/html/training/articles/perf-tips.jd +++ b/docs/html/training/articles/perf-tips.jd @@ -16,7 +16,6 @@ page.article=true <li><a href="#AvoidFloat">Avoid Using Floating-Point</a></li> <li><a href="#UseLibraries">Know and Use the Libraries</a></li> <li><a href="#NativeMethods">Use Native Methods Carefully</a></li> - <li><a href="#library">Know And Use The Libraries</a></li> <li><a href="#native_methods">Use Native Methods Judiciously</a></li> <li><a href="#closing_notes">Closing Notes</a></li> </ol> diff --git a/docs/html/training/cloudsync/backupapi.jd b/docs/html/training/cloudsync/backupapi.jd index a5436c6..fd35ada 100644 --- a/docs/html/training/cloudsync/backupapi.jd +++ b/docs/html/training/cloudsync/backupapi.jd @@ -41,7 +41,7 @@ new devices using the Backup API.</p> <h2 id="register">Register for the Android Backup Service</h2> <p>This lesson requires the use of the <a - href="http://code.google.com/android/backup/index.html">Android Backup + href="{@docRoot}google/backup/index.html">Android Backup Service</a>, which requires registration. Go ahead and <a href="http://code.google.com/android/backup/signup.html">register here</a>. Once that's done, the service pre-populates an XML tag for insertion in your Android diff --git a/docs/html/training/cloudsync/index.jd b/docs/html/training/cloudsync/index.jd index 55b275b..8679009 100644 --- a/docs/html/training/cloudsync/index.jd +++ b/docs/html/training/cloudsync/index.jd @@ -6,6 +6,16 @@ startpage=true @jd:body +<div id="tb-wrapper"> +<div id="tb"> + +<h2>Dependencies and prerequisites</h2> +<ul> + <li>Android 2.2 (API level 8) and higher</li> +</ul> +</div> +</div> + <p>By providing powerful APIs for internet connectivity, the Android framework helps you build rich cloud-enabled apps that sync their data to a remote web service, making sure all your devices always stay in sync, and your valuable diff --git a/docs/html/training/tv/index.jd b/docs/html/training/tv/index.jd deleted file mode 100644 index 54f7016..0000000 --- a/docs/html/training/tv/index.jd +++ /dev/null @@ -1,59 +0,0 @@ -page.title=Designing for TV -page.tags="input","screens" - -trainingnavtop=true -startpage=true - -@jd:body - -<div id="tb-wrapper"> -<div id="tb"> - -<!-- Required platform, tools, add-ons, devices, knowledge, etc. --> -<h2>Dependencies and prerequisites</h2> -<ul> - <li>Android 2.0 (API Level 5) or higher</li> -</ul> - -</div> -</div> - -<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=zsRnRLh-O34"> -<div> - <h3>Video</h3> - <p>DevBytes: Design for Large Displays - Part 1</p> -</div> -</a> - -<p> - Smart TVs powered by Android bring your favorite Android apps to the best screen in your house. - Thousands of apps in the Google Play Store are already optimized for TVs. This class shows how - you can optimize your Android app for TVs, including how to build a layout that - works great when the user is ten feet away and navigating with a remote control. -</p> - -<h2>Lessons</h2> - -<dl> - <dt><b><a href="optimizing-layouts-tv.html">Optimizing Layouts for TV</a></b></dt> - <dd>Shows you how to optimize app layouts for TV screens, which have some unique characteristics such as: - <ul> - <li>permanent "landscape" mode</li> - <li>high-resolution displays</li> - <li>"10 foot UI" environment.</li> - </ul> - </dd> - - <dt><b><a href="optimizing-navigation-tv.html">Optimizing Navigation for TV</a></b></dt> - <dd>Shows you how to design navigation for TVs, including: - <ul> - <li>handling D-pad navigation</li> - <li>providing navigational feedback</li> - <li>providing easily-accessible controls on the screen.</li> - </ul> - </dd> - - <dt><b><a href="unsupported-features-tv.html">Handling features not supported on TV</a></b></dt> - <dd>Lists the hardware features that are usually not available on TVs. This lesson also shows you how to - provide alternatives for missing features or check for missing features and disable code at run time.</dd> -</dl> diff --git a/docs/html/training/tv/optimizing-layouts-tv.jd b/docs/html/training/tv/optimizing-layouts-tv.jd deleted file mode 100644 index a6db052..0000000 --- a/docs/html/training/tv/optimizing-layouts-tv.jd +++ /dev/null @@ -1,246 +0,0 @@ -page.title=Optimizing Layouts for TV -parent.title=Designing for TV -parent.link=index.html - -trainingnavtop=true -next.title=Optimizing Navigation for TV -next.link=optimizing-navigation-tv.html - -@jd:body - -<div id="tb-wrapper"> -<div id="tb"> - -<h2>This lesson teaches you to</h2> -<ol> - <li><a href="#DesignLandscapeLayouts">Design Landscape Layouts</a></li> - <li><a href="#MakeTextControlsEasyToSee">Make Text and Controls Easy to See</a></li> - <li><a href="#DesignForLargeScreens">Design for High-Density Large Screens</a></li> - <li><a href="#HandleLargeBitmaps">Design to Handle Large Bitmaps</a></li> -</ol> - -<h2>You should also read</h2> -<ul> - <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li> -</ul> - -</div> -</div> - -<p> -When your application is running on a television set, you should assume that the user is sitting about -ten feet away from the screen. This user environment is referred to as the -<a href="http://en.wikipedia.org/wiki/10-foot_user_interface">10-foot UI</a>. To provide your -users with a usable and enjoyable experience, you should style and lay out your UI accordingly.. -</p> -<p> -This lesson shows you how to optimize layouts for TV by: -</p> -<ul> - <li>Providing appropriate layout resources for landscape mode.</li> - <li>Ensuring that text and controls are large enough to be visible from a distance.</li> - <li>Providing high resolution bitmaps and icons for HD TV screens.</li> -</ul> - -<h2 id="DesignLandscapeLayouts">Design Landscape Layouts</h2> - -<p> -TV screens are always in landscape orientation. Follow these tips to build landscape layouts optimized for TV screens: -</p> -<ul> - <li>Put on-screen navigational controls on the left or right side of the screen and save the - vertical space for content.</li> - <li>Create UIs that are divided into sections, by using <a href="{@docRoot}guide/components/fragments.html">Fragments</a> - and use view groups like {@link android.widget.GridView} instead - of {@link android.widget.ListView} to make better use of the - horizontal screen space.</li> - <li>Use view groups such as {@link android.widget.RelativeLayout} - or {@link android.widget.LinearLayout} to arrange views. - This allows the Android system to adjust the position of the views to the size, alignment, - aspect ratio, and pixel density of the TV screen.</li> - <li>Add sufficient margins between layout controls to avoid a cluttered UI.</li> -</ul> - -<p> -For example, the following layout is optimized for TV: -</p> - -<img src="{@docRoot}images/training/panoramio-grid.png" /> - -<p> -In this layout, the controls are on the lefthand side. The UI is displayed within a -{@link android.widget.GridView}, which is well-suited to landscape orientation. -In this layout both GridView and Fragment have the width and height set -dynamically, so they can adjust to the screen resolution. Controls are added to the left side Fragment programatically at runtime. -The layout file for this UI is {@code res/layout-land-large/photogrid_tv.xml}. -(This layout file is placed in {@code layout-land-large} because TVs have large screens with landscape orientation. For details refer to -<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.)</p> - -res/layout-land-large/photogrid_tv.xml -<pre> -<RelativeLayout - android:layout_width="fill_parent" - android:layout_height="fill_parent" > - - <fragment - android:id="@+id/leftsidecontrols" - android:layout_width="0dip" - android:layout_marginLeft="5dip" - android:layout_height="match_parent" /> - - <GridView - android:id="@+id/gridview" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - -</RelativeLayout> -</pre> - -<p> -To set up action bar items on the left side of the screen, you can also include the <a -href="http://code.google.com/p/googletv-android-samples/source/browse/#git%2FLeftNavBarLibrary"> -Left navigation bar library</a> in your application to set up action items on the left side -of the screen, instead of creating a custom Fragment to add controls: -</p> - -<pre> -LeftNavBar bar = (LeftNavBarService.instance()).getLeftNavBar(this); -</pre> - -<p> -When you have an activity in which the content scrolls vertically, always use a left navigation bar; -otherwise, your users have to scroll to the top of the content to switch between the content view and -the ActionBar. Look at the -<a href="http://code.google.com/p/googletv-android-samples/source/browse/#git%2FLeftNavBarDemo"> -Left navigation bar sample app</a> to see how to simple it is to include the left navigation bar in your app. -</p> - -<h2 id="MakeTextControlsEasyToSee">Make Text and Controls Easy to See</h2> -<p> -The text and controls in a TV application's UI should be easily visible and navigable from a distance. -Follow these tips to make them easier to see from a distance : -</p> - -<ul> - <li>Break text into small chunks that users can quickly scan.</li> - <li>Use light text on a dark background. This style is easier to read on a TV.</li> - <li>Avoid lightweight fonts or fonts that have both very narrow and very broad strokes. Use simple sans-serif - fonts and use anti-aliasing to increase readability.</li> - <li>Use Android's standard font sizes: - <pre> - <TextView - android:id="@+id/atext" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:singleLine="true" - android:textAppearance="?android:attr/textAppearanceMedium"/> - </pre></li> - <li>Ensure that all your view widgets are large enough to be clearly visible to someone sitting 10 feet away - from the screen (this distance is greater for very large screens). The best way to do this is to use - layout-relative sizing rather than absolute sizing, and density-independent pixel units instead of absolute - pixel units. For example, to set the width of a widget, use wrap_content instead of a pixel measurement, - and to set the margin for a widget, use dip instead of px values. - </li> -</ul> -<p> - -</p> - -<h2 id="DesignForLargeScreens">Design for High-Density Large Screens</h2> - -<p> -The common HDTV display resolutions are 720p, 1080i, and 1080p. Design your UI for 1080p, and then -allow the Android system to downscale your UI to 720p if necessary. In general, downscaling (removing pixels) -does not degrade the UI (Notice that the converse is not true; you should avoid upscaling because it degrades -UI quality). -</p> - -<p> -To get the best scaling results for images, provide them as <a href="{@docRoot}tools/help/draw9patch.html"> -9-patch image</a> elements if possible. -If you provide low quality or small images in your layouts, they will appear pixelated, fuzzy, or grainy. This -is not a good experience for the user. Instead, use high-quality images. -</p> - -<p> -For more information on optimizing apps for large screens see <a href="{@docRoot}training/multiscreen/index.html"> -Designing for multiple screens</a>. -</p> - -<h2 id="HandleLargeBitmaps">Design to Handle Large Bitmaps</h2> - -<p> -The Android system has a limited amount of memory, so downloading and storing high-resolution images can often -cause out-of-memory errors in your app. To avoid this, follow these tips: -</p> - -<ul> - <li>Load images only when they're displayed on the screen. For example, when displaying multiple images in - a {@link android.widget.GridView} or - {@link android.widget.Gallery}, only load an image when - {@link android.widget.Adapter#getView(int, View, ViewGroup) getView()} - is called on the View's {@link android.widget.Adapter}. - </li> - <li>Call {@link android.graphics.Bitmap#recycle()} on - {@link android.graphics.Bitmap} views that are no longer needed. - </li> - <li>Use {@link java.lang.ref.WeakReference} for storing references - to {@link android.graphics.Bitmap} objects in an in-memory - {@link java.util.Collection}.</li> - <li>If you fetch images from the network, use {@link android.os.AsyncTask} - to fetch them and store them on the SD card for faster access. - Never do network transactions on the application's UI thread. - </li> - <li>Scale down really large images to a more appropriate size as you download them; otherwise, downloading the image - itself may cause an "Out of Memory" exception. Here is sample code that scales down images while downloading: - - <pre> - // Get the source image's dimensions - BitmapFactory.Options options = new BitmapFactory.Options(); - // This does not download the actual image, just downloads headers. - options.inJustDecodeBounds = true; - BitmapFactory.decodeFile(IMAGE_FILE_URL, options); - // The actual width of the image. - int srcWidth = options.outWidth; - // The actual height of the image. - int srcHeight = options.outHeight; - - // Only scale if the source is bigger than the width of the destination view. - if(desiredWidth > srcWidth) - desiredWidth = srcWidth; - - // Calculate the correct inSampleSize/scale value. This helps reduce memory use. It should be a power of 2. - int inSampleSize = 1; - while(srcWidth / 2 > desiredWidth){ - srcWidth /= 2; - srcHeight /= 2; - inSampleSize *= 2; - } - - float desiredScale = (float) desiredWidth / srcWidth; - - // Decode with inSampleSize - options.inJustDecodeBounds = false; - options.inDither = false; - options.inSampleSize = inSampleSize; - options.inScaled = false; - // Ensures the image stays as a 32-bit ARGB_8888 image. - // This preserves image quality. - options.inPreferredConfig = Bitmap.Config.ARGB_8888; - - Bitmap sampledSrcBitmap = BitmapFactory.decodeFile(IMAGE_FILE_URL, options); - - // Resize - Matrix matrix = new Matrix(); - matrix.postScale(desiredScale, desiredScale); - Bitmap scaledBitmap = Bitmap.createBitmap(sampledSrcBitmap, 0, 0, - sampledSrcBitmap.getWidth(), sampledSrcBitmap.getHeight(), matrix, true); - sampledSrcBitmap = null; - - // Save - FileOutputStream out = new FileOutputStream(LOCAL_PATH_TO_STORE_IMAGE); - scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); - scaledBitmap = null; - </pre> - </li> </ul>
\ No newline at end of file diff --git a/docs/html/training/tv/optimizing-navigation-tv.jd b/docs/html/training/tv/optimizing-navigation-tv.jd deleted file mode 100644 index bb78258..0000000 --- a/docs/html/training/tv/optimizing-navigation-tv.jd +++ /dev/null @@ -1,206 +0,0 @@ -page.title=Optimizing Navigation for TV -parent.title=Designing for TV -parent.link=index.html - -trainingnavtop=true -previous.title=Optimizing Layouts for TV -previous.link=optimizing-layouts-tv.html -next.title=Handling Features Not Supported on TV -next.link=unsupported-features-tv.html - -@jd:body - -<div id="tb-wrapper"> -<div id="tb"> - -<h2>This lesson teaches you to</h2> -<ol> - <li><a href="#HandleDpadNavigation">Handle D-pad Navigation</a></li> - <li><a href="#HandleFocusSelection">Provide Clear Visual Indication for Focus and Selection</a></li> - <li><a href="#DesignForEasyNavigation">Design for Easy Navigation</a></li> -</ol> - -<h2>You should also read</h2> -<ul> - <li><a href="{@docRoot}training/design-navigation/index.html">Designing Effective Navigation</a></li> -</ul> - -</div> -</div> - -<p> -An important aspect of the user experience when operating a TV is the direct human interface: a remote control. -As you optimize your Android application for TVs, you should pay special attention to how the user actually navigates -around your application when using a remote control instead of a touchscreen. -</p> -<p> -This lesson shows you how to optimize navigation for TV by: -</p> - -<ul> - <li>Ensuring all layout controls are D-pad navigable.</li> - <li>Providing highly obvious feedback for UI navigation.</li> - <li>Placing layout controls for easy access.</li> -</ul> - -<h2 id="HandleDpadNavigation">Handle D-pad Navigation</h2> - -<p> -On a TV, users navigate with controls on a TV remote, using either a D-pad or arrow keys. -This limits movement to up, down, left, and right. -To build a great TV-optimized app, you must provide a navigation scheme in which the user can -quickly learn how to navigate your app using the remote. -</p> - -<p> -When you design navigation for D-pad, follow these guidelines: -</p> - -<ul> - <li>Ensure that the D-pad can navigate to all the visible controls on the screen.</li> - <li>For scrolling lists with focus, D-pad up/down keys scroll the list and Enter key selects an item in the list. Ensure that users can - select an element in the list and that the list still scrolls when an element is selected.</li> - <li>Ensure that movement between controls is straightforward and predictable.</li> -</ul> - -<p> -Android usually handles navigation order between layout elements automatically, so you don't need to do anything extra. If the screen layout -makes navigation difficult, or if you want users to move through the layout in a specific way, you can set up explicit navigation for your -controls. -For example, for an {@code android.widget.EditText}, to define the next control to receive focus, use: -<pre> -<EditText android:id="@+id/LastNameField" android:nextFocusDown="@+id/FirstNameField"\> -</pre> -The following table lists all of the available navigation attributes: -</p> - -<table> -<tr> -<th>Attribute</th> -<th>Function</th> -</tr> -<tr> -<td>{@link android.R.attr#nextFocusDown}</td> -<td>Defines the next view to receive focus when the user navigates down.</td> -</tr> -<tr> -<td>{@link android.R.attr#nextFocusLeft}</td> -<td>Defines the next view to receive focus when the user navigates left.</td> -</tr> -<tr> -<td>{@link android.R.attr#nextFocusRight}</td> -<td>Defines the next view to receive focus when the user navigates right.</td> -</tr> -<tr> -<td>{@link android.R.attr#nextFocusUp}</td> -<td>Defines the next view to receive focus when the user navigates up.</td> -</tr> -</table> - -<p> -To use one of these explicit navigation attributes, set the value to the ID (android:id value) of another widget in the layout. You should set -up the navigation order as a loop, so that the last control directs focus back to the first one. -</p> - -<p> -Note: You should only use these attributes to modify the navigation order if the default order that the system applies does not work well. -</p> - -<h2 id="HandleFocusSelection">Provide Clear Visual Indication for Focus and Selection</h2> - -<p> -Use appropriate color highlights for all navigable and selectable elements in the UI. This makes it easy for users to know whether the control -is currently focused or selected when they navigate with a D-pad. Also, use uniform highlight scheme across your application. -</p> - -<p> -Android provides <a href="{@docRoot}guide/topics/resources/drawable-resource.html#StateList">Drawable State List Resources</a> to implement highlights -for selected and focused controls. For example: -</p> - -res/drawable/button.xml: -<pre> -<?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/button_pressed" /> <!-- pressed --> - <item android:state_focused="true" - android:drawable="@drawable/button_focused" /> <!-- focused --> - <item android:state_hovered="true" - android:drawable="@drawable/button_focused" /> <!-- hovered --> - <item android:drawable="@drawable/button_normal" /> <!-- default --> -</selector> -</pre> - -<p> -This layout XML applies the above state list drawable to a {@link android.widget.Button}: -</p> -<pre> -<Button - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:background="@drawable/button" /> -</pre> - -<p> -Provide sufficient padding within the focusable and selectable controls so that the highlights around them are clearly visible. -</p> - -<h2 id="DesignForEasyNavigation">Design for Easy Navigation</h2> - -<p> -Users should be able to navigate to any UI control with a couple of D-pad clicks. Navigation should be easy and intuitive to -understand. For any non-intuitive actions, provide users with written help, using a dialog triggered by a help button or action bar icon. -</p> - -<p> -Predict the next screen that the user will want to navigate to and provide one click navigation to it. If the current screen UI is very sparse, -consider making it a multi pane screen. Use fragments for making multi-pane screens. For example, consider the multi-pane UI below with continent names -on the left and list of cool places in each continent on the right. -</p> - -<img src="{@docRoot}images/training/cool-places.png" alt="" /> - -<p> -The above UI consists of three Fragments - <code>left_side_action_controls</code>, <code>continents</code> and -<code>places</code> - as shown in its layout -xml file below. Such multi-pane UIs make D-pad navigation easier and make good use of the horizontal screen space for -TVs. -</p> -res/layout/cool_places.xml -<pre> -<LinearLayout - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="horizontal" - > - <fragment - android:id="@+id/left_side_action_controls" - android:layout_width="0px" - android:layout_height="match_parent" - android:layout_marginLeft="10dip" - android:layout_weight="0.2"/> - <fragment - android:id="@+id/continents" - android:layout_width="0px" - android:layout_height="match_parent" - android:layout_marginLeft="10dip" - android:layout_weight="0.2"/> - - <fragment - android:id="@+id/places" - android:layout_width="0px" - android:layout_height="match_parent" - android:layout_marginLeft="10dip" - android:layout_weight="0.6"/> - -</LinearLayout> -</pre> - -<p> -Also, notice in the UI layout above action controls are on the left hand side of a vertically scrolling list to make -them easily accessible using D-pad. -In general, for layouts with horizontally scrolling components, place action controls on left or right hand side and -vice versa for vertically scrolling components. -</p> - diff --git a/docs/html/training/tv/unsupported-features-tv.jd b/docs/html/training/tv/unsupported-features-tv.jd deleted file mode 100644 index a9f090b..0000000 --- a/docs/html/training/tv/unsupported-features-tv.jd +++ /dev/null @@ -1,157 +0,0 @@ -page.title=Handling Features Not Supported on TV -parent.title=Designing for TV -parent.link=index.html - -trainingnavtop=true -previous.title=Optimizing Navigation for TV -previous.link=optimizing-navigation-tv.html - -@jd:body - -<div id="tb-wrapper"> -<div id="tb"> - -<h2>This lesson teaches you to</h2> -<ol> - <li><a href="#WorkaroundUnsupportedFeatures">Work Around Features Not Supported on TV</a></li> - <li><a href="#CheckAvailableFeatures">Check for Available Features at Runtime</a></li> -</ol> - -</div> -</div> - -<p> -TVs are much different from other Android-powered devices: -</p> -<ul> - <li>They're not mobile.</li> - <li>Out of habit, people use them for watching media with little or no interaction.</li> - <li>People interact with them from a distance.</li> -</ul> - -<p> -Because TVs have a different purpose from other devices, they usually don't have hardware features -that other Android-powered devices often have. For this reason, the Android system does not -support the following features for a TV device: -<table> -<tr> -<th>Hardware</th> -<th>Android feature descriptor</th> -</tr> -<tr> -<td>Camera</td> -<td>android.hardware.camera</td> -</tr> -<tr> -<td>GPS</td> -<td>android.hardware.location.gps</td> -</tr> -<tr> -<td>Microphone</td> -<td>android.hardware.microphone</td> -</tr> -<tr> -<td>Near Field Communications (NFC)</td> -<td>android.hardware.nfc</td> -</tr> -<tr> -<td>Telephony</td> -<td>android.hardware.telephony</td> -</tr> -<tr> -<td>Touchscreen</td> -<td>android.hardware.touchscreen</td> -</tr> -</table> -</p> - -<p> -This lesson shows you how to work around features that are not available on TV by: -<ul> - <li>Providing work arounds for some non-supported features.</li> - <li>Checking for available features at runtime and conditionally activating/deactivating certain code - paths based on availability of those features.</li> -</ul> -</p> - - -<h2 id="WorkaroundUnsupportedFeatures">Work Around Features Not Supported on TV</h2> - -<p> -Android doesn't support touchscreen interaction for TV devices, most TVs don't have touch screens, -and interacting with a TV using a touchscreen is not consistent with the 10 foot environment. For -these reasons, users interact with Android-powered TVs using a remote. In consideration of this, -ensure that every control in your app can be accessed with the D-pad. Refer back to the previous two lessons -<a href="{@docRoot}training/tv/optimizing-layouts-tv.html">Optimizing Layouts for TV</a> and -<a href="{@docRoot}training/tv/optimizing-navigation-tv.html">Optimize Navigation for TV</a> for -more details -on this topic. The Android system assumes that a device has a touchscreen, so if you want your application -to run on a TV, you must <strong>explicitly</strong> disable the touchscreen requirement in your manifest file: -<pre> -<uses-feature android:name="android.hardware.touchscreen" android:required="false"/> -</pre> -</p> - -<p> -Although a TV doesn't have a camera, you can still provide a photography-related application on a TV. -For example, if you have an app that takes, views and edits photos, you can disable its picture-taking -functionality for TVs and still allow users to view and even edit photos. The next section talks about how to -deactivate or activate specific functions in the application based on runtime device type detection. -</p> - -<p> -Because TVs are stationary, indoor devices, they don't have built-in GPS. If your application uses location -information, allow users to search for a location or use a "static" location provider to get -a location from the zip code configured during the TV setup. -<pre> -LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); -Location location = locationManager.getLastKnownLocation("static"); -Geocoder geocoder = new Geocoder(this); -Address address = null; - -try { - address = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1).get(0); - Log.d("Zip code", address.getPostalCode()); - -} catch (IOException e) { - Log.e(TAG, "Geocoder error", e); -} -</pre> -</p> - -<p> -TVs usually don't support microphones, but if you have an application that uses voice control, -you can create a mobile device app that takes voice input and then acts as a remote control for a TV. -</p> - -<h2 id="CheckAvailableFeatures">Check for Available Features at Runtime</h2> - -<p> -To check if a feature is available at runtime, call -{@link android.content.pm.PackageManager#hasSystemFeature(String)}. - This method takes a single argument : a string corresponding to the -feature you want to check. For example, to check for touchscreen, use -{@link android.content.pm.PackageManager#hasSystemFeature(String)} with the argument -{@link android.content.pm.PackageManager#FEATURE_TOUCHSCREEN}. -</p> - -<p> -The following code snippet demonstrates how to detect device type at runtime based on supported features: - -<pre> -// Check if android.hardware.telephony feature is available. -if (getPackageManager().hasSystemFeature("android.hardware.telephony")) { - Log.d("Mobile Test", "Running on phone"); -// Check if android.hardware.touchscreen feature is available. -} else if (getPackageManager().hasSystemFeature("android.hardware.touchscreen")) { - Log.d("Tablet Test", "Running on devices that don't support telphony but have a touchscreen."); -} else { - Log.d("TV Test", "Running on a TV!"); -} -</pre> -</p> - -<p> -This is just one example of using runtime checks to deactivate app functionality that depends on features -that aren't available on TVs. -</p>
\ No newline at end of file diff --git a/docs/html/tv/images/hero.jpg b/docs/html/tv/images/hero.jpg Binary files differnew file mode 100644 index 0000000..e951167 --- /dev/null +++ b/docs/html/tv/images/hero.jpg diff --git a/docs/html/tv/index.jd b/docs/html/tv/index.jd new file mode 100644 index 0000000..5c48e49 --- /dev/null +++ b/docs/html/tv/index.jd @@ -0,0 +1,254 @@ +page.title=Android TV +page.viewport_width=970 +fullpage=true +no_footer_links=true +page.type=about + +@jd:body + +<style> +.fullpage>#footer, +#jd-content>.content-footer.wrap { + display:none; +} +</style> + + +<div class="landing-body-content"> + + <div class="landing-hero-container"> + + <div class="landing-section tv-hero"> + <div class="landing-hero-scrim"></div> + <div class="landing-hero-wrap"> + <div class="vertical-center-outer"> + <div class="vertical-center-inner"> + + <div class="col-10"> + <div class="landing-section-header"> + <div class="landing-h1 hero">Android TV</div> + <div class="landing-subhead hero">Your apps on the big screen</div> + <div class="landing-hero-description"> + <p>Engage users from the comfort of their couches. + Put your app on TV and bring everyone into + the action.</p> + </div> + </div> + + <div class="landing-body"> + <a href="{@docRoot}preview/tv/start/index.html" class="landing-button + landing-primary" style="margin-top: 40px;"> + Get Started + </a> + </div> + </div> + </div> + </div> + </div> <!-- end .wrap --> + <div class="landing-scroll-down-affordance"> + <a class="landing-down-arrow" href="#reimagine-your-app"> + <img src="{@docRoot}wear/images/carrot.png" alt="Scroll down to read more"> + </a> + </div> + </div> <!-- end .landing-section .landing-hero --> + + <div class="landing-rest-of-page"> + + <div class="landing-section" style="background-color:#f5f5f5" id="reimagine-your-app"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Reimagine Your App</div> + <div class="landing-subhead"> + Design your app to shine on the biggest screen in the house. + </div> + </div> + + <div class="landing-body"> + <div class="landing-breakout cols"> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Simple</p> + <p class="landing-small"> + Smooth, fast interactions are key to a successful TV app. Keep navigation simple + and light. Bring your content forward to let users enjoy it with a minimum of + fuss. + </p> + <p class="landing-small"> + <a href="{@docRoot}design/tv/index.html">Learn about TV design</a> + </p> + </div> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Cinematic</p> + <p class="landing-small"> + What would your app look like if it were a film? Use movement, animation and sound to make your app into an experience. + </p> + <p class="landing-small"> + <a href="{@docRoot}design/tv/index.html">Learn about TV design</a> + </p> + </div> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Beautiful</p> + <p class="landing-small"> + Apps on TV should be a pleasure to look at, as well as enjoyable to use. Use + made-for-TV styles to make your app familiar and fun. + </p> + <p class="landing-small"> + <a href="{@docRoot}design/tv/index.html">Learn about design for TV</a> + </p> + </div> + </div> + + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + <div class="landing-section landing-gray-background"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1">Build to Entertain</div> + <div class="landing-subhead"> + Android TV lets you engage your users in a new, shared environment.<br> + Find out how to get your app ready for its big-screen debut. + </div> + </div> + + + <div class="landing-body"> + <div class="landing-breakout cols"> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Made for TV</p> + <p class="landing-small"> + Take advantage of pre-built fragments for browsing and interacting with media + catalogs. + </p> + <p class="landing-small"> + <a href="{@docRoot}preview/tv/ui/browse.html">Learn pre-built fragments</a> + </p> + </div> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Get Found</p> + <p class="landing-small"> + Help users find your content quickly with in-app searching. + </p> + <p class="landing-small"> + <a href="{@docRoot}preview/tv/ui/in-app-search.html">Learn about app search</a> + </p> + </div> + + <div class="col-3-wide"> + <img src="{@docRoot}tv/images/placeholder-square.png" alt=""> + + <p>Recommend</p> + <p class="landing-small"> + Suggest content from your app to keep your users coming back. + </p> + <p class="landing-small"> + <a href="{@docRoot}preview/tv/ui/recommendations.html">Learn about + recommendations</a> + </p> + </div> + + </div> + + </div> + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + <div class="landing-section landing-red-background"> + <div class="wrap"> + <div class="landing-section-header"> + <div class="landing-h1 landing-align-left">Get Started with Android TV</div> + <div class="landing-body"> + <p>Begin building TV apps right away using these developer resources:</p> + </div> + </div> + + <div class="landing-body"> + <div class="landing-breakout cols"> + <div class="col-8" style="margin-left: -8px;"> + <p style="font-size: 24px;">L-Preview SDK</p> + <p> + The preview SDK includes all the tools you need to build and test apps for TV. + Download it and start creating your big-screen app. + </p> + + </div> + + <div class="col-8"> + <p style="font-size: 24px;">ADT-1 Developer Kit</p> + <p> + Request an ADT-1 Developer Kit, a compact and powerful streaming media player + and gamepad, ideal for developing and testing apps for TV. + </p> + + </div> + + </div> + </div> + + <div class="landing-body"> + <div class="landing-breakout cols"> + + <div class="col-8"> + <a href="{@docRoot}preview/setup-sdk.html" class="landing-button landing-primary"> + Download the Preview SDK + </a> + </div> + + <div class="col-8"> + <a href="{@docRoot}preview/tv/adt-1/request.html" class="landing-button landing-primary"> + Request ADT-1 Developer Kit + </a> + </div> + </div> + </div> + + </div> <!-- end .wrap --> + </div> <!-- end .landing-section --> + + </div> <!-- end .landing-rest-of-page --> + + <div class="content-footer wrap" itemscope="" itemtype="http://schema.org/SiteNavigationElement" + style="border-top: none;"> + <div class="layout-content-col col-16" style="padding-top:4px"> + <style>#___plusone_0 {float:right !important;}</style> + <div class="g-plusone" data-size="medium"></div> + </div> + </div> + <div id="footer" class="wrap" style="width:940px;position:relative;top:-35px;z-index:-1"> + <div id="copyright"> + Except as noted, this content is + licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> + Creative Commons Attribution 2.5</a>. For details and + restrictions, see the <a href="/license.html">Content + License</a>. + </div> + </div> + + </div> <!-- end .landing-hero-container --> + + <script> + $("a.landing-down-arrow").on("click", function(e) { + $("body").animate({ + scrollTop: $(".tv-hero").height() + 120 + }, 1000, "easeOutQuint"); + e.preventDefault(); + }); + </script> + +</div> <!-- end landing-body-content --> + diff --git a/docs/html/wear/css/wear.css b/docs/html/wear/css/wear.css deleted file mode 100644 index fe9eef2..0000000 --- a/docs/html/wear/css/wear.css +++ /dev/null @@ -1,447 +0,0 @@ -/** - * UTILITIES - */ - - -.border-box { - box-sizing: border-box; -} - -.vertical-center-outer { - display: table; - height: 100%; - width: 100%; -} - -.vertical-center-inner { - display: table-cell; - vertical-align: middle; -} - -/** - * TYPE STYLES - */ - -.wear-h1 { - font-weight: 300; - font-size: 60px; - line-height: 78px; - text-align: center; - letter-spacing: -1px; -} - -.wear-pre-h1 { - font-weight: 400; - font-size: 28px; - color: #93B73F; - line-height: 36px; - text-align: center; - letter-spacing: -1px; - text-transform: uppercase; - -} - -.wear-h1.hero { - text-align: left; -} - -.wear-h2 { - font-weight: 300; - font-size: 42px; - line-height: 64px; - text-align: center; -} - - -.wear-subhead { - color: #999999; - font-size: 20px; - line-height: 28px; - text-align: center; -} -.wear-subhead.hero { - text-align: left; - color: white; -} - -.wear-hero-description { - text-align: left; - margin: 1em 0; -} - -.wear-hero-description p { - font-weight: 300; - margin: 0; - font-size: 18px; - line-height: 24px; -} - -.wear-body .wear-small { - font-size: 14px; - line-height: 19px; -} - -.wear-body.wear-align-center { - text-align: center; -} - -.wear-align-left { - text-align: left; -} - -/** - * LAYOUT - */ - -#body-content, -.fullpage, -#jd-content, -.jd-descr, -.wear-body-content { - height: 100%; -} - -.wear-section { - padding: 80px 10px 80px; - width: 100%; - margin-left: -10px; - text-rendering: optimizeLegibility; -} - -#extending-android-to-wearables { - padding-top: 30px; -} - -.wear-short-section { - padding: 40px 10px 28px; -} - -.wear-gray-background { - background-color: #e9e9e9; -} - -.wear-white-background { - background-color: white; -} - -.wear-red-background { - color: white; - background-color: hsl(8, 70%, 54%); -} - -.wear-subhead-red { - color: hsl(8, 71%, 84%); - text-align: left; -} - -.wear-subhead-red p { - margin-top: 20px; -} - -.wear-hero-container { - height: 100%; -} - -.wear-hero { - height: calc(100% - 70px); - min-height: 504px; - margin-top: 0; - padding-top: 0; - padding-bottom: 0; - background-image: url(/wear/images/hero.jpg); - background-size: cover; - background-position: right center; - color: white; - position: relative; - overflow: hidden; -} - -.wear-hero-scrim { - background: black; - opacity: .2; - position: absolute; - width: 100%; - height: 100%; - margin-left: -10px; -} - -.wear-hero-wrap { - margin: 0 auto; - width: 940px; - clear: both; - height: 100%; - position: relative; -} - -.wear-section-header { - margin-bottom: 40px; -} - -.wear-hero-wrap .wear-section-header { - margin-bottom: 16px; -} - -.wear-body { - font-size: 18px; - line-height: 24px; -} - -.wear-button { - white-space: nowrap; - display: inline-block; - padding: 16px 32px; - font-size: 18px; - font-weight: 500; - line-height: 24px; - cursor: pointer; - color: white; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - user-select: none; - -webkit-transition: .2s background-color ease-in-out; - -moz-transition: .2s background-color ease-in-out; - -o-transition: .2s background-color ease-in-out; - transition: .2s background-color ease-in-out; -} - -.wear-primary { - background-color: hsl(8, 70%, 54%); /* #dc4b35 */ - color: #f8f8f8; -} - -.wear-button.wear-primary:hover { - background-color: hsl(8, 70%, 44%); /* #bf3722 */ -} - -.wear-button.wear-primary:active { - background-color: hsl(8, 70%, 36%); /* # */ -} - -.wear-button.wear-secondary { - background-color: hsl(8, 70%, 44%); -} - -.wear-button.wear-secondary:hover { - background-color: hsl(8, 70%, 36%); -} - -.wear-button.wear-secondary:active { - background-color: hsl(8, 70%, 30%); -} - -a.wear-button, -a.wear-button:hover, -a.wear-button:visited { - color: white !important; -} - -.wear-video-link { - white-space: nowrap; - display: inline-block; - padding: 16px 32px 16px 82px; - font-size: 18px; - font-weight: 400; - line-height: 24px; - cursor: pointer; - color: hsla(0, 0%, 100%, .8); - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - user-select: none; - -webkit-transition: .2s color ease-in-out; - -moz-transition: .2s color ease-in-out; - -o-transition: .2s color ease-in-out; - transition: .2s color ease-in-out; -} - -.wear-video-link:before { - height: 64px; - width: 64px; - display: inline-block; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAFuklEQVR42u2dXWgcVRSAV9LWtBBTTZVWUhNqEQtq1QeroDRKFRFsROqTYPuo+JCiIoJKFC0USqlUfCiowRcfrBgVUUElefAPkW5T8aeaGn9aRbFsjP0x2cx8PuRMvFxmdjeb2Z17Z8+B85DsZPbO+eaec3/OPSkABdXsVI2gABSAqgJQAKoKQAGoKgAFoKoAFICqAlAAqgpAAai6DqDRAiwDeoFtwB7gPaAInABKwKToCWAMeB/YDdwJrAWWNLh9+QMAXABsBQ4A3wFTwAxQBmaBAAhjNJDPy3L938BXwAvArUCHAkh+kCXAVcA+YBw4bRg7MngtkgTlDPA98CywHmhTAP8/xCbgVeAvMZZpwDQllN7xB/AysKGlAQAXAvuBkzW85UVgCBgENlfQQbmuWAXELPAnsAvoaikAQBtwh/j3coLhS2LIfqCzzu/plL8fkvvFgZiR4L2lHrfkHQBgpQTFUwmGnwC212v0KjC2y/3jQPwDPA+05xYAcBHwubx1YZzhC02QBBBRbxgBzssdAOBy4JgRZE0ZTPuNr7FHDCbEhqNAd24AAN0yUbID7QSwsZChABut3hANXY8Bq70HIMb/Ocb4w81+66v0hmGrN0QQ1ngLQJYRvpWHMWWo4KDIaMnuCcVKgdlZAGL8t2J8vpPGrwChDLyWBMFlAA8D0z4ZvwKEs8D93gCQEc9Jy/jFgkdizaRDGUSs8wXAu1bQLQE9ngHosWbPAXDQeQAypT9rBd3+gociyxi2K9riLABZUj5iuZ6RgsciM2OzFxw2A7JrAO6VwGtKTwpG+Anoy9AVmb3gDHCPcwCAFcChRox6jPu9CazMeFQUAKNRL3AJwE2yopjq228BQPZ/d2bcCyaBTa4BeNGa8Q6naIA4GQWubiKEYWvBbp8zAGQt5VfL/fQ3GEAkTzXDLVkjokA2k5a7AuA2GaLNj/tTfvhq0pQgbcwLQtlQusYVALtlzSR191MjADNI9zbJDZWBR10BMGr5/4GMADQ0SAMDlht62xUAxy0AmzMEEMnhtIO0ZF2YAH5wITd0hQw/5wE04M1bjDyXZpC2hqMlYGnWAHqBf40APOEYgChI35VSWyasWfGqrAH0WVkOIw4CSC1IG2tDoSy7XJE1gPs8ArDoIG0BmJGk30wBDHgGYFFBOgbAtqwB7GxxAHerC8rOBU0Dt2gQzjYIb8gawDor+6HVhqFdrkzEwhabiAVOTMSkUb+06FLEUVfWgj5q0cW4g64AeNo66ZLlcnTDNmesBN4y8KArAG6QU42ttCEzBVzpCoAO4EfLDeV5SzIEvgHaXdqUP2BlQud1Ux55zj2uZUX02cPRnKalRLmu17qYmPWF5YbymJgVAh8Ay5wCII3ZEZOYm6fURGT2u9X43Mnk3CDHybmfmRVYXExPv9nKEcpLejqSC3SjdY2TBzTesHqB7wc0onTEV2KucxLApXKkJy9HlAI5anuJFwCkYQ/EuCJfD+mdBnYkXOssgHY53un7MdVZ4CVgqVcADAhjMafkfTioHc14P04yvvMApIEXy5F/+7S8y6UKolPyR4BVVf7Wi2IdawwIPhTrmAW+rmZ8bwBIQ7vloXwoVzNWS6UUrwAYy9YfOlqwKZDkgneA5Qu4l3cly84F9sqGhislywLmaozuYoGFXr0DII1ukxP1hxJ6QzR7HqLxRfumZaRzXZ3f4XXZyi7gCeB3kqsnzs+kSb9s5XHgMeD8RTxDLgq3rmeuYuFvNYCoR8wqujNi+L3UWBcu9wAMt3QZ8LiMlk5RuU50teq6kcEDgTolveIRYHUQBOek1O5cFu/ukLz7/ZJgNSm+OirebWpgaPS7slxfAr4EngGuX8jopqUBxGzyrAVuB54EXgc+lV4yLhO8cfn5E+ZqUD8kBu9sQvv0Hzj4rmoEBaAAVBWAAlBVAApAVQEoAFUFoABUFYACUFUACkC1CfofXVRJocowZVYAAAAASUVORK5CYII=); - background-size: contain; - position: absolute; - content: ""; - opacity: .7; - margin-top: -19px; - margin-left: -64px; - -webkit-transition: .2s opacity ease-in-out; - -moz-transition: .2s opacity ease-in-out; - -o-transition: .2s opacity ease-in-out; - transition: .2s opacity ease-in-out; -} - -.wear-video-link:hover { - color: hsla(0, 0%, 100%, 1); -} - -.wear-video-link:hover:before { - opacity: 1; -} - -.wear-social-image { - float: left; - margin-right: 14px; - height: 64px; - width: 64px; -} - -.wear-social-copy { - padding-left: 78px; -} - -.wear-scroll-down-affordance { - position: absolute; - bottom: 0; - width: 100%; - text-align: center; - z-index: 10; -} - -.wear-down-arrow { - padding: 24px; - display: inline-block; - opacity: .5; - -webkit-transition: .2s opacity ease-in-out; - -moz-transition: .2s opacity ease-in-out; - -o-transition: .2s opacity ease-in-out; - transition: .2s opacity ease-in-out; - - -webkit-animation-name: pulse-opacity; - -webkit-animation-duration: 4s; -} - -.wear-down-arrow:hover { - opacity: 1; -} - -.wear-down-arrow img { - height: 28px; - width: 28px; - margin: 0 auto; - display: block; -} - -.wear-divider { - display: inline-block; - height: 2px; - background-color: white; - position: relative; - margin: 10px 0; -} - -/* 3 CLOLUMN LAYOUT */ - -.wear-breakout { - margin-top: 40px; - margin-bottom: 40px; -} - -.wear-breakout img { - margin-bottom: 20px; -} - -.wear-partners img { - margin-bottom: 20px; -} - -.wear-breakout p { - padding: 0 23px; -} - -.wear-inset-video-container { - position: relative; -} - -.wear-inset-video-container img.gif { - max-width: 222px; - position: absolute; - top: 40px; - left: 40px; -} - -img.wear-bezel-only { - height:302px; - width:302px; -} - -.wear-breakout.wear-partners img { - margin-bottom: 20px; -} - -.col-3-wide { - display: inline; - float: left; - margin-left: 10px; - margin-right: 10px; -} - -.col-3-wide { - width: 302px; -} - -/** - * ANIMATION - */ - -@-webkit-keyframes pulse-opacity { - 0% { - opacity: .5; - } - 20% { - opacity: .5; - } - 40% { - opacity: 1; - } - 60% { - opacity: .5; - } - 80% { - opacity: 1; - } - 100% { - opacity: .5; - } -} - - - -/** - * VIDEO - */ - -#video-container { - display:none; - position:fixed; - top:0; - left:-10px; - width:102%; - height:100%; - background-color:rgba(0,0,0,0.7); - z-index:99; -} - -#video-frame { - width:940px; - height:526.4px; - margin:80px auto 0; - display:none; -} - -.video-close { -cursor: pointer; -position: relative; -left: 940px; -top: 0; -pointer-events: all; -} - -#icon-video-close { -background-image: url("../images/close.png"); -background-position: 0 0; -height: 36px; -width: 36px; -display:block; -} diff --git a/docs/html/wear/images/hero.jpg b/docs/html/wear/images/hero.jpg Binary files differindex 40cc03c..0b4debb 100644 --- a/docs/html/wear/images/hero.jpg +++ b/docs/html/wear/images/hero.jpg diff --git a/docs/html/wear/images/kitchen_still.jpg b/docs/html/wear/images/kitchen_still.jpg Binary files differdeleted file mode 100644 index 4afe359..0000000 --- a/docs/html/wear/images/kitchen_still.jpg +++ /dev/null diff --git a/docs/html/wear/index.jd b/docs/html/wear/index.jd index 659e9f2..bc08aa0 100644 --- a/docs/html/wear/index.jd +++ b/docs/html/wear/index.jd @@ -2,7 +2,7 @@ page.title=Android Wear page.viewport_width=970 fullpage=true no_footer_links=true -page.customHeadTag=<link rel="stylesheet" type="text/css" href="/wear/css/wear.css"> +page.type=about @jd:body @@ -14,8 +14,6 @@ page.customHeadTag=<link rel="stylesheet" type="text/css" href="/wear/css/wear.c </style> - - <div id="video-container"> <div id="video-frame"> <div class="video-close"> @@ -23,28 +21,28 @@ page.customHeadTag=<link rel="stylesheet" type="text/css" href="/wear/css/wear.c </div> <script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <div id="ytapiplayer"> - <a href="http://www.youtube.com/watch?v=0xQ3y902DEQ"><img width=940 - src="https://i1.ytimg.com/vi/0xQ3y902DEQ/maxresdefault.jpg"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. --> + <a href="http://www.youtube.com/watch?v=0xQ3y902DEQ"><img width="940" src="https://i1.ytimg.com/vi/0xQ3y902DEQ/maxresdefault.jpg"></a><!--You need Flash player 8+ and JavaScript enabled to view this video. --> </div> </div> </div> -<div class="wear-body-content"> - <div class="wear-hero-container"> - <div class="wear-section wear-hero"> - <div class="wear-hero-scrim"></div> - <div class="wear-hero-wrap"> +<div class="landing-body-content"> + <div class="landing-hero-container"> + <div class="landing-section wear-hero"> + <div class="landing-hero-scrim"></div> + <div class="landing-hero-wrap"> <div class="vertical-center-outer"> <div class="vertical-center-inner"> <div class="col-10"> - <div class="wear-section-header"> - <div class="wear-h1 hero">Android Wear</div> - <div class="wear-subhead hero">Information that moves with you</div> + <div class="landing-section-header"> + <div class="landing-h1 hero">Android Wear</div> + <div class="landing-subhead hero">Information that moves with you</div> </div> - <div class="wear-hero-description"> + <div class="landing-hero-description"> + <p>Small, powerful devices, worn on the body. Useful information when you need it most. Intelligent answers to spoken questions. @@ -52,222 +50,150 @@ page.customHeadTag=<link rel="stylesheet" type="text/css" href="/wear/css/wear.c Your key to a multiscreen world.</p> </div> - <div class="wear-body"> - <a href="/wear/preview/start.html" class="wear-button wear-primary" style="margin-top: 40px;"> - Get the Developer Preview - </a> - <a id="watchVideo" href="https://youtube.googleapis.com/v/0xQ3y902DEQ"> - <div class="wear-video-link">Watch the video</div> + <div class="landing-body"> + <a href="{@docRoot}training/building-wearables.html" class="landing-button landing-primary" style="margin-top: 40px;"> + Get Started </a> -<script> -$("#watchVideo").on("click", function(e) { - $("#video-container").fadeIn(400, function(){$("#video-frame").show()}); - - var params = { allowScriptAccess: "always"}; - var atts = { id: "ytapiplayer" }; - swfobject.embedSWF("//www.youtube.com/v/0xQ3y902DEQ?enablejsapi=1&playerapiid=ytplayer&version=3&HD=1;rel=0;showinfo=0;modestbranding;origin=developer.android.com;autohide=1;autoplay=1", - "ytapiplayer", "940", "526.4", "8", null, null, params, atts); - - e.preventDefault(); -}); -$("#icon-video-close").on("click", function() { - ytplayer = document.getElementById("ytapiplayer"); - try { - ytplayer.stopVideo(); - $(ytplayer).hide(); - $("#video-container").fadeOut(400); - } catch(e) { - console.log('Video not available'); - $("#video-container").fadeOut(400); - } -}); -</script> </div> </div> </div> </div> </div> <!-- end .wrap --> - <div class="wear-scroll-down-affordance"> - <a class="wear-down-arrow" href="#extending-android-to-wearables"> - <img src="/wear/images/carrot.png" alt="Scroll down to read more"> + <div class="landing-scroll-down-affordance"> + <a class="landing-down-arrow" href="#extending-android-to-wearables"> + <img src="{@docRoot}wear/images/carrot.png" alt="Scroll down to read more"> </a> </div> - </div> <!-- end .wear-section .wear-hero --> - </div> <!-- end .wear-hero-container --> + </div> <!-- end .landing-section .landing-hero --> - <div class="wear-rest-of-page"> - <div class="wear-section" id="extending-android-to-wearables"> + + <div class="landing-rest-of-page" style="margin-top:80px"> + <div class="landing-section" id="extending-android-to-wearables"> <div class="wrap"> - <div class="wear-section-header"> - <div class="wear-h1">Extending Android to Wearables</div> - <div class="wear-subhead"> - Android Wear extends the Android platform to a new generation of wearable devices. <br> - The user experience is designed specifically for wearables. + <div class="landing-section-header"> + <div class="landing-h1">Extending Android to Wearables</div> + <div class="landing-subhead"> + Android Wear extends the Android platform to a new generation of devices, <br> + with a user experience that's designed specifically for wearables. + </div> </div> - <div class="wear-body"> - <div class="wear-breakout cols"> + <div class="landing-body"> + <div class="landing-breakout cols"> <div class="col-3-wide"> - <div class="wear-inset-video-container"> - <img class="wear-bezel-only" src="/wear/images/screens/bezel.png" alt=""> - <img class="gif" src="/wear/images/screens/reservation_animated.gif"> + <div class="framed-wear-square"> + <img src="{@docRoot}wear/images/screens/reservation_animated.gif"> </div> - <p class="wear-small"> + <p class="landing-small"> Say “Ok Google” to ask questions and get stuff done. </p> </div> <div class="col-3-wide"> - <img src="/wear/images/screens/circle_message2.png" itemprop="image" alt="" > - <p class="wear-small"> - Get glanceable, actionable information at just the right time throughout the day. + <img src="{@docRoot}wear/images/screens/circle_message2.png" itemprop="image" alt=""> + <p class="landing-small"> + Get glanceable, actionable information at just the right time with notifications + that are synced from your handheld device. + </p> </div> <div class="col-3-wide"> - <img src="/wear/images/screens/fitness-24.png" alt=""> - <p class="wear-small"> - A wide range of sensors is available to your applications, from accelerometers to heart rate monitors. + <img src="{@docRoot}wear/images/screens/fitness-24.png" alt=""> + <p class="landing-small"> + Design apps that can access a wide range of sensors and other hardware + directly on the wearable. + </p> </div> </div> <p> - The Android Wear Developer Preview lets you create wearable experiences for your existing Android apps and see how they will appear on square and round Android wearables. - </p> + Before you start building, check out the + <a href="{@docRoot}design/wear/index.html">Android Wear Design Principles</a> + to understand how to create great experiences for this exciting, new form factor.</p> - <p> - Later this year, we’ll be launching the Android Wear SDK, enabling even more customized experiences. - </p> </div> </div> <!-- end .wrap --> - </div> <!-- end .wear-section --> + </div> <!-- end .landing-section --> - <div class="wear-section wear-gray-background"> + <div class="landing-section landing-gray-background"> <div class="wrap"> - <div class="wear-section-header"> - <div class="wear-h1">Developer Preview</div> - <div class="wear-subhead"> - Your app’s notifications will already appear on Android wearables. <br> - With the new Android Wear APIs you can customize and extend those notifications. + <div class="landing-section-header"> + <div class="landing-h1">Developing for Android Wear</div> + <div class="landing-subhead"> + The Android Wear APIs are delivered in the Android v4 support library and Google Play services. + This lets Android handhelds, old and new, communicate with Android wearables. </div> </div> - - <div class="wear-body"> - <div class="wear-breakout cols"> - <div class="col-3-wide"> - <img src="images/screens/14_circle_voicereply.png" alt=""> - <p>Receive Voice Replies</p> - <p class="wear-small"> - Add actions to your notifications to allow users to reply by voice or touch. The system delivers the text to your app on the phone. - </p> - <p class="wear-small"> - <a href="/wear/notifications/remote-input.html">Learn about input actions</a> - </p> - </div> - <div class="col-3-wide"> - - - <div class="wear-inset-video-container"> - <img class="wear-bezel-only" src="/wear/images/screens/bezel.png" alt=""> - <img class="gif" src="/wear/images/screens/pages_animated.gif"> - </div> - - <p>Add Notification Pages</p> - <p class="wear-small"> - Add additional pages to your notification that are visible on the wearable device to provide detailed information on the wrist. + <div class="landing-body"> + <div class="landing-breakout cols"> + <div class="col-4"> + <img src="{@docRoot}wear/images/features/ts2.png" alt=""> + <p>Synced Notifications</p> + <p class="landing-small"> + Notifications on handhelds can automatically sync to wearables, so design them + with both devices in mind. </p> - <p class="wear-small"> - <a href="/wear/notifications/pages.html">Learn about pages</a> + <p class="landing-small"> + <a href="{@docRoot}training/wearables/notifications/index.html">Build notifications</a> </p> </div> - <div class="col-3-wide"> - <img src="images/screens/11_stack_B.png" alt=""> - <p>Stack Multiple Notifications</p> - <p class="wear-small"> - Your app should consolidate similar notifications. On a wearable, you can stack them together so the details for each are immediately available. - </p> - <p class="wear-small"> - <a href="/wear/notifications/stacks.html">Learn about stacks</a> + <div class="col-4"> + <img src="{@docRoot}wear/images/features/ts1.png" alt=""> + <p>Wearable Apps</p> + <p class="landing-small"> + Create custom experiences with activities, services, sensors, and much + more with the Android SDK. </p> - </div> - </div> - - <p> - You can also trigger your notifications contextually using existing Android APIs. For example, use <a href="{@docRoot}training/location/geofencing.html">geofences</a> to provide glanceable information to your users when they are at home, or use the <a href="{@docRoot}training/location/activity-recognition.html">activity detection APIs</a> to send messages to your users’ wrists while they are bicycling. - </p> - - <p>See the <a href="{@docRoot}wear/design/index.html">Android Wear Developer Preview Design Principles</a> for more suggestions on creating great wearable experiences.</p> + <p class="landing-small"> + <a href="{@docRoot}training/wearables/apps/index.html">Create wearable apps</a> - </div> - </div> <!-- end .wrap --> - </div> <!-- end .wear-section --> - - <div class="wear-section" style="background-color:#f5f5f5"> - <div class="wrap"> - <div class="wear-section-header"> - <div class="wear-pre-h1">Coming soon</div> - <div class="wear-h1">The Android Wear SDK</div> - <div class="wear-subhead"> - The Developer Preview is just the beginning for Android Wear. - </div> - </div> - - <div class="wear-body"> - <p> - In the coming months we’ll be launching new APIs and features for Android wearables to create even more unique experiences for the wrist: - </p> - - <div class="wear-breakout cols"> - <div class="col-4"> - <img src="/wear/images/features/ts1.png" alt=""> - <p>Build Custom UI</p> - <p class="wear-small"> - Create custom card layouts and run activities directly on wearables. </p> </div> <div class="col-4"> - <img src="/wear/images/features/ts2.png" alt=""> + <img src="{@docRoot}wear/images/features/ts2.png" alt=""> <p>Send Data</p> - <p class="wear-small"> - Send data and actions between a phone and a wearable with data replication APIs and RPCs. + <p class="landing-small"> + Send data and actions between handhelds and wearables with + data replication APIs and RPCs. </p> - </div> - <div class="col-4"> - <img src="/wear/images/features/ts3.png" alt=""> - <p>Control Sensors</p> - <p class="wear-small"> - Gather sensor data and display it in real-time on Android wearables. + <p class="landing-small"> + <a href="{@docRoot}training/wearables/data-layer/index.html">Work with the Data Layer</a> + </p> </div> <div class="col-4"> - <img src="/wear/images/features/ts4.png" alt=""> + <img src="{@docRoot}wear/images/features/ts4.png" alt=""> <p>Voice Actions</p> - <p class="wear-small"> - Register your app to handle voice actions, like "Ok Google, take a note." + <p class="landing-small"> + Register your app to handle voice actions, like "Ok Google, take a note," + for a hands-free experience. + </p> + <p class="landing-small"> + <a href="{@docRoot}training/wearables/apps/voice-actions.html">Integrate voice actions</a> </p> </div> </div> - </div> </div> <!-- end .wrap --> - </div> <!-- end .wear-section --> + </div> <!-- end .landing-section --> - <div class="wear-section wear-white-background"> + <div class="landing-section landing-white-background"> <div class="wrap"> - <div class="wear-section-header"> - <div class="wear-h2">Building an Ecosystem</div> - <div class="wear-body wear-align-center"> - <p class="wear-small"> - We’re working with several partners to bring you watches powered by Android Wear later this year! + <div class="landing-section-header"> + <div class="landing-h2">Building an Ecosystem</div> + <div class="landing-body landing-align-center"> + <p class="landing-small"> + We’re working with partners around the world to build watches powered by Android Wear! </p> </div> </div> - <div class="wear-partners cols"> + <div class="landing-partners cols"> <div class="col-4"> <img src="/wear/images/partners/asus.png" alt="Asus"> </div> @@ -303,67 +229,78 @@ $("#icon-video-close").on("click", function() { </div> </div> </div> <!-- end .wrap --> - </div> <!-- end .wear-section --> + </div> - <div class="wear-section wear-red-background"> + + <div class="landing-section landing-red-background"> <div class="wrap"> - <div class="wear-section-header"> - <div class="wear-h1 wear-align-left">Start working with Android Wear</div> - <div class="wear-subhead wear-subhead-red"> - <p> - Your app’s notifications will already appear on Android wearables. <br> - With the new Android Wear APIs, you can customize and extend those notifications. - </p> + <div class="landing-section-header"> + <div class="landing-h1 landing-align-left">Get Started with Android Wear</div> + + <div class="landing-subhead landing-subhead-red"> <p> - We’re excited about wearables and the experiences developers can create with them. <br> - We can’t wait to see what you do next.</p> + Set up your development environment and start working with the APIs. + We’re excited about the experiences you'll create and can't + wait to see what you do next.</p> </div> </div> - <div class="wear-body"> - <a href="/wear/preview/start.html" class="wear-button wear-secondary" style="margin-top: 20px;"> - Get the Developer Preview + <div class="landing-body"> + <a href="{@docRoot}training/building-wearables.html" class="landing-button landing-primary" style="margin-top: 20px;"> + Get Started </a> </div> </div> </div> - <div class="wear-section"> + <div class="landing-section"> <div class="wrap"> <div class="cols"> - <div class="wear-body"> + <div class="landing-body"> <div class="col-3-wide"> <a target="_blank" href="https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-kIrPiq098QH9dOle-fLef"> - <img class="wear-social-image" src="//www.google.com/images/icons/product/youtube-128.png" alt=""> + <img class="landing-social-image" src="//www.google.com/images/icons/product/youtube-128.png" alt=""> </a> - <div class="wear-social-copy"> + <div class="landing-social-copy"> <p>DevBytes</p> - <p class="wear-small"> - Learn how to optimize your app notifications for wearable devices in this <a target="_blank" href="https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-kIrPiq098QH9dOle-fLef">DevBytes video</a> using the Android Wear Developer Preview. - </p> + <p class="landing-small"> + Learn the basic concepts of Android Wear + development with videos from the product team. + </p> + <br> + <p class="landing-small"> + <a target="_blank" href="https://www.youtube.com/playlist?list=PLWz5rJ2EKKc-kIrPiq098QH9dOle-fLef">DevBytes videos</a> + </p> </div> </div> <div class="col-3-wide"> - <a target="_blank" href="http://android-developers.blogspot.com/2014/03/android-wear-developer-preview.html"> - <img class="wear-social-image" src="/wear/images/blogger.png" alt=""> + <a target="_blank" href="http://android-developers.blogspot.com/2014/03/android-landing-developer-preview.html"> + <img class="landing-social-image" src="{@docRoot}wear/images/blogger.png" alt=""> </a> - <div class="wear-social-copy"> + <div class="landing-social-copy"> <p>Blog Post</p> - <p class="wear-small"> - Read more about the Android Wear Developer Preview announcement - at the <a target="_blank" href="http://android-developers.blogspot.com/2014/03/android-wear-developer-preview.html">Android Developers Blog</a>. + <p class="landing-small"> + Read more about Android Wear development + on our blog. Just search for "Android Wear". + </p> + <br> + <p class="landing-small"> + <a target="_blank" href="http://android-developers.blogspot.com">Android Developers Blog</a> + </p> + <p></p> </div> </div> <div class="col-3-wide"> <a target="_blank" href="http://g.co/androidweardev"> - <img class="wear-social-image" src="//www.google.com/images/icons/product/gplus-128.png" alt="+Android Wear Developers"> + <img class="landing-social-image" src="//www.google.com/images/icons/product/gplus-128.png" alt="+Android Wear Developers"> </a> - <div class="wear-social-copy"> + <div class="landing-social-copy"> <p>G+ Community</p> - <p class="wear-small"> - Follow us on Google+ to stay up-to-date on Android Wear development and join the discussion! + <p class="landing-small"> + Follow us on Google+ to stay up-to-date with Android Wear development and to join the discussion! + </p> - <p class="wear-small"> + <p class="landing-small"> <a target="_blank" href="http://g.co/androidweardev">+Android Wear Developers</a> </p> </div> @@ -371,10 +308,8 @@ $("#icon-video-close").on("click", function() { </div> </div> </div> <!-- end .wrap --> - </div> <!-- end .wear-section --> - </div> <!-- end .wear-rest-of-page --> - - + </div> <!-- end .landing-section --> + </div> <!-- end .landing-rest-of-page --> <div class="content-footer wrap" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <div class="layout-content-col col-16" style="padding-top:4px"> <style>#___plusone_0 {float:right !important;}</style> @@ -386,20 +321,20 @@ $("#icon-video-close").on("click", function() { Except as noted, this content is licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>. For details and - restrictions, see the <a href="/license.html">Content + restrictions, see the <a href="{@docRoot}license.html">Content License</a>. </div> </div> - - - </div> <!-- end wear-body-content --> + </div> <!-- end .landing-hero-container --> <script> - $("a.wear-down-arrow").on("click", function(e) { + $("a.landing-down-arrow").on("click", function(e) { $("body").animate({ - scrollTop: $(".wear-hero").height() + 76 + scrollTop: $(".wear-hero").height() + 120 }, 1000, "easeOutQuint"); e.preventDefault(); }); </script> +</div> <!-- end landing-body-content --> + diff --git a/docs/html/wear/license.jd b/docs/html/wear/license.jd deleted file mode 100644 index b07dacf..0000000 --- a/docs/html/wear/license.jd +++ /dev/null @@ -1,142 +0,0 @@ -page.title=Developer Preview License Agreement - -@jd:body - - -<div class="sdk-terms" style="height:auto;border:0;padding:0;width:700px"> -This is the Android Wear Developer Preview License Agreement. - -1. Introduction - -1.1 The Android Wear Developer Preview Kit (referred to in this License Agreement as the “Developer Preview” and specifically including the Android system files, packaged APIs, Developer Preview library files, and the Developer Preview companion app, if and when they are made available) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the Developer Preview. - -1.2 "Android Wear" means the Android Wear devices and the Android Wear software stack for use on Android Wear devices. - -1.3 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. - -1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting this License Agreement - -2.1 In order to use the Developer Preview, you must first agree to this License Agreement. You may not use the Developer Preview if you do not accept this License Agreement. - -2.2 By clicking to accept, you hereby agree to the terms of this License Agreement. - -2.3 You may not use the Developer Preview and may not accept the License Agreement if you are a person barred from receiving the Developer Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Developer Preview. - -2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Developer Preview on behalf of your employer or other entity. - -3. Developer Preview License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, internal-use, non-assignable and non-exclusive license to use the Developer Preview solely to develop applications to run on the Android Wear platform for Android Wear devices. - -3.2 You agree that Google or third parties own all legal right, title and interest in and to the Developer Preview, including any Intellectual Property Rights that subsist in the Developer Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.3 You may not use the Developer Preview for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Developer Preview or any part of the Developer Preview; or (b) load any part of the Developer Preview onto a mobile handset or wearable computing device or any other hardware device except an Android Wear device, combine any part of the Developer Preview with other software, or distribute any software or device incorporating a part of the Developer Preview. - -3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android Wear, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the Developer Preview. - -3.5 Use, reproduction and distribution of components of the Developer Preview licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. - -3.6 You agree that the form and nature of the Developer Preview that Google provides may change without prior notice to you and that future versions of the Developer Preview may be incompatible with applications developed on previous versions of the Developer Preview. You agree that Google may stop (permanently or temporarily) providing the Developer Preview (or any features within the Developer Preview) to you or to users generally at Google's sole discretion, without prior notice to you. - -3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Developer Preview. - -3.9 Your use of any Android system files, packaged APIs, or other components of the Developer Preview which are part of the Android Software Development Kit is subject to the terms of the Android Software Development Kit License Agreement located at http://developer.android.com/sdk/terms.html. These terms are hereby incorporated by reference into this License Agreement. - -4. Use of the Developer Preview by You - -4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the Developer Preview, including any intellectual property rights that subsist in those applications. - -4.2 You agree to use the Developer Preview and write applications only for purposes that are permitted by (a) this License Agreement, (b) the Google Play Developer Program Policies located at https://play.google.com/about/developer-content-policy.html, and hereby incorporated into this License Agreement by reference), and (c) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). You agree to use reasonable efforts to comply with the Android Wear Platform Design Guide available on the Android Wear developer website - -4.3 You agree that if you use the Developer Preview to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the Developer Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android Wear and/or applications for Android Wear, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. - -4.7 Unless otherwise specified in writing by Google, Google does not intend use of Android Wear to create obligations under the Health Insurance Portability and Accountability Act, as amended, (“HIPAA”), and makes no representations that Android Wear satisfies HIPAA requirements. If you are (or become) a Covered Entity or Business Associate under HIPAA, you agree not to use Android Wear for any purpose or in any manner involving Protected Health Information unless you have received prior written consent to such use from Google. - -4.8 The Developer Preview is in development, and your testing and feedback are an important part of the development process. By using the Developer Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Developer Preview, Android Wear devices, Android Wear system software, or Android Wear services having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Developer Preview as this Developer Preview will no longer be supported after the official SDK is released. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the Developer Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Developer Preview are being used and how they are being used. Before any of this information is collected, the Developer Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. - -6.2 The data collected is examined in the aggregate to improve the Developer Preview and is maintained in accordance with Google's Privacy Policy lcoated at http://www.google.com/policies/privacy/. - -7. Third Party Applications - -7.1 If you use the Developer Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. - -8. Using Google APIs - -8.1 Google APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -9. Terminating this License Agreement - -9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. - -9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the Developer Preview and any relevant developer credentials. - -9.3 Google may at any time, terminate this License Agreement with you if: -(A) you have breached any provision of this License Agreement; or -(B) Google is required to do so by law; or -(C) the partner with whom Google offered certain parts of Developer Preview (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the Developer Preview to you; or -(D) Google decides to no longer provide the Developer Preview or certain parts of the Developer Preview to users in the country in which you are resident or from which you use the service, or the provision of the Developer Preview or certain Developer Preview services to you by Google is, in Google's sole discretion, no longer commercially viable. - -9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. - -10. DISCLAIMER OF WARRANTIES - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE DEVELOPER PREVIEW IS AT YOUR SOLE RISK AND THAT THE DEVELOPER PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE DEVELOPER PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE DEVELOPER PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Developer Preview, (b) any application you develop on the Developer Preview that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the Developer Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Developer Preview is made available. - -14. General Legal Terms - -14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Developer Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Developer Preview. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. - -14.5 EXPORT RESTRICTIONS. THE DEVELOPER PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE DEVELOPER PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. - -14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. -</div> diff --git a/docs/html/wear/notifications/creating.jd b/docs/html/wear/notifications/creating.jd index ce9e117..a5d7da7 100644 --- a/docs/html/wear/notifications/creating.jd +++ b/docs/html/wear/notifications/creating.jd @@ -44,8 +44,8 @@ library</a> and the Developer Preview support library. So to get started, you should include the following imports in your project code:</p> <pre> -import android.preview.support.wearable.notifications.*; -import android.preview.support.v4.app.NotificationManagerCompat; +import android.support.wearable.notifications.*; +import android.support.wearable.app.NotificationManagerCompat; import android.support.v4.app.NotificationCompat; </pre> @@ -64,7 +64,7 @@ such as action buttons and large icons, while remaining compatible with Android <p>For example, here's some code that creates and issues a notification using the {@link android.support.v4.app.NotificationCompat} APIs combined with the new -<a href="{@docRoot}reference/android/preview/support/v4/app/NotificationManagerCompat.html"> +<a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html"> <code>NotificationManagerCompat</code></a> API:</p> @@ -206,54 +206,70 @@ Wear</a>.</p> you can add additional pages of content that users can view by swiping to the left, or add the ability for users to deliver your app a text response using voice input.</p> -<p>To use these new APIs, pass your instance of -{@link android.support.v4.app.NotificationCompat.Builder} to the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#WearableNotifications.Builder(android.content.Context)"> <code>WearableNotifications.Builder()</code></a> constructor. You can then add new -features to your notification using the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html" - ><code>WearableNotifications.Builder</code></a> methods. For example:</p> +<p>To use these new APIs:</p> + +<ol> + <li>Create an instance of +{@link android.support.v4.app.NotificationCompat.Builder}, setting the +desired properties for your notification.</li> + <li>Create a + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#WearableNotificationOptions.Builder(android.content.Context)"> <code>WearableNotificationOptions.Builder</code></a>, setting the wearable-specific options for the notication.</li> + <li>Call <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#WearableNotificationOptions.Builder#applyTo"><code>WearableNotificationOptions.Builder.applyTo()</code> + </a>, passing in the {@link android.support.v4.app.NotificationCompat.Builder}. This applies + the wearable options to the notification.</li> +</ol> + +<p> +For example, the following code calls the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setHintHideIcon(boolean)"> + <code>setHintHideIcon()</code></a> method to remove the app icon from the notification card. +</p> <pre> // Create a NotificationCompat.Builder for standard notification features -NotificationCompat.Builder notificationBuilder = - new NotificationCompat.Builder(mContext) - .setContentTitle("New mail from " + sender.toString()) - .setContentText(subject) - .setSmallIcon(R.drawable.new_mail); - -// Create a WearablesNotification.Builder to add special functionality for wearables -Notification notification = - new WearableNotifications.Builder(notificationBuilder) - .setHintHideIcon(true) - .build(); + NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext) + .setContentTitle("New mail from " + sender) + .setContentText(subject) + .setSmallIcon(R.drawable.new_mail); +// Create a WearablesNotificationOptions.Builder to add functionality for wearables + Notification notif = new WearableNotificationOptions.Builder() + <b>.setHintHideIcon(true)</b> + .build() + .applyTo(builder); //apply wearable options to to the original notification + .build() </pre> -<p>The <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#setBigActionIcon(int)"> - <code>setHintHideIcon()</code></a> method removes your app icon from the notification card. - This method is just one example of new notification features available from the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html" - ><code>WearableNotifications.Builder</code></a> class.</p> +<p>The + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setHintHideIcon(boolean)"> + <code>setHintHideIcon()</code></a> method is just one example of new notification features available with the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html" + ><code>WearableNotificationOptions.Builder</code></a> class. +</p> + -<p>When you want to deliver your notifications, be certain to always use the - <a href="{@docRoot}reference/android/preview/support/v4/app/NotificationManagerCompat.html"> - <code>NotificationManagerCompat</code></a> API:</p> +<p>When you want to deliver your notifications, always use the + <a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html"> + <code>NotificationManagerCompat</code></a> API instead of + {@link android.app.NotificationManager}:</p> <pre> // Get an instance of the NotificationManager service NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); -// Build the notification and issues it with notification manager. -notificationManager.notify(notificationId, notification); +// Issue the notification with notification manager. +notificationManager.notify(notificationId, notif); </pre> -<p>If you instead use the framework's {@link android.app.NotificationManager}, some -features from <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"><code>WearableNotifications.Builder</code></a> -will not work.</p> + +<p>If you use the framework's {@link android.app.NotificationManager}, some +features from <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"><code>WearableNotificationOptions.Builder</code></a> +do not work.</p> + <p>To continue enhancing your notifications for wearables using - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html" - ><code>WearableNotifications.Builder</code></a> and other APIs in the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html" + ><code>WearableNotificationOptions.Builder</code></a> and other APIs in the preview support library, see the following developer guides:</p> <dl> diff --git a/docs/html/wear/notifications/pages.jd b/docs/html/wear/notifications/pages.jd index 558f7b8..7d18b3f 100644 --- a/docs/html/wear/notifications/pages.jd +++ b/docs/html/wear/notifications/pages.jd @@ -15,14 +15,19 @@ multiple pages, see the <a href="{@docRoot}wear/design/index.html#NotificationPages">Design Principles of Android Wear</a>.</p> - -<p>When creating a notification with multiple pages, start by creating the main notification -(the first page) the way you'd like the notification to appear on a phone -or tablet. Then, add pages one at a time with the -<a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#addPage(android.app.Notification)"> +<p>To create a notification with multiple pages:</p> +<ol> + <li>Create the main notification (the first page) the way you'd like the notification to appear on a phone + or tablet.</li> + <li>Add pages one at a time with the +<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addPage(android.app.Notification)"> <code>addPage()</code></a> method, or add multiple pages in a {@link java.util.Collection} with the -<a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#addPages(java.util.Collection<android.app.Notification>)"> -<code>addPages()</code></a> method.</p> +<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addPages(java.util.Collection<android.app.Notification>)"> +<code>addPages()</code></a> method.</li> + <li>Apply the pages to the main notification with the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.html#applyTo(android.support.v4.app.NotificationCompat.Builder)" + ><code>applyTo()</code></a> method.</li> +</ol> <p>For example, here's some code that adds a second page to a notification:</p> @@ -47,15 +52,14 @@ Notification secondPageNotification = .setStyle(secondPageStyle) .build(); -// Create main notification and add the second page +// Add second page with wearable options and apply to main notification Notification twoPageNotification = - new WearableNotifications.Builder(notificationBuilder) + new WearableNotificationsOptions.Builder() .addPage(secondPageNotification) + .build() + .applyTo(notificationBuilder) .build(); </pre> - - - </body> </html> diff --git a/docs/html/wear/notifications/remote-input.jd b/docs/html/wear/notifications/remote-input.jd index 1668363..4db8274 100644 --- a/docs/html/wear/notifications/remote-input.jd +++ b/docs/html/wear/notifications/remote-input.jd @@ -25,16 +25,16 @@ you must type text replies into the voice input field, so be sure you have enabl <h2 id="RemoteInput">Define the Remote Input</h2> <p>To create an action that supports voice input, first create an instance of - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"> <code>RemoteInput</code></a> using the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> APIs. + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> APIs. The - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor takes a string that the system + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor takes a string that the system will use as a key for the {@link android.content.Intent} extra that carries the reply message to your app on the handheld.</p> <p>For example, here's how to create a new - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"> <code>RemoteInput</code></a> object that provides a custom label for the voice input prompt:</p> @@ -56,7 +56,7 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY) <p>In addition to allowing voice input, you can provide up to five text responses that the user can select for quick replies. Call - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.Builder.html#setChoices(java.lang.String[])"><code>setChoices()</code></a> and pass it a string array.</p> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html#setChoices(java.lang.String[])"><code>setChoices()</code></a> and pass it a string array.</p> <p>For example, you may define some responses in a resource array:</p> @@ -73,7 +73,7 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY) </pre> <p>Then, inflate the string array and add it to the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a>:</p> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a>:</p> <pre> String replyLabel = getResources().getString(R.string.reply_label); @@ -93,8 +93,8 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY) <p>If "Reply" is your notification's primary action (defined by the {@link android.support.v4.app.NotificationCompat.Builder#setContentIntent setContentIntent()} method), then you should attach the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the main action using - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#addRemoteInputForContentIntent(android.preview.support.wearable.notifications.RemoteInput)"> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the main action using + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addRemoteInputForContentIntent(android.support.wearable.notifications.RemoteInput)"> <code>addRemoteInputForContentIntent()</code></a>. For example:</p> <pre> @@ -116,18 +116,19 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY) .setLabel(replyLabel) .build(); -// Create wearable notification and add remote input +// Add remote input to wearable options and apply to notification Notification replyNotification = - new WearableNotifications.Builder(replyNotificationBuilder) + new WearableNotificationOptions.Builder() .addRemoteInputForContentIntent(remoteInput) + .build() + .applyTo(replyNotificationBuilder) .build(); </pre> - <p>By using - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#addRemoteInputForContentIntent(android.preview.support.wearable.notifications.RemoteInput)"> + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#addRemoteInputForContentIntent(android.support.wearable.notifications.RemoteInput)"> <code>addRemoteInputForContentIntent()</code></a> to add the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> object to the notification's primary action, + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> object to the notification's primary action, the button that normally appears as an "Open" action becomes the "Reply" action and starts the voice input UI when users select it on Android Wear.</p> @@ -137,14 +138,14 @@ and starts the voice input UI when users select it on Android Wear.</p> <p>If the "Reply" action is not your notification's primary action and you want to enable voice input for a secondary action, add the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to a new action button defined by an - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Action.html"> + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to a new action button defined by an + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html"> <code>Action</code></a> object.</p> <p>You should instantiate the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Action.html"> -<code>Action</code></a> with the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Action.Builder.html"><code>Action.Builder()</code></a> + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html"> +<code>WearableAction</code></a> with the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.Builder.html"><code>WearableAction.Builder()</code></a> constructor, which takes an icon and text label for the action button, plus the {@link android.app.PendingIntent} the system should use to invoke your app when the user selects the action. For example:</p> @@ -161,7 +162,7 @@ RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY) .build(); // Create the notification action -Action replyAction = new Action.Builder(R.drawable.ic_message, +WearableAction replyAction = new WearableAction.Builder(R.drawable.ic_message, "Reply", pendingIntent) .addRemoteInput(remoteInput) .build(); @@ -169,45 +170,72 @@ Action replyAction = new Action.Builder(R.drawable.ic_message, <p>After you add the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Action.html"> -<code>Action</code></a>, add the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Action.html"> -<code>Action</code></a> to the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html"><code>WearableNotifications.Builder</code></a> using - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#addAction(Action)"><code>addAction()</code></a>. + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html"><code>RemoteInput</code></a> to the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html"> +<code>Wearablection</code></a>, set the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableAction.html"> +<code>WearableAction</code></a> on the + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html"><code>WearableNotifications.Builder</code></a> using + <a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationsOptions.Builder.html#addAction(Action)"><code>addAction()</code></a>. For example:</p> <pre> // Create basic notification builder NotificationCompat.Builder replyNotificationBuilder = new NotificationCompat.Builder(this) - .setContentTitle("New message"); + .setContentTitle("New message"); // Create the notification action and add remote input -Action replyAction = new Action.Builder(R.drawable.ic_message, +WearableAction replyAction = new WearableAction.Builder(R.drawable.ic_message, "Reply", pendingIntent) .addRemoteInput(remoteInput) .build(); // Create wearable notification and add action Notification replyNotification = - new WearableNotifications.Builder(replyNotificationBuilder) - .addAction(replyAction) - .build(); + new WearableNotificationOptions.Builder() + .addAction(replyAction) + .build() + .applyTo(replyNotificationBuilder) + .build(); </pre> + <p>Now, when the user selects "Reply" from an Android wearable, the system prompts the user for voice input (and shows the list of pre-defined replies, if provided). Once the user completes a response, the system invokes the {@link android.content.Intent} attached to the action and adds the <code>EXTRA_VOICE_REPLY</code> extra (the string you passed to the - <a href="{@docRoot}reference/android/preview/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor) - with the user's message as the string value.</p> - - - + <a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.Builder.html"><code>RemoteInput.Builder</code></a> constructor) + with the user's message as the string value.</p> + +<h2 id="ObtainInput">Obtaining the Voice Input as a String</h2> +<p>To obtain the user's voice input, call +<a href="{@docRoot}reference/android/support/wearable/notifications/RemoteInput.html#getResultsFromIntent(Intent)"><code>getResultsFromIntent()</code></a>, +passing in the "Reply" action's intent. This method returns +a {@link android.os.Bundle} that represents the intent's extras. You can then query the +{@link android.os.Bundle} to obtain the user's voice input string. +</p> +<p> +The following code shows a method that accepts an intent and returns the voice input string, +which is referenced by the <code>EXTRA_VOICE_REPLY</code> key that is used in the previous examples: +</p> +<pre> +/** + * Obtain the intent that started this activity by calling + * Activity.getIntent() and pass it into this method to + * get the associated voice input string. + */ +private String getMessageText(Intent intent) { + Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); + if (remoteInput != null) { + return remoteInput.getString(Intent.EXTRA_VOICE_REPLY); + } + } + return null; +} +</pre> </body> </html> diff --git a/docs/html/wear/notifications/stacks.jd b/docs/html/wear/notifications/stacks.jd index a2d34ce..3c3dc09 100644 --- a/docs/html/wear/notifications/stacks.jd +++ b/docs/html/wear/notifications/stacks.jd @@ -16,7 +16,7 @@ are not able to read details from each message on the wearable (they must open y handheld to view more information). So for the wearable device, you should group all the notifications together in a stack. The stack of notifications appears as a single card, which users can expand to view the details from each notification separately. The new -<a href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#setGroup(java.lang.String, int)"> +<a href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)"> <code>setGroup()</code></a> method makes this possible while allowing you to still provide only one summary notification on the handheld device.</p> @@ -28,21 +28,24 @@ Wear</a>.</p> <h2 id="AddGroup">Add Each Notification to a Group</h2> <p>To create a stack, call <a -href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#setGroup(java.lang.String, int)"> +href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)"> <code>setGroup()</code></a> for each notification you want in the stack and specify a -group key. Then call <a href="{@docRoot}reference/android/preview/support/v4/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a> to send it to the wearable.</p> +group key. Then call <a href="{@docRoot}reference/android/support/wearable/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a> to send it to the wearable.</p> <pre style="clear:right"> final static String GROUP_KEY_EMAILS = "group_key_emails"; -// Build the notification and pass this builder to WearableNotifications.Builder +// Build the notification NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext) .setContentTitle("New mail from " + sender1) .setContentText(subject1) .setSmallIcon(R.drawable.new_mail); -Notification notif1 = new WearableNotifications.Builder(builder) +// Set the group with WearableNotificationOptions.Builder and apply to the notification +Notification notif1 = new WearableNotificationOptions.Builder() .setGroup(GROUP_KEY_EMAILS) + .build() + .applyTo(builder) .build(); // Issue the notification @@ -52,8 +55,10 @@ notificationManager.notify(notificationId1, notif); </pre> <p>Later on, when you create another notification, specify -the same group key. When you call <a href="{@docRoot}reference/android/preview/support/v4/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a>, this notification appears -in the same stack as the previous notification, instead of as a new card:</p> +the same group key. When you call +<a href="{@docRoot}reference/android/support/v4/app/NotificationManagerCompat.html#notify(int, android.app.Notification)"><code>notify()</code></a>, +this notification appears in the same stack as the previous notification, +instead of as a new card:</p> <pre style="clear:right"> builder = new NotificationCompat.Builder(mContext) @@ -62,8 +67,10 @@ builder = new NotificationCompat.Builder(mContext) .setSmallIcon(R.drawable.new_mail); // Use the same group as the previous notification -Notification notif2 = new WearableNotifications.Builder(builder) +Notification notif2 = new WearableNotificationOptions.Builder() .setGroup(GROUP_KEY_EMAILS) + .build() + .applyTo(builder) .build(); notificationManager.notify(notificationId2, notif); @@ -72,7 +79,7 @@ notificationManager.notify(notificationId2, notif); <p>By default, notifications appear in the order in which you added them, with the most recent notification visible at the top. You can define a specific position in the group by passing an order position as the second parameter for <a -href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.Builder.html#setGroup(java.lang.String, int)"> +href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationOptions.Builder.html#setGroup(java.lang.String, int)"> <code>setGroup()</code></a>.</p> @@ -83,7 +90,7 @@ href="{@docRoot}reference/android/preview/support/wearable/notifications/Wearabl <p>It's important that you still provide a summary notification that appears on handheld devices. So in addition to adding each unique notification to the same stack group, also add a summary notification, but set its order position to be <a -href="{@docRoot}reference/android/preview/support/wearable/notifications/WearableNotifications.html#GROUP_ORDER_SUMMARY"><code>GROUP_ORDER_SUMMARY</code></a>.</p> +href="{@docRoot}reference/android/support/wearable/notifications/WearableNotificationsOptions.html#GROUP_ORDER_SUMMARY"><code>GROUP_ORDER_SUMMARY</code></a>.</p> <p>This notification does not appear in your stack of notifications on the wearable, but appears as the only notification on the handheld device.</p> @@ -92,23 +99,22 @@ appears as the only notification on the handheld device.</p> Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_large_icon); +// Create an InboxStyle notification builder = new NotificationCompat.Builder(this) + .setContentTitle("2 new messages") .setSmallIcon(R.drawable.ic_small_icon) - .setLargeIcon(largeIcon); - -// Use the same group key and pass this builder to InboxStyle notification -WearableNotifications.Builder wearableBuilder = new WearableNotifications - .Builder(builder) - .setGroup(GROUP_KEY_EMAILS, - WearableNotifications.GROUP_ORDER_SUMMARY); - -// Build the final notification to show on the handset -Notification summaryNotification = new NotificationCompat.InboxStyle( - wearableBuilder.getCompatBuilder()) - .addLine("Alex Faaborg Check this out") - .addLine("Jeff Chang Launch Party") - .setBigContentTitle("2 new messages") - .setSummaryText("johndoe@gmail.com") + .setLargeIcon(largeIcon) + .setStyle(new NotificationCompat.InboxStyle() + .addLine("Alex Faaborg Check this out") + .addLine("Jeff Chang Launch Party") + .setBigContentTitle("2 new messages") + .setSummaryText("johndoe@gmail.com")); + +// Specify the notification to be the group summary +Notification summaryNotification = new WearableNotificationOptions.Builder() + .setGroupSummary(GROUP_KEY_EMAILS) + .build() + .applyTo(builder) .build(); notificationManager.notify(notificationId3, summaryNotification); diff --git a/docs/html/wear/preview/signup.jd b/docs/html/wear/preview/signup.jd deleted file mode 100644 index 8e8ec9a..0000000 --- a/docs/html/wear/preview/signup.jd +++ /dev/null @@ -1,169 +0,0 @@ -page.title=Sign Up for the Developer Preview - -@jd:body - -<p>To get started with the Android Wear Developer Preview, you must agree to the - following terms and conditions and provide the email address for your Google account. -After signing up, you’ll have access to:</p> -<ul> - <li>New APIs that allow you to build enhanced notifications for wearables.</li> - <li>Sample code using the new APIs.</li> - <li>The Android Wear Preview app that delivers your notifications to the Android Wear emulator.</li> -</ul> - -<div class="sdk-terms" style="width:678px" onfocus="this.blur()"><div class="sdk-terms-padding"> -This is the Android Wear Developer Preview License Agreement. - -1. Introduction - -1.1 The Android Wear Developer Preview Kit (referred to in this License Agreement as the “Developer Preview” and specifically including the Android system files, packaged APIs, Developer Preview library files, and the Developer Preview companion app, if and when they are made available) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the Developer Preview. - -1.2 "Android Wear" means the Android Wear devices and the Android Wear software stack for use on Android Wear devices. - -1.3 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. - -1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting this License Agreement - -2.1 In order to use the Developer Preview, you must first agree to this License Agreement. You may not use the Developer Preview if you do not accept this License Agreement. - -2.2 By clicking to accept, you hereby agree to the terms of this License Agreement. - -2.3 You may not use the Developer Preview and may not accept the License Agreement if you are a person barred from receiving the Developer Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Developer Preview. - -2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Developer Preview on behalf of your employer or other entity. - -3. Developer Preview License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, internal-use, non-assignable and non-exclusive license to use the Developer Preview solely to develop applications to run on the Android Wear platform for Android Wear devices. - -3.2 You agree that Google or third parties own all legal right, title and interest in and to the Developer Preview, including any Intellectual Property Rights that subsist in the Developer Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.3 You may not use the Developer Preview for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Developer Preview or any part of the Developer Preview; or (b) load any part of the Developer Preview onto a mobile handset or wearable computing device or any other hardware device except an Android Wear device, combine any part of the Developer Preview with other software, or distribute any software or device incorporating a part of the Developer Preview. - -3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android Wear, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the Developer Preview. - -3.5 Use, reproduction and distribution of components of the Developer Preview licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. - -3.6 You agree that the form and nature of the Developer Preview that Google provides may change without prior notice to you and that future versions of the Developer Preview may be incompatible with applications developed on previous versions of the Developer Preview. You agree that Google may stop (permanently or temporarily) providing the Developer Preview (or any features within the Developer Preview) to you or to users generally at Google's sole discretion, without prior notice to you. - -3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Developer Preview. - -3.9 Your use of any Android system files, packaged APIs, or other components of the Developer Preview which are part of the Android Software Development Kit is subject to the terms of the Android Software Development Kit License Agreement located at http://developer.android.com/sdk/terms.html. These terms are hereby incorporated by reference into this License Agreement. - -4. Use of the Developer Preview by You - -4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the Developer Preview, including any intellectual property rights that subsist in those applications. - -4.2 You agree to use the Developer Preview and write applications only for purposes that are permitted by (a) this License Agreement, (b) the Google Play Developer Program Policies located at https://play.google.com/about/developer-content-policy.html, and hereby incorporated into this License Agreement by reference), and (c) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). You agree to use reasonable efforts to comply with the Android Wear Platform Design Guide available on the Android Wear developer website - -4.3 You agree that if you use the Developer Preview to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the Developer Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android Wear and/or applications for Android Wear, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. - -4.7 Unless otherwise specified in writing by Google, Google does not intend use of Android Wear to create obligations under the Health Insurance Portability and Accountability Act, as amended, (“HIPAA”), and makes no representations that Android Wear satisfies HIPAA requirements. If you are (or become) a Covered Entity or Business Associate under HIPAA, you agree not to use Android Wear for any purpose or in any manner involving Protected Health Information unless you have received prior written consent to such use from Google. - -4.8 The Developer Preview is in development, and your testing and feedback are an important part of the development process. By using the Developer Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Developer Preview, Android Wear devices, Android Wear system software, or Android Wear services having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Developer Preview as this Developer Preview will no longer be supported after the official SDK is released. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the Developer Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Developer Preview are being used and how they are being used. Before any of this information is collected, the Developer Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. - -6.2 The data collected is examined in the aggregate to improve the Developer Preview and is maintained in accordance with Google's Privacy Policy lcoated at http://www.google.com/policies/privacy/. - -7. Third Party Applications - -7.1 If you use the Developer Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. - -8. Using Google APIs - -8.1 Google APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. - -9. Terminating this License Agreement - -9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. - -9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the Developer Preview and any relevant developer credentials. - -9.3 Google may at any time, terminate this License Agreement with you if: -(A) you have breached any provision of this License Agreement; or -(B) Google is required to do so by law; or -(C) the partner with whom Google offered certain parts of Developer Preview (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the Developer Preview to you; or -(D) Google decides to no longer provide the Developer Preview or certain parts of the Developer Preview to users in the country in which you are resident or from which you use the service, or the provision of the Developer Preview or certain Developer Preview services to you by Google is, in Google's sole discretion, no longer commercially viable. - -9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. - -10. DISCLAIMER OF WARRANTIES - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE DEVELOPER PREVIEW IS AT YOUR SOLE RISK AND THAT THE DEVELOPER PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE DEVELOPER PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE DEVELOPER PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Developer Preview, (b) any application you develop on the Developer Preview that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the Developer Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Developer Preview is made available. - -14. General Legal Terms - -14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Developer Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Developer Preview. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. - -14.5 EXPORT RESTRICTIONS. THE DEVELOPER PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE DEVELOPER PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. - -14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. - - -</div></div> - - -<p class="caution"> - <strong>Important:</strong> Your email address is used to provide your Google account - access to the Android Wear Preview app Beta Preview on Google Play Store. As such, the - email address you provide below must be for the account you use to download apps on Google Play Store. - We may also use your email address to provide you with updates about the Android Wear - platform release. -</p> - -<iframe src="https://docs.google.com/forms/d/1iSJ084kEkV242cZisNMnj6G8qpi9r_zdEyfXA-hB1ao/viewform?embedded=true" width="100%" height="540" frameborder="0" marginheight="0" marginwidth="0" id="signupform">Loading...</iframe> - - - - -</body> -</html> diff --git a/docs/html/wear/preview/start.jd b/docs/html/wear/preview/start.jd deleted file mode 100644 index f8f0129..0000000 --- a/docs/html/wear/preview/start.jd +++ /dev/null @@ -1,254 +0,0 @@ -page.title=Get Started with the Developer Preview - -@jd:body - - -<div class="cols"> - - <div class="col-5"> -<p>The Android Wear Developer Preview includes tools and APIs that allow you to -enhance your app notifications -to provide an optimized user experience on Android wearables.</p> - -<p>With the Android Wear Developer Preview, you can:</p> - -<ul> - <li>Run the Android Wear platform in the Android emulator.</li> - <li>Connect your Android device to the emulator and view notifications from the -device as cards on Android Wear.</li> - <li>Try new APIs in the preview support library that enhance your app's notifications -with features such as voice replies and notification pages.</li> -</ul> - -<p>To get access to the Developer Preview tools, -click the sign up button on the right, then follow the setup instructions below.</p> - </div> - - <div class="col-7"> -<img src="/wear/images/laptop-bridge.png" width="400" height="222" alt="" /> - -<a href="/wear/preview/signup.html" class="button" style=" - width: 370px; - margin: 10px 0 20px; - font-weight: bold; - font-size: 16px; -">Sign Up for the Developer Preview</a> - -<p>Signing up provides you access to:</p> -<ul> -<li>New notification APIs in the preview support library.</li> -<li>Sample apps using the new notification APIs.</li> -<li>The <em>Android Wear Preview</em> app for your mobile device, which connects -your device to the Android Wear emulator.</li> -</ul> - - </div> -</div> - - -<p class="caution"><strong>Caution:</strong> -The current Android Wear Developer Preview is intended for <b>development and testing purposes only</b>, not for production apps. Google may change this Developer Preview significantly prior to the official release of the Android Wear SDK. You may not publicly distribute or ship any application using this Developer Preview, as this Developer Preview will no longer be supported after the official SDK is released (which will cause applications based only on the Developer Preview to break).</p> - - - - -<h2 id="Prereq">Prerequisites</h2> - -<p>Before you begin the setup, you must:</p> - -<ol> - <li><a href="{@docRoot}sdk/index.html"><b>Install the Android SDK</b></a>. - <p>The Android SDK includes all the developer tools required to build -apps for Android (optional IDEs are also available for download).</p></li> - <li><a href="{@docRoot}wear/preview/signup.html"><b>Sign up for the Android Wear Developer Preview</b></a>. - <p>You must sign up with a Gmail or other Google account in order to download the -preview support library and receive access to the -<em>Android Wear Preview</em> beta app on Google Play Store.</p></li> -</ol> - -<p class="note"><strong>Note:</strong> -If you're using the ADT plugin for Eclipse, you must update to version 22.6.1 or higher. -If you're using Android Studio, you must update to version 0.5.1 or higher</p> - - - -<h2 id="Install">1. Install the Android Wear System Image</h2> - - -<ol> - <li>Launch <a href="{@docRoot}tools/help/sdk-manager.html" - >Android SDK Manager</a>. - <ul> - <li>From Eclipse, select <b>Window > Android SDK Manager</b>.</li> - <li>From Android Studio, select <b>Tools > Android > SDK Manager</b>.</li> - </ul> - </li> - <li>Below Tools, verify that you have Android SDK Tools revision 22.6 or higher. - <p>If your version of Android SDK Tools is lower than 22.6, you must update:</p> - <ol> - <li>Select <strong>Android SDK Tools</strong>.</li> - <li>Click <strong>Install package</strong>.</li> - <li>Accept the license and click <strong>Install</strong>.</li> - <li>When the installation completes, restart Android SDK Manager.</li> - </ol> - </li> - - <li>Below Android 4.4.2, select <strong>Android Wear ARM EABI v7a System Image</strong>. -<p class="note"><strong>Note:</strong> Android Wear is designed to support multiple processor architectures. -</p></li> - <li>Below Extras, ensure that you have the latest version of the -<a href="{@docRoot}tools/support-library/index.html">Android Support Library</a>. - If an update is available, select <strong>Android Support Library</strong>. If you're using Android Studio, also select <strong>Android Support Repository</strong>.</li> - <li>Click <strong>Install packages</strong>.</li> - <li>Accept the license and click <strong>Install</strong>.</li> -</ol> - - - -<h2 id="SetupEmulator">2. Set Up the Android Wear Emulator</h2> - -<ol> -<li>Launch the <a href="{@docRoot}tools/help/avd-manager.html" - >Android Virtual Device Manager</a>. -<ul> -<li>From Eclipse, select <b>Window > Android Virtual Device Manager</b>.</li> -<li>From Android Studio, select <b>Tools > Android > AVD Manager</b>.</li> -</ul> -</li> -<li>Click <strong>New</strong>.</li> -<li>For the AVD Name, enter "AndroidWearSquare" or "AndroidWearRound", depending on whether -you want to create an emulator with a square or round display.</li> -<li>For the Device, select <strong>Android Wear Square</strong> or - <strong>Android Wear Round</strong>.</li> -<li>For the Target, select <strong>Android 4.4.2 - API Level 19</strong> (or higher).</li> -<li>For the CPU/ABI, select <strong>Android Wear ARM (armeabi-v7a)</strong>. -<p class="note"><strong>Note:</strong> Android Wear is designed to support multiple processor architectures. -</p></li> -<li>For the Skin, select <strong>AndroidWearSquare</strong> or -<strong>AndroidWearRound</strong>.</li> -<li>Leave all other options set to their defaults and click <strong>OK</strong>. - <p>Although real Android wearables do not provide a keyboard as an input method, - you should keep <strong>Hardware keyboard present</strong> selected so you can - provide text input on screens where users will instead provide voice input.</p> -</li> -<!-- -<li>Click <strong>Device Definitions</strong>.</li> -<li>Select <strong>Android WearSquare</strong> then click <strong>Create AVD</strong>.</li> -<li>Click <strong>OK</strong>.</li> ---> -<li>In the list of AVDs, select the one you just created and click - <strong>Start</strong>. In the following window, click <strong>Launch</strong>.</li> -</ol> - -<p>The Android Wear emulator now starts. To begin testing your app's notifications, -you must now pair the emulator to your development device -that has the <em>Android Wear Preview</em> app installed.</p> - -<p class="note"><strong>Tip:</strong> To improve the emulator startup time, edit your AVD -and enable <strong>Snapshot</strong> under Emulator Options. When you start the emulator, -select <strong>Save to snapshot</strong> then click <strong>Launch</strong>. Once the emulator -is running, close it to save a snapshot of the system. -Start the AVD again, but select <strong>Launch from snapshot</strong> and -deselect <strong>Save to snapshot</strong>.</p> - -<p class="caution"><strong>Caution:</strong> Do not install apps on the Android Wear emulator. -The system does not support traditional Android apps and the result of running such apps is -unpredictable.</p> - - - -<h2 id="SetupApp">3. Set Up the Android Wear Preview App</h2> - -<p>To view your app's notifications on the Android Wear emulator, you must have the -<em>Android Wear Preview</em> app installed on your Android device (a phone or tablet).</p> - -<p>To receive the Android Wear Preview app, you must <a -href="{@docRoot}wear/preview/signup.html">sign up for the Developer Preview</a> using the same -Gmail or Google account you use with Google Play Store.</p> -</p> - -<p class="note"><strong>Note:</strong> The <em>Android Wear Preview</em> app is compatible with - Android 4.3 and higher and is not available for the Android emulator.</p> - -<p>After you've signed up for the Developer Preview, - you'll receive a confirmation email that includes a link to opt-in to the - <em>Android Wear Preview</em> app beta program. Once you opt-in, it may take up to 24 hours for the - app to become available in Google Play Store.</p> - -<p>After you install the <em>Android Wear Preview</em> app, you can set up - your device to communicate with the Android Wear emulator:</p> - -<ol> -<li>Open the <em>Android Wear Preview</em> app. You should see a notice that the app is currently - not enabled as a notification listener. Tap the message to open the system settings, - then select Android Wear Preview to grant it notification access.</li> -<li>Connect your device to your development machine over USB. Be sure that no other - Android devices are connected to the machine.</li> -<li>Ensure that the Android Wear emulator (created in the previous section) is running. -The emulator should show the time and an icon that indicates no device is connected.</li> -<li>Open a command line terminal, navigate to your Android SDK's <code>platform-tools/</code> -directory, then execute: -<pre style="margin-top:.5em">adb -d forward tcp:5601 tcp:5601</pre> -<p class="note"><strong>Note:</strong> You must execute this command each time you connect your -device over USB.</p> -</li> -<li>Return to the Android Wear Preview app. It should now indicate that it is connected to - the emulator. The Android Wear emulator should now show the 'g' orb icon, indicating - that is is connected to your device. -</ol> - -<p>Now, notifications from your device also appear in the Android Wear emulator.</p> - - - - -<h2 id="AddLibrary">4. Add the Support Library to Your Project</h2> - -<p>The Android Wear preview support library includes several APIs that allow you to -optimize your app's notifications for the Android Wear user experience.</p> - -<p>To receive the preview support library, you must <a -href="{@docRoot}wear/preview/signup.html">sign up for the Developer Preview</a>. The -confirmation email you receive after you sign up includes a link to download a ZIP file, -which contains the preview support library and some sample apps.</p> - -<p>After you download and unzip the package, add the preview support library -sto your Android project:</p> - -<p><b>If you're using Eclipse:</b></p> - <ol> - <li>In your Android app project, create a <code>libs/</code> directory in your project root - (the same location as the <code>AndroidManifest.xml</code> file).</li> - <li>Copy the v4 support library JAR file from your Android SDK directory (e.g., - <code><sdk>/extras/android/support/v4/android-support-v4.jar</code>) into your - project <code>libs/</code> directory. - <li>Also save the <code>wearable-preview-support.jar</code> file in the <code>libs/</code> directory. - <li>Right click each JAR file and select <strong>Build Path > Add to Build Path</strong>.</li> - </ol> - - <p><b>If you're using Android Studio:</b></p> - <ol> - <li>In your Android app project, create a <code>libs/</code> directory in your project root - (the same location as the <code>AndroidManifest.xml</code> file).</li> - <li>Save the <code>wearable-preview-support.jar</code> file in the <code>libs/</code> directory. - <li>Open the <code>build.gradle</code> file in your app module.</li> - <li>Add a dependency rule for both the v4 support library and the Android Wear - preview support library: -<pre> -dependencies { - compile "com.android.support:support-v4:18.0.+" - compile files('../libs/wearable-preview-support.jar') -} -</pre> - </li> - <li>Click <strong>Sync Project with Gradle Files</strong> in the toolbar.</li> - </ol> - -<p>To start optimizing your notifications for Android Wear, - read <a href="{@docRoot}wear/notifications/creating.html" - >Creating Notifications for Android Wear</a>.</p> - - - -</body> -</html> |
