blob: eb28da8030e08a164f5e5336807a29d8b7ab7b33 [file] [log] [blame]
Scott Main50e990c2012-06-21 17:14:39 -07001fullpage=true
2page.title=Develop
Scott Mainbbaf11f2014-03-27 13:01:56 -07003page.viewport_width=970
Scott Main50e990c2012-06-21 17:14:39 -07004header.hide=1
5carousel=1
6tabbedList=1
Dirk Dougherty5f0462a2013-11-19 13:15:07 -08007excludeFromSuggestions=true
Scott Main50e990c2012-06-21 17:14:39 -07008@jd:body
9
10<style>
11#noplayer-message {
12position:absolute;top:50%;left:0;width:100%;z-index:-1;text-align:center;display:none;
13}
14#player-frame object {z-index:1;}
15</style>
16
17<div id="player-wrapper">
18 <div id="player-frame">
19 <div id="noplayer-message">
20 <!-- busted flash player message -->
21 Your video is supposed to appear here.<br/>
22 Make sure you have the <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash&reg; Player</a>.
23 </div>
24 <div id="player"><!-- Youtube embeds here... actually replaces this div --></div>
25 <a class="close" onclick="$('#player-wrapper').hide()">close video</a>
26 </div>
27</div>
Scott Main50e990c2012-06-21 17:14:39 -070028<div class="wrap">
29 <!-- Slideshow -->
30 <div class="slideshow-container slideshow-develop col-16">
31 <a href="" class="slideshow-prev">Prev</a>
32 <a href="" class="slideshow-next">Next</a>
33 <div class="frame">
34 <ul>
Robert Ly32c0cac2013-02-12 10:31:42 -080035
36 <li class="item carousel-home">
37 <div class="col-8">
Dirk Dougherty9ce329d2013-07-23 23:07:07 -070038 <img
39src="//lh4.ggpht.com/-lfjzgG5Dqrk/UHMThRtpRwI/AAAAAAAABpk/h4d3nsmkgPM/s400/mint.png"
40class="play no-shadow no-transform" />
41 </div>
42 <div class="content-right col-6">
43 <h2>Building Great Apps for Tablets</h2>
44 <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>
45 <p><a
46href="//android-developers.blogspot.com/2012/11/designing-for-tablets-were-here-to-help.html" class="button">Read
47more</a></p>
48 </div>
49 </li>
50 <li class="item carousel-home">
51 <div class="col-8">
Scott Main99947692013-05-20 11:54:36 -070052 <img src="{@docRoot}images/google/gps-location.png"
53class="play no-shadow no-transform" style="margin:0 0 0 70px;height:230px;width:340px" />
54 </div>
55 <div class="content-right col-6" style="width:350px">
56 <h2>New Location APIs from Google</h2>
57 <p>The latest version of Google Play services includes new APIs that provide more
58 efficient and immediate user location data on devices running Android 2.2
59 and higher. Features include geofencing APIs, user activity recognition, and
60 power-efficient location updates.</p>
61 <p><a
62href="{@docRoot}google/play-services/location.html" class="button">Read more</a></p>
63 </div>
64 </li>
65
66 <li class="item carousel-home">
67 <div class="col-8">
Robert Ly32c0cac2013-02-12 10:31:42 -080068 <img src="{@docRoot}images/google/gps-plus-signin-hero.jpg"
69class="play no-shadow no-transform" style="margin:0 0 0 40px;max-height:250px;height:250px;
70 max-width:409px;width:409px" />
71 </div>
72 <div class="content-right col-6" style="width:350px">
Scott Main99947692013-05-20 11:54:36 -070073 <h2>New Cross-Platform Single Sign On</h2>
74 <p>Google+ Sign-In is an easy, trusted way to sign a user into your app.
75 Now it's even more seamless. A user can sign in to your app on one device and
76 pick it up on another&mdash;without signing in again. Best of all, it's built
77 into Google+ Sign-in, so there's no change needed in your app.</p>
Robert Ly32c0cac2013-02-12 10:31:42 -080078 <p><a
79href="{@docRoot}google/play-services/plus.html" class="button">Read more</a></p>
Scott Main99947692013-05-20 11:54:36 -070080 </div>
Robert Ly32c0cac2013-02-12 10:31:42 -080081 </li>
82
Dirk Dougherty76cdbdc2012-10-22 21:30:29 -070083 <li class="item carousel-home">
84 <div class="col-8">
Scott Main9748abb2012-11-29 14:28:44 -080085 <img src="{@docRoot}images/google/maps-v2-trulia-n7.png"
86class="play no-shadow no-transform" style="margin:0 0 0 40px;max-height:250px;height:250px;
Scott Mainb74844c2012-11-29 21:13:30 -080087 max-width:409px;width:409px" />
Scott Main9748abb2012-11-29 14:28:44 -080088 </div>
89 <div class="content-right col-6" style="width:350px">
Scott Mainaaaa1562012-12-03 09:19:10 -080090 <h2>New Google Maps Android APIs!</h2>
Scott Main9748abb2012-11-29 14:28:44 -080091 <p>Google Maps Android API version 2 is now available with enhanced
92 features such as 3D buildings, vector-based map tiles, rich overlay capabilities,
93 indoor maps, support for fragments, and much more.</p>
94
95 <p>The APIs are bundled with Google Play services and are
96 compatible with Android 2.2 and higher.</p>
97 <p><a
98href="{@docRoot}google/play-services/maps.html" class="button">Read more</a></p>
99 </div>
100 </li>
Scott Main50e990c2012-06-21 17:14:39 -0700101 </ul>
102 </div>
103 </div>
104 <!-- /End slideshow -->
105</div>
106<div class="wrap">
107 <!-- news and feature feed -->
108 <div class="feed col-8" style="margin-left:0">
109 <ul class="feed-nav">
110 <li class="active">DEVELOPER NEWS</li>
111 <li>FEATURED DOCS</li>
112 </ul>
113 <div class="feed-container">
114 <div class="feed-frame">
115 <!-- DEVELOPER NEWS -->
Dirk Dougherty76cdbdc2012-10-22 21:30:29 -0700116 <ul>
Dirk Dougherty9ce329d2013-07-23 23:07:07 -0700117 <li><a href="//android-developers.blogspot.com/2013/07/making-beautiful-android-app-icons.html">
118 <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>
119 <h4>Making Beautiful Android App Icons</h4>
120 <p>As higher density screens gain popularity, it's important to make sure your launcher icon is crisp and high quality...</p>
121 </a></li>
122 <li><a href="//android-developers.blogspot.com/2013/07/beautiful-design-collection-summer-2013.html">
123 <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>
124 <h4>The Beautiful Design Summer 2013 Collection</h4>
Dirk Dougherty2ffbfba2013-07-30 10:46:50 -0700125 <p>See the apps chosen by the Android Design team for their masterfully crafted design details...</p>
Dirk Dougherty9ce329d2013-07-23 23:07:07 -0700126 </a></li>
Dirk Doughertyad209a92013-10-20 12:47:43 -0700127 <li><a href="//android-developers.blogspot.com/2013/10/new-developer-features-in-google-play.html">
128 <div class="feed-image" style="background:url('//3.bp.blogspot.com/-k33rf398Lqw/UlRUMQQRUNI/AAAAAAAAClM/pSwz2YgQpmY/s1600/gps-play_games_logo.png') no-repeat 0 0;background-size:130px;background-position:8px -4px;"></div>
129 <h4>New Features in Google Play Games</h4>
130 <p>Three new features that make it easier to understand what players are doing in your game and help you manage game features...</p>
Dirk Dougherty9ce329d2013-07-23 23:07:07 -0700131 </a></li>
Scott Main99947692013-05-20 11:54:36 -0700132 <li><a href="//android-developers.blogspot.com/2013/05/new-ways-to-optimize-your-business-in.html">
Dirk Dougherty809b0842013-10-31 14:01:56 -0700133 <div class="feed-image" style="background:url('//3.bp.blogspot.com/-_8WvpdTVGsE/UkxxxrVoNNI/AAAAAAAACj8/FrQyA-BO11c/s1600/gp-referral-ga.png') no-repeat 0 0;background-size:180px"></div>
Dirk Doughertyad209a92013-10-20 12:47:43 -0700134 <h4>Linking Google Analytics with Google Play</h4>
135 <p>Understanding your users easier through a new integration between Google Analytics and the Google Play Developer Console...</p>
Scott Main99947692013-05-20 11:54:36 -0700136 </a></li>
Dirk Dougherty76cdbdc2012-10-22 21:30:29 -0700137 </ul>
Scott Main50e990c2012-06-21 17:14:39 -0700138 <!-- FEATURED DOCS -->
Dirk Dougherty76cdbdc2012-10-22 21:30:29 -0700139 <ul>
140 <li><a href="{@docRoot}distribute/googleplay/spotlight/tablets.html">
141 <h4>Tablet Stories</h4>
142 <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>
143 </a></li>
144 <li><a href="{@docRoot}distribute/googleplay/quality/core.html">
145 <h4>Core App Quality Guidelines</h4>
146 <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>
147 </a></li>
148 <li><a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">
149 <h4>Updated Notifications API Guide</h4>
150 <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>
151 </a></li>
152 <li><a href="{@docRoot}guide/topics/ui/dialogs.html">
153 <h4>Updated Dialogs API Guide</h4>
154 <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>
155 </a></li>
156 </ul>
Scott Main50e990c2012-06-21 17:14:39 -0700157 </div>
158 </div>
159 </div> <!-- /news and feature feed -->
160 <!-- video feed -->
161 <div class="feed col-8" style="margin-right:0">
162 <ul class="feed-nav">
163 <li class="active">DEVELOPERS LIVE</li>
164 <li>VIDEO PLAYLISTS</li>
165 </ul>
166 <div class="feed-container">
167 <div class="feed-frame">
Dirk Dougherty76cdbdc2012-10-22 21:30:29 -0700168 <ul id="DevelopersLive">
169 </ul>
170 <ul id="VideoPlaylists">
171 </ul>
Scott Main50e990c2012-06-21 17:14:39 -0700172 </div>
173 </div>
174 </div>
175 <!-- /video feed -->
176</div>
177
178<br class="clearfix"/>
Scott Main50e990c2012-06-21 17:14:39 -0700179
180
181
182
183
184
185
186
187
188
189<script src="//swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js" type="text/javascript"></script>
190<script type="text/javascript">
191
192/* Load a video into the player box.
193 * @param id The YouTube video ID
194 * @param title The video title to display in the player box (character escaped)
195 * @param autoplay Whether to automatically play the video
196 */
197function loadVideo(id, title, autoplay) {
198 swfobject.embedSWF('//www.youtube.com/v/' + id + '&rel=1&border=0&fs=1&autoplay=' +
199 (autoplay?1:0), 'player', '525', '330', '9.0.0', false, false, {allowfullscreen: 'true'});
200 $("#videoPlayerTitle").html("<h2>" + unescape(title) + "</h2>");
201 $("#player-wrapper").show();
202 setTimeout(function(){$('#noplayer-message').show()}, 2000);
203}
204
205/* Draw all videos from a playlist into a 'videoPreviews' list
206 * @param data The feed data returned from the youtube request
207 */
208function renderVideoPlaylists(data) {
209 var MAX_LIST_DESC_LENGTH = 130; // the length at which we will trim the description
210 var MAX_VIDEO_DESC_LENGTH = 100; // the length at which we will trim the description
211 var MAX_LIST_LENGTH = 4; // number of videos to put in the list
212 var feed = data.feed;
213 var entries = feed.entry || [];
214 var playlistId = feed.yt$playlistId.$t;
215
216 var $ulVideos = $('<ul style="display:none"/>');
217 var summary = feed.media$group.media$description != null ? feed.media$group.media$description.$t : feed.subtitle.$t;
218
219 var $liPlaylist = $('<li class="playlist"></li>');
220 var $aPlaylist = $('<a href="" onclick="togglePlaylist(this);return false;"></a>');
221 $liPlaylist.append($aPlaylist);
222 $aPlaylist.append('<h4>' + feed.title.$t + '</h4>');
223
224 var playlistDescription = summary.substr(0, MAX_LIST_DESC_LENGTH);
225 playlistDescription += playlistDescription.length == MAX_LIST_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
226 $aPlaylist.append('<p>' + playlistDescription + '</p>');
227
228 // Loop through each entry (each video) and add it to the 'videoPreviews' list
229 var length = feed.entry.length < MAX_LIST_LENGTH ? feed.entry.length : MAX_LIST_LENGTH; // max of 4 videos per list
230 for (var i = 0; i < length; i++) {
231 var entry = entries[i];
232
233 var title = entry.title.$t;
234 var id = entry.media$group.yt$videoid.$t;
235 var thumbUrl = entry.media$group.media$thumbnail[0].url;
236 var fullDescription = entry.media$group.media$description.$t;
237 var playerUrl = entry.media$group.media$content[0].url;
238
239 var shortDescription = fullDescription.substr(0, MAX_VIDEO_DESC_LENGTH);
240 shortDescription += shortDescription.length == MAX_VIDEO_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
241
242 var img = $('<img src="' + thumbUrl + '" width="60" height="45"/>');
243 var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
244 var pShortDescription = $('<p>' + shortDescription + '</p>');
245 var h5Title = "<h5>" + title + "</h5>";
246 var li = $('<li class="playlist-video"/>');
247
248 li.append(a);
249 a.append(img).append(h5Title).append(pShortDescription);
250
251 $ulVideos.append(li);
252
253 // use the first entry's thumbnail for the playlist
254 if (i == 0) {
255 $aPlaylist.prepend('<img src="' + thumbUrl + '" width="120" height="90"/>');
256 }
257 }
258
259 if (feed.entry.length > MAX_LIST_LENGTH) {
260 // add item to go to youtube for playlist
Scott Main99947692013-05-20 11:54:36 -0700261 $ulVideos.append('<li class="more"><a href="//www.youtube.com/playlist?list=' + playlistId + '">More &raquo;</a></li>');
Scott Main50e990c2012-06-21 17:14:39 -0700262 }
263
264 $liPlaylist.append($ulVideos);
265 $('#VideoPlaylists').append($liPlaylist);
266}
267
268
269function renderDevelopersLivePlaylist(data) {
270
271 var MAX_DESC_LENGTH = 125; // the length at which we will trim the description
272 var feed = data.feed;
273 var entries = feed.entry || [];
274 var playlistId = feed.yt$playlistId.$t;
275
276 var ul = $('#DevelopersLive');
277
278 // Loop through each entry (each video) and add it to the '#DevelopersLive' list
279 for (var i = 0; i < 4; i++) {
280 var entry = entries[i];
281
282 var title = entry.title.$t;
283 var id = entry.media$group.yt$videoid.$t;
284 var thumbUrl = entry.media$group.media$thumbnail[0].url;
285 var fullDescription = entry.media$group.media$description.$t;
286 var playerUrl = entry.media$group.media$content[0].url;
287 var shortDescription = fullDescription.substr(0, MAX_DESC_LENGTH);
288 shortDescription += shortDescription.length == MAX_DESC_LENGTH ? "..." : ""; // add ellipsis if we've chopped the description
289
290 var img = $('<img src="' + thumbUrl + '" width="120" height="90"/>');
291 var a = $('<a href="#" onclick="loadVideo(\'' + id + '\',\'' + escape(title) + '\',true); return false;" />');
292 var pShortDescription = $('<p>' + shortDescription + '</p>');
293 var h4Title = "<h4>" + title + "</h4>";
294 var li = $('<li/>');
295
296 li.append(a);
297 a.append(img).append(h4Title).append(pShortDescription);
298
299 ul.append(li);
300 }
301}
302
Scott Main50e990c2012-06-21 17:14:39 -0700303/* This 'playlist' object defines the playlist IDs for each tab.
304 * Each name inside 'playlist' corresponds to class names for the tab that the playlists belong to (eg: "googleioTab" and "googleioBox" divs).
305 * Each string in 'ids' is the ID of a YouTube playlist that belongs in the corresponding tab.
306 */
307var playlists = {
Scott Mainbce26802012-11-15 10:26:40 -0800308 'designinaction' : {
309 'ids': ["PLWz5rJ2EKKc8j2B95zGMb8muZvrIy-wcF"]
Scott Main50e990c2012-06-21 17:14:39 -0700310 },
Scott Main99947692013-05-20 11:54:36 -0700311 'bizdevbytes' : {
312 'ids': ["PLWz5rJ2EKKc8-Osr0TuHyTMEhKV0xJ6ql"]
Scott Mainbce26802012-11-15 10:26:40 -0800313 },
Scott Main41b08da2013-06-17 17:47:36 -0700314 'thisweek' : {
315 'ids': ["PLWz5rJ2EKKc9Wam5jE-9oY8l6RpeAx-XM"]
Scott Mainbce26802012-11-15 10:26:40 -0800316 },
317 'googleio' : {
Scott Main99947692013-05-20 11:54:36 -0700318 'ids': ["PLWz5rJ2EKKc9WGUwq2gQ-coU3fSyexgOx"]
Scott Main50e990c2012-06-21 17:14:39 -0700319 }
320};
321
322/* Request the playlist feeds from YouTube */
323function showVideosPlaylists() {
324 for (var x in playlists) {
325 var ids = playlists[x].ids;
326 for (var i in ids) {
327 var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
328 + ids[i] +
Scott Main99947692013-05-20 11:54:36 -0700329 "?v=2&alt=json-in-script&max-results=50&callback=renderVideoPlaylists&orderby=position'><\/script>";
Scott Main50e990c2012-06-21 17:14:39 -0700330 $("body").append(script);
331 }
332 }
333}
334
335
336/* Request the playlist feeds from YouTube */
337function showDevelopersLivePlaylist() {
Scott Main5b61ad22013-01-15 11:18:48 -0800338 var playlistId = "PLWz5rJ2EKKc_XOgcRukSoKKjewFJZrKV0"; /* DevBytes */
Scott Main50e990c2012-06-21 17:14:39 -0700339 var script = "<script type='text/javascript' src='//gdata.youtube.com/feeds/api/playlists/"
340 + playlistId +
Scott Main99947692013-05-20 11:54:36 -0700341 "?v=2&alt=json-in-script&max-results=10&callback=renderDevelopersLivePlaylist&orderby=position'><\/script > ";
Scott Main50e990c2012-06-21 17:14:39 -0700342 $("body").append(script);
343}
344
345
346function togglePlaylist(listLink) {
347 var $list = $(listLink).parent();
348 var $ul = $list.find('ul');
349 if ($ul.is(":visible")) {
350 $ul.slideUp(function() {
351 $list.css({'height':'inherit'});
352 });
353 } else {
354 $list.closest('ul').find('li.playlist').find('ul').slideUp();
355 $ul.slideDown();
356 $list.css({'height':'auto'});
357 }
358}
359
360showDevelopersLivePlaylist();
361showVideosPlaylists();
Dirk Dougherty49be1ef2012-11-29 21:11:24 -0800362</script>