android-tv

Now Playing Card

♀尐吖头ヾ 提交于 2020-01-05 20:31:14
问题 I need help about displaying the Now Playing Card in the Recommendations row. I read the post about it in the Android developers site, but that did not help me much. I have a service that streams the MP3 data without problems. I added the following code, but there's no Now Playing Card... @Override public void onCreate() { Log.i(TAG, "onCreate called"); mSession = new MediaSession(this, "MusicService"); mSession.setCallback(new MediaSessionCallback()); mSession.setFlags(MediaSession.FLAG

Now Playing Card

帅比萌擦擦* 提交于 2020-01-05 20:31:14
问题 I need help about displaying the Now Playing Card in the Recommendations row. I read the post about it in the Android developers site, but that did not help me much. I have a service that streams the MP3 data without problems. I added the following code, but there's no Now Playing Card... @Override public void onCreate() { Log.i(TAG, "onCreate called"); mSession = new MediaSession(this, "MusicService"); mSession.setCallback(new MediaSessionCallback()); mSession.setFlags(MediaSession.FLAG

How to set the icon and title on Android TV home screen for the currently running task

只谈情不闲聊 提交于 2020-01-05 09:14:30
问题 I have enabled picture-in-picture mode for an Android TV app based on this guide: https://developer.android.com/guide/topics/ui/picture-in-picture.html When I enter PiP mode, and navigate to the home screen of the Android home screen, it shown at the top the currently running task (PiP window) with an icon an title and options to Open and Close. I could not find any documentation on how to set the the title and the icon (but most importantly the title). I have tried setting the

Is possible to publish same app for Android TV and smartphones on Google Play

这一生的挚爱 提交于 2020-01-05 04:42:11
问题 I want to use my app for Android TV and emulator (like BlueStacks). My app has Leanback Launcher request and already published for Android TV. When I generate signed apk, i can upload it bluestack emulator and it is running good. BlueStack emulator is shown as Samsung Galaxy S8 on Google Play In Google Play Console, my published app only support TV devices. Is possible to publish same app for Android TV and smartphones on Google Play? Its my manifest file <uses-feature android:name="android

Android TV: VerticalGridFragment shadow dimension and color

我与影子孤独终老i 提交于 2020-01-02 05:46:12
问题 I'm working on an Android TV application but I'm not quite happy with the standard shadow rendered by the VerticalGridFragment , I'd like to have it smaller and a bit less darker. I've searched through the code but I didn't find any full working solution. In my VerticalGridPresenter subclass, the only method I can override is createShadowOverlayOptions but I can't get the result I want. The only workaround I came up with is to define the following dimensions, so that the ones declared in the

How can I check if an app is running on an Android TV

你。 提交于 2020-01-01 04:04:06
问题 Is there a way to check if an app is running on an Android TV or Android Mobile? I know how to check the running build. I want to start a specific service if the app is running on an Android TV vs Mobile. Was hoping to house the two under the same library. 回答1: Some options are: 1) Query the system for a large screen 2) Use reflection to detect TV specific classes 3) Use hasSystemFeature to detect the lack of touchscreen More info https://developer.android.com/training/tv/start/hardware.html

Now Playing Card Does Not Start the Desired Activity

好久不见. 提交于 2019-12-24 15:23:42
问题 I could not manage to start an activity from the Now Playing card. I am using the following code, but the NowPlayingActivity never gets called. Intent intent = new Intent(getApplicationContext(), NowPlayingCardActivity.class); PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 99, intent, PendingIntent.FLAG_UPDATE_CURRENT); mSession.setSessionActivity(pi); and in the manifest file: <activity android:name=".NowPlayingCardActivity" /> I am taken to the main activity when I

Android TV, how to change color of title and color of headeritem?

两盒软妹~` 提交于 2019-12-24 07:31:15
问题 I want to change title color(Hello Android TV!) and headeritem for row color(GridItemPresenter). 回答1: To change the list row header style you must use custom ListRowPresenter: public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPresenter(new CustomRowHeaderPresenter()); } } public class CustomRowHeaderPresenter extends RowHeaderPresenter { @Override public Presenter.ViewHolder onCreateViewHolder(ViewGroup parent) { Presenter

How to get internet to work in Android TV emulator

牧云@^-^@ 提交于 2019-12-24 04:48:08
问题 I have an Android TV (not google TV) emulator setup running android tv 5.0 and it has no access to the internet. In settings for both wifi and ethernet it says "no connection". Is there something I am missing? I have emulators for other versions of android running on phones and everything networking wise works ok. Also I am not saying that my app has no internet access. I am saying that the actually Android TV settings says no network connections. 回答1: The Android SDK emulator images do not

How to make an apk can be used both in mobile and android-TV?

南笙酒味 提交于 2019-12-24 03:42:29
问题 Now I'm developping an appliction for both mobile and android-TV.According to the android develop guide, it is possible to do that. For some reasons, I have developed two applications individually.  Is it just simply merge two application's sources to archive that? Or is there something need to take care of ? 回答1: In your Android Manifest you have to decorate your App Activity and TV Activity in a slightly different manner: Here is how you decorate you App Activity <activity android:name="