android-tv

Alternative for missing app bar in Android TV

痴心易碎 提交于 2020-12-27 07:14:15
问题 I just notice that my Android app, when I run it on Android TV with leanback intent, that it doesn't show a sandwich button for the menu items. This is missing, and everthing else like the title: What is the suggested alternative? Is it possible to listen to a button on the remote control and make the menu items visible? 来源: https://stackoverflow.com/questions/65296436/alternative-for-missing-app-bar-in-android-tv

Android Studio project that builds for both Wear OS and normal app, but shares source files

China☆狼群 提交于 2020-07-31 05:03:32
问题 I have a very small Android app that I have ported to Wear OS. It works OK. But now I have two separate projects, whose source files are 99.5% identical. How can I put both versions in one project, so only one copy of each common source file is needed? (For instance, the Manifest file needs to be tailored -- at least for the uses-feature android.hardware.type.watch , and one source file needs to be different -- menus in the Android app have to be handled differently on the Wear app. One

KeyEvent getRepeatCount() always return 0

二次信任 提交于 2020-05-15 06:16:51
问题 I'm working with remote android TV To catch event when use press remote button I use this code: public boolean dispatchKeyEvent(KeyEvent event) { Log.d("LOG", "Number repeate count = " + event.getRepeatCount()); if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_1: exoPlayerManager.showControllerView(); if (event.getRepeatCount() > 0) { if (videoPlayerView.getPlaybackControlView().getPlayer().getPlaybackParameters().speed >= 64) { ((TextView

using remote control for android TV application

佐手、 提交于 2020-02-02 16:35:28
问题 I'm developing an Android application for TV when I'm trying to test it in the real Android TV I can't navigate to any button or anything using the remote control buttons up, down, left, right. I have searched about it and I found that I have to use (Enable D-pad Navigation ) but I don't know how to use this , I didn't find any code or tutorial for it My application is so simple. It makes dynamic layout beside each other and each layout has only one button and one recycle view. 回答1: By

using remote control for android TV application

痞子三分冷 提交于 2020-02-02 16:33:12
问题 I'm developing an Android application for TV when I'm trying to test it in the real Android TV I can't navigate to any button or anything using the remote control buttons up, down, left, right. I have searched about it and I found that I have to use (Enable D-pad Navigation ) but I don't know how to use this , I didn't find any code or tutorial for it My application is so simple. It makes dynamic layout beside each other and each layout has only one button and one recycle view. 回答1: By

How to display Now Playing Card on Android TV

一世执手 提交于 2020-01-26 01:54:08
问题 I am using MediaPlayer for playing audio in my android application. There are some troubles with displaying the Now Playing Card in Recommendation row on Leanback Launcher. I have extended MediaSessionCompat.Callback in the player. What am I doing wrong? (code is below). What is supposed to be done for this card to be displayed? private void createMediaSession() { if (mSession == null) { mSession = new MediaSessionCompat(mContext, "MediaSession"); mSession.setCallback(this); mSession.setFlags