Android tv get started

Download Android tv get started

Post on 15-Jul-2015

801 views

Category:

Technology

1 download

Embed Size (px)

TRANSCRIPT

<p>Android TV Ascii @ KKBOX</p> <p>ADT-1Nexus Player</p> <p>Android TV SDKandroid { compileSdkVersion 21 buildToolsVersion "21.1.1"</p> <p> defaultConfig { minSdkVersion 21 targetSdkVersion 21 }}dependencies { compile 'com.android.support:leanback-v17:21.0.2'}</p> <p>compileSdkVersion VS buildToolsVersion</p> <p>Nexus Player Controller</p> <p>Resolution</p> <p>Add TV Support 1</p> <p>Add TV Support 2</p> <p>Common ErrorsSDK Level (min 17)Launch default Activity (Android Studio bug)Unnecessary Resources (for mobile module)uses-feature android:required="true" (false)Leanback LibraryBrowseFragmentSearchFragmentDetailFragmentPlayFragmenBrowseFragmentpublic ListRow(HeaderItem header, ObjectAdapter adapter)</p> <p>setBadgeDrawable(/*res*/);DetailFragmentDetailsOverviewRow.setAction(new Action(long id, CharSequence label))</p> <p>OnActionClickedListener.onActionClicked(Action action)</p> <p>if (action.getId() == OPEN)else if (action.getId() == UNIN)else if (action.getId() == UPD)Create recommendations</p> <p>if (intent.getAction().endsWith(Intent.ACTION_BOOT_COMPLETED)) { // startService(/* IntentService */) or getService(/* IntentService */)}Create recommendationspublic class RecommendationsService extends IntentService { @Override protected void onHandleIntent(Intent intent) { NotificationManager mNotificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);</p> <p> Notification notification = new NotificationCompat.BigPictureStyle( new NotificationCompat.Builder()).build();</p> <p> mNotificationManager.notify(count, notification); }}ReferenceDesign guidelinehttp://developer.android.com/design/tv/index.html</p> <p>TV App Qualityhttp://developer.android.com/distribute/essentials/quality/tv.html</p> <p>Publishing processhttp://developer.android.com/distribute/googleplay/tv.html</p> <p>Using the Leanback libraryhttps://github.com/googlesamples/androidtv-Leanbackhttps://www.youtube.com/watch?v=72K1VhjoL98</p>