Home | History | Annotate | Download | only in develop
      1 fullpage=true
      2 page.title=Develop
      3 header.hide=1
      4 carousel=1
      5 tabbedList=1
      6 @jd:body
      7 
      8 <style>
      9 #noplayer-message {
     10 position:absolute;top:50%;left:0;width:100%;z-index:-1;text-align:center;display:none;
     11 }
     12 #player-frame object {z-index:1;}
     13 </style>
     14 
     15 <div id="player-wrapper">
     16   <div id="player-frame">
     17     <div id="noplayer-message">
     18       <!-- busted flash player message -->
     19       Your video is supposed to appear here.<br/>
     20       Make sure you have the <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash&reg; Player</a>.
     21     </div>
     22     <div id="player"><!-- Youtube embeds here... actually replaces this div --></div>
     23     <a class="close" onclick="$('#player-wrapper').hide()">close video</a>
     24   </div>
     25 </div>
     26 <div class="wrap">
     27    <!-- Slideshow -->
     28    <div class="slideshow-container slideshow-develop col-16">
     29        <a href="" class="slideshow-prev">Prev</a>
     30        <a href="" class="slideshow-next">Next</a>
     31        <div class="frame">
     32            <ul>
     33 
     34               <li class="item carousel-home">
     35                  <div class="col-8">
     36                    <img
     37 src="//lh4.ggpht.com/-lfjzgG5Dqrk/UHMThRtpRwI/AAAAAAAABpk/h4d3nsmkgPM/s400/mint.png"
     38 class="play no-shadow no-transform" />
     39                  </div>
     40                 <div class="content-right col-6">
     41                   <h2>Building Great Apps for Tablets</h2>
     42                   <p>Tablets are a fast-growing part of the Android installed base and they offer new opportunities for user engagement and monetization. If you are targeting tablets, check out this list of tips and techniques on how to deliver a great app experience for tablet users.  </p>
     43                   <p><a
     44 href="//android-developers.blogspot.com/2012/11/designing-for-tablets-were-here-to-help.html" class="button">Read
     45 more</a></p>
     46                 </div>            
     47               </li>
     48               <li class="item carousel-home">
     49                  <div class="col-8">
     50                    <img src="{@docRoot}images/google/gps-location.png"
     51 class="play no-shadow no-transform" style="margin:0 0 0 70px;height:230px;width:340px" />
     52                  </div>
     53                 <div class="content-right col-6" style="width:350px">
     54                   <h2>New Location APIs from Google</h2>
     55                   <p>The latest version of Google Play services includes new APIs that provide more
     56                   efficient and immediate user location data on devices running Android 2.2
     57                   and higher. Features include geofencing APIs, user activity recognition, and
     58                   power-efficient location updates.</p>
     59                   <p><a
     60 href="{@docRoot}google/play-services/location.html" class="button">Read more</a></p>
     61                 </div>
     62               </li>
     63 
     64               <li class="item carousel-home">
     65                  <div class="col-8">
     66                    <img src="{@docRoot}images/google/gps-plus-signin-hero.jpg"
     67 class="play no-shadow no-transform" style="margin:0 0 0 40px;max-height:250px;height:250px;
     68                                            max-width:409px;width:409px" />
     69                  </div>
     70                 <div class="content-right col-6" style="width:350px">
     71                   <h2>New Cross-Platform Single Sign On</h2>
     72                   <p>Google+ Sign-In is an easy, trusted way to sign a user into your app.
     73                   Now it's even more seamless. A user can sign in to your app on one device and
     74                   pick it up on another&mdash;without signing in again. Best of all, it's built
     75                   into Google+ Sign-in, so there's no change needed in your app.</p>
     76                   <p><a
     77 href="{@docRoot}google/play-services/plus.html" class="button">Read more</a></p>
     78                 </div>
     79               </li>
     80 
     81               <li class="item carousel-home">
     82                  <div class="col-8">
     83                    <img src="{@docRoot}images/google/maps-v2-trulia-n7.png"
     84 class="play no-shadow no-transform" style="margin:0 0 0 40px;max-height:250px;height:250px;
     85                                            max-width:409px;width:409px" />
     86                  </div>
     87                 <div class="content-right col-6" style="width:350px">
     88                   <h2>New Google Maps Android APIs!</h2>
     89                   <p>Google Maps Android API version 2 is now available with enhanced
     90                     features such as 3D buildings, vector-based map tiles, rich overlay capabilities,
     91                     indoor maps, support for fragments, and much more.</p>
     92                     
     93                   <p>The APIs are bundled with Google Play services and are
     94                   compatible with Android 2.2 and higher.</p>
     95                   <p><a
     96 href="{@docRoot}google/play-services/maps.html" class="button">Read more</a></p>
     97                 </div>            
     98               </li>
     99                <li class="item carousel-home">
    100                    <div class="col-8">
    101                      <img
    102 src="//lh4.ggpht.com/-6K1kfNOdek8/T72bXvtTSQI/AAAAAAAABmw/kYzmJt0_328/s1600/google-play-subscriptions.png" class="play"></div>
    103                    <div class="content-right col-6">
    104                    <h2>In-app Subscriptions with Trials</h2>
    105                    <p>You can now set up a <strong>free trial period</strong> for any Google Play in-app subscription, making it easy for users try your subscriber content before automatically converting to a full subscription. Free trials give you a new way to bring users into your products and engage them effectively. </p>
    106                    <p><a class="button"
    107 href="{@docRoot}google/play/billing/v2/billing_subscriptions.html#trials">Read
    108 more</a></p>
    109                    </div>                
    110                 </li>
    111            </ul>
    112        </div>
    113    </div>
    114    <!-- /End slideshow -->
    115 </div>
    116 <div class="wrap">
    117 	<!-- news and feature feed -->
    118 	<div class="feed col-8" style="margin-left:0">
    119 		<ul class="feed-nav">
    120 			<li class="active">DEVELOPER NEWS</li>
    121 			<li>FEATURED DOCS</li>
    122 		</ul>
    123 		<div class="feed-container">
    124 			<div class="feed-frame">
    125                                 <!-- DEVELOPER NEWS -->
    126           <ul>
    127             <li><a href="//android-developers.blogspot.com/2013/07/making-beautiful-android-app-icons.html">
    128               <div class="feed-image" style="background:url('//2.bp.blogspot.com/-HfoO6KNFBKA/UeiyRoELb7I/AAAAAAAAAFs/bHR-5viktU4/s1000/icons.png') no-repeat 0 0;background-size:500px;background-position:center center;"></div>
    129               <h4>Making Beautiful Android App Icons</h4>
    130               <p>As higher density screens gain popularity, it's important to make sure your launcher icon is crisp and high quality...</p>
    131               </a></li>
    132             <li><a href="//android-developers.blogspot.com/2013/07/beautiful-design-collection-summer-2013.html">
    133               <div class="feed-image" style="background:url('//1.bp.blogspot.com/-k8DZYu0daT4/UdRt1AzstvI/AAAAAAAAAFM/CvEkb2yh-i0/s965/beautifulapps_4.png') no-repeat 0 0"></div>
    134               <h4>The Beautiful Design Summer 2013 Collection</h4>
    135               <p>See the apps chosen by the Android Design team for their masterfully crafted design details...</p>
    136               </a></li>
    137             <li><a href="//android-developers.blogspot.com/2013/06/google-play-developer-8-step-checkup.html">
    138               <div class="feed-image" style="background:url('//4.bp.blogspot.com/-LeK74UYY1eM/UbD8L-2DpFI/AAAAAAAACZA/YMjwndr-ZgM/s400/DoctorDroidV2.png') no-repeat 0 0;background-size:130px;background-position:8px -4px;"></div>
    139               <h4>Google Play Developer 8-Step Checkup</h4>
    140               <p>Give your Google Play developer account this quick checkup to keep it in good order and help you deliver a more successful product to users...</p>
    141             </a></li>
    142             <li><a href="//android-developers.blogspot.com/2013/05/new-ways-to-optimize-your-business-in.html">
    143               <div class="feed-image" style="background:url('//4.bp.blogspot.com/-VmHMT66JjxU/UZZdfPUaJsI/AAAAAAAACQc/kDx5-Ep5YRo/s1600/framed_designed-tablets.png') no-repeat 0 0;background-size:180px"></div>
    144               <h4>New Ways to Optimize Your Business in Google Play</h4>
    145               <p>Many of you have invested in making great tablet experiences for your users, and we want to ensure that that work pays off...</p>
    146               </a></li>
    147           </ul>
    148                                 <!-- FEATURED DOCS -->
    149           <ul>
    150             <li><a href="{@docRoot}distribute/googleplay/spotlight/tablets.html">
    151               <h4>Tablet Stories</h4>
    152               <p>More developers are investing in a full tablet experience for their apps. Here are some stories from developers who are seeing real results as they expand their offering to include Android tablets. </p>
    153               </a></li>
    154             <li><a href="{@docRoot}distribute/googleplay/quality/core.html">
    155               <h4>Core App Quality Guidelines</h4>
    156               <p>This document helps you assess basic aspects of quality in your app through a compact set of core app quality criteria and associated tests. All Android apps should meet these criteria.</p>
    157               </a></li>
    158             <li><a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">
    159               <h4>Updated Notifications API Guide</h4>
    160               <p>The Notifications API Guide is updated to include information about building Jelly Bean rich notifications using the Support Library APIs for backwards-compatibility.</p>
    161               </a></li>
    162             <li><a href="{@docRoot}guide/topics/ui/dialogs.html">
    163               <h4>Updated Dialogs API Guide</h4>
    164               <p>The Dialogs API Guide now shows to use DialogFragment class, a simpler way to manage your dialogs and embed them in alternative layouts.</p>
    165               </a></li>                                      
    166           </ul>
    167 			</div>
    168 		</div>
    169 	</div>	<!-- /news and feature feed -->
    170 	<!-- video feed -->
    171 	<div class="feed col-8" style="margin-right:0">
    172 		<ul class="feed-nav">
    173 			<li class="active">DEVELOPERS LIVE</li>
    174 			<li>VIDEO PLAYLISTS</li>
    175 		</ul>
    176 		<div class="feed-container">
    177 			<div class="feed-frame">
    178               <ul id="DevelopersLive">
    179               </ul>
    180               <ul id="VideoPlaylists">
    181               </ul>
    182 			</div>
    183 		</div>
    184 	</div>
    185 	<!-- /video feed -->
    186 </div>
    187 
    188 <br class="clearfix"/>
    189 
    190       
    191       
    192       
    193       
    194       
    195       
    196       
    197       
    198 
    199 <script src="//swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js" type="text/javascript"></script>
    200 <script type="text/javascript">
    201 
    202 /* Load a video into the player box.
    203  * @param id        The YouTube video ID
    204  * @param title     The video title to display in the player box (character escaped)
    205  * @param autoplay  Whether to automatically play the video
    206  */
    207 function loadVideo(id, title, autoplay) {
    208   swfobject.embedSWF('//www.youtube.com/v/' + id + '&rel=1&border=0&fs=1&autoplay=' +
    209       (autoplay?1:0), 'player', '525', '330', '9.0.0', false, false, {allowfullscreen: 'true'});
    210   $("#videoPlayerTitle").html("<h2>" + unescape(title) + "</h2>");
    211   $("#player-wrapper").show();
    212   setTimeout(function(){$('#noplayer-message').show()}, 2000);
    213 }
    214 
    215 /* Draw all videos from a playlist into a 'videoPreviews' list
    216  * @param data  The feed data returned from the youtube request
    217  */
    218 function renderVideoPlaylists(data) {
    219   var MAX_LIST_DESC_LENGTH = 130; // the length at which we will trim the description
    220   var MAX_VIDEO_DESC_LENGTH = 100; // the length at which we will trim the description
    221   var MAX_LIST_LENGTH = 4; // number of videos to put in the list
    222   var feed = data.feed;
    223   var entries = feed.entry || [];
    224   var playlistId = feed.yt$playlistId.$t;
    225 
    226   var $ulVideos = $('<ul style="display:none"/>');
    227   var summary = feed.media$group.media$description != null ? feed.media$group.media$description.$t : feed.subtitle.$t;
    228   
    229   var $liPlaylist = $('<li class="playlist"></li>');
    230   var $aPlaylist = $('<a href="" onclick="togglePlaylist(this);return false;"></a>');
    231   $liPlaylist.append($aPlaylist);
    232   $aPlaylist.append('<h4>' + feed.title.$t + '</h4>');
    233   
    234   var playlistDescription = summary.substr(0, MAX_LIST_DESC_LENGTH);
    235   playlistDescription += playlistDescription.length == MAX_LIST_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
    236   $aPlaylist.append('<p>' +  playlistDescription + '</p>');
    237   
    238   // Loop through each entry (each video) and add it to the 'videoPreviews' list
    239   var length = feed.entry.length < MAX_LIST_LENGTH ? feed.entry.length : MAX_LIST_LENGTH; // max of 4 videos per list
    240   for (var i = 0; i < length; i++) {
    241     var entry = entries[i];
    242 
    243     var title = entry.title.$t;
    244     var id = entry.media$group.yt$videoid.$t;
    245     var thumbUrl = entry.media$group.media$thumbnail[0].url;
    246     var fullDescription = entry.media$group.media$description.$t;
    247     var playerUrl = entry.media$group.media$content[0].url;
    248 
    249     var shortDescription = fullDescription.substr(0, MAX_VIDEO_DESC_LENGTH);
    250     shortDescription += shortDescription.length == MAX_VIDEO_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
    251 
    252     var img = $('<img src="' + thumbUrl + '" width="60" height="45"/>');
    253     var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
    254     var pShortDescription = $('<p>' + shortDescription + '</p>');
    255     var h5Title = "<h5>" + title + "</h5>";
    256     var li = $('<li class="playlist-video"/>');
    257 
    258     li.append(a);
    259     a.append(img).append(h5Title).append(pShortDescription);
    260 
    261     $ulVideos.append(li);
    262     
    263     // use the first entry's thumbnail for the playlist
    264     if (i == 0) {
    265       $aPlaylist.prepend('<img src="' + thumbUrl + '" width="120" height="90"/>');
    266     }
    267   }
    268   
    269   if (feed.entry.length > MAX_LIST_LENGTH) {
    270     // add item to go to youtube for playlist
    271     $ulVideos.append('<li class="more"><a href="//www.youtube.com/playlist?list=' + playlistId + '">More &raquo;</a></li>');
    272   }
    273 
    274   $liPlaylist.append($ulVideos);
    275   $('#VideoPlaylists').append($liPlaylist);
    276 }
    277 
    278 
    279 function renderDevelopersLivePlaylist(data) {
    280 
    281   var MAX_DESC_LENGTH = 125; // the length at which we will trim the description
    282   var feed = data.feed;
    283   var entries = feed.entry || [];
    284   var playlistId = feed.yt$playlistId.$t;
    285 
    286   var ul = $('#DevelopersLive');
    287 
    288   // Loop through each entry (each video) and add it to the '#DevelopersLive' list
    289   for (var i = 0; i < 4; i++) {
    290     var entry = entries[i];
    291 
    292     var title = entry.title.$t;
    293     var id = entry.media$group.yt$videoid.$t;
    294     var thumbUrl = entry.media$group.media$thumbnail[0].url;
    295     var fullDescription = entry.media$group.media$description.$t;
    296     var playerUrl = entry.media$group.media$content[0].url;
    297     var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
    298     shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
    299 
    300     var img = $('<img src="' + thumbUrl + '" width="120" height="90"/>');
    301     var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
    302     var pShortDescription = $('<p>' + shortDescription + '</p>');
    303     var h4Title = "<h4>" + title + "</h4>";
    304     var li = $('<li/>');
    305 
    306     li.append(a);
    307     a.append(img).append(h4Title).append(pShortDescription);
    308 
    309     ul.append(li);
    310   }
    311 }
    312 
    313 /* This 'playlist' object defines the playlist IDs for each tab.
    314  * Each name inside 'playlist' corresponds to class names for the tab that the playlists belong to (eg: "googleioTab" and "googleioBox" divs).
    315  * Each string in 'ids' is the ID of a YouTube playlist that belongs in the corresponding tab.
    316  */
    317 var playlists = {
    318   'designinaction' : {
    319     'ids': ["PLWz5rJ2EKKc8j2B95zGMb8muZvrIy-wcF"]
    320   },
    321   'bizdevbytes' : {
    322     'ids': ["PLWz5rJ2EKKc8-Osr0TuHyTMEhKV0xJ6ql"]
    323   },
    324   'thisweek' : {
    325     'ids': ["PLWz5rJ2EKKc9Wam5jE-9oY8l6RpeAx-XM"]
    326   },
    327   'googleio' : {
    328     'ids': ["PLWz5rJ2EKKc9WGUwq2gQ-coU3fSyexgOx"]
    329   }
    330 };
    331 
    332 /* Request the playlist feeds from YouTube */
    333 function showVideosPlaylists() {
    334   for (var x in playlists) {
    335     var ids = playlists[x].ids;
    336     for (var i in ids) {
    337       var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
    338                     + ids[i] +
    339                     "?v=2&alt=json-in-script&max-results=50&callback=renderVideoPlaylists&orderby=position'><\/script>";
    340       $("body").append(script);
    341     }
    342   }
    343 }
    344 
    345 
    346 /* Request the playlist feeds from YouTube */
    347 function showDevelopersLivePlaylist() {
    348   var playlistId = "PLWz5rJ2EKKc_XOgcRukSoKKjewFJZrKV0"; /* DevBytes */
    349   var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
    350                 + playlistId +
    351                 "?v=2&alt=json-in-script&max-results=10&callback=renderDevelopersLivePlaylist&orderby=position'><\/script > ";
    352   $("body").append(script);
    353 }
    354 
    355 
    356 function togglePlaylist(listLink) {
    357   var $list = $(listLink).parent();
    358   var $ul = $list.find('ul');
    359   if ($ul.is(":visible")) {
    360     $ul.slideUp(function() {
    361       $list.css({'height':'inherit'});
    362     });
    363   } else {
    364     $list.closest('ul').find('li.playlist').find('ul').slideUp();
    365     $ul.slideDown();
    366     $list.css({'height':'auto'});
    367   }
    368 }
    369 
    370 showDevelopersLivePlaylist();
    371 showVideosPlaylists();
    372 </script>
    373