I am new to Android TV programming and just managed to have an App that starts a video from an ExoPlayer implementation.
When I hit the HOME-button the home is shown and the content I started appears in the purple marked area. I can resume my App from here.
TV Emulator - Android 10
Can you tell me how this area is called?
How can I control which meta data is shown?
I only found information about the Watch Next Card, but it seems to be something different.
That seems to be the notification area. It's not exclusive to playback.
For example, notifications for a firmware update will also appear there.
To have a proper now playing car and display metadata and other info see this:
https://developer.android.com/training/tv/playback/now-playing.html
Related
I have an app that plays media via MediaSessionCompat.
I create a notification for the Notification Drawer using NotificationCompat and post it using NotificationManagerCompat.notify, and it looks great. (See screenshot.)
My problem is with the lock screen. It only shows Play, Previous Track, and Next Track icons. I'm missing the controls to jump back and forward within the currently playing track. (See screenshot.)
I'm using MediaSession.setPlaybackState to specify the actions that are available, and I am including all the appropriate ones from PlaybackStateCompat for rewind, fast forward, skip to previous, and skip to next.
Is the lock screen configured differently than the notification? Or do developers simply have less control over the controls provided here?
Thank you in advance!
I'm developing a unity game for android and I'm looking for a way to pause the game whenever a notification pops up on the screen.
This is troublesome because pause menu button is at the top of screen and therefore lies behind the popup message and player cannot click on it.
I already implemented OnApplicationFocus() and successfully pause the game. However I also want to pause in these kind of occasions.
I found this answer for monitoring battery level but I'm looking for a general way for recognizing all kinds of popups.
I need to show the volume slider while casting an audio content to a Chromecast remote.
If I put the app to the background the slider is shown (see this).
The problem is that the framework does not show the slider when the app is not in the background.I guess it is because an application can decide to do something else.
I have tried to call
mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_SAME, AudioManager.FLAG_SHOW_UI);
with no success: the slider that is shown does not have the Chromecast icon and does not report the current volume on the remote. In other words the slider is related with the local audio volume.
is there a way to ask the framework to keep showing the slider even when the app is in the foreground?
Edited
Actually the behaviour even with the VideoCast app is a bit inconsistent. On some phones it is enough to bring the app in the background and make the framework showing the volume slider. After that it will keep showing it even when the app is in the foreground. On other phones this does not work or it is not necessary because the slider is shown correctly.
There is a bit of improvement that can be made; when media is playing back (i.e. if it is not on pause), you can achieve what you want. To see how, you need to override onKeyDown; take a look at the CastVideos-android sample, in class VideoBrowserActivity and try that to see if it does what you'd like or not.
Since you want to show the Chromecast control instead of the generic music control, you need to call:
mAudioManager.adjustSuggestedStreamVolume(AudioManager.ADJUST_SAME,
AudioManager.USE_DEFAULT_STREAM_TYPE, AudioManager.FLAG_SHOW_UI);
I am currently in the process of creating an MP3 player. In particular, the main mode of user input is in the form of (touchscreen) gestural input. I would like to add the functionality allowing users to continue interacting with the MP3 player when the screen is locked. That is, how can I get the device (A Galaxy S3 in particular if it's worth mentioning) to recognise gestures in the lock screen and "parse" them to the MP3 player?
Note: by "locked" I mean when one can see the lock screen (i.e. not when the screen is turned off).
How would I go about doing this?
Thanks in advance.
The recommended way is to make Lock Screen Widgets. These are widgets that allow you to interact with apps in the lockscreen such as the Google Play Music app.
Check out the official tutorial here:
http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen
Does Android have the software capabilities to, if a phone has video-out, to open or push content solely to the video out.
So for example if the user is in and clicks on a YouTube link, the app, instead of opening the content on the main screen over the app it would push it to the video out so the YouTube video would display on their connect display and they could continue to browse.
I know Motorola's have the WebTop software and this idea is similar to what I am trying to accomplish but on a much more basic level. It's more similar to Apples AirPlay but much less complex again (without a network/external player - just video out).
Or if even that is to complex an even simpler solution of having the video-out still output even when the phone is locked. Currently the video-out mirroring on both my HTC Incredible and Galaxy Nexus will stop when the phone is locked.
EDIT:
I've noticed while using my phone that playing a video through the Google Videos app that on the phone controls will overlay on the screen i.e. play, pause, seek bar, and, the soft buttons, but the video-out display (Television) plays the video continuously/seamlessly without any of the controls over-layed. Now this is very primitive example of what i'm ultimately alluding too but it does show a real world example of an android device (no 3rd party manufacture software) doing video out that isn't exactly mirroring.
Well... I hate to furnish this as an answer, but it really looks like there's simply nothing in the API for it at all...
http://groups.google.com/group/android-developers/browse_thread/thread/9e3bcd1eea2c379
which just redirects to:
https://groups.google.com/forum/#!topic/android-developers/Jxp_9ZtzL60
I'm definitely going to favorite this question, and hope someone chimes in with something more useful than a "doesn't look like it's possible, though that does appear to be the correct answer, at this time.
Much like Dr.Dredel has mentioned, there is nothing current for multiple displays in terms of display 1 showing 'A' and display 2 showing 'B'
There is support for multiple screen sizes per the following:
http://developer.android.com/guide/practices/screens_support.html#support
This will be the case for a little while longer until someone creates the support for it.