Android Display via HDMI - android

I have a client that's asking for an app that can play videos from a tablet to connected HDMI screens. I'd like to know if it's possible to show different output on the HDMI screen than the tablet itself? This is because I want to add a menu (layer on top of the tablet screen) that is accessible by the client and is not visible to the people seeing the TV Screen.
Thanks for the help.

That is possible since Android 4.2, see the release notes which also contain code samples:
Android now allows your app to display unique content on additional
screens that are connected to the user’s device over either a wired
connection or Wi-Fi. To create unique content for a secondary display,
extend the Presentation class and implement the onCreate() callback.
Within onCreate(), specify your UI for the secondary display by
calling setContentView(). As an extension of the Dialog class, the
Presentation class provides the region in which your app can display a
unique UI on the secondary display.
The Presentation Class in the SDK contains a code sample how to play a video and show some information at the same time on a second screen.

Related

How to mirror android screen/app to a screen programatically?

I am developing an android application and I'm trying to implement a button which initiates a screen mirror to a selected device.
I want it to be as straigth forward as possible, but the best i've been able to do is have it open the cast settings on the Settings app, which isn't a proper solution. It would be ideal to start screen mirroring with a single click.
Problem is i've tried using Googles Cast SDK but that only allows me to build custom HTML cast receivers, which isn't what I want, I just need a screen mirror from the android device to a screen/TV.
Is there any Android module/API that would allow me to do this with a single click, even if I have to use a Chromecast/Miracast device connected to the screen?
No, sorry, this is not an option AFAIK.
At least part of this is privacy/security. You seem to want to be able to start screen mirroring purely from app code ("I'm trying to implement a button", "allow me to do this with a single click"). Your button is the "single click", and so you really want to be able to do this without user involvement at all (since there is nothing forcing that button to exist). Showing the contents of the screen on another screen that might be visible to lots of people is the sort of thing that users need to approve, which is why additional clicks will be required.
In addition, there may be more than one target for screen mirroring within range, and the user needs to be able to choose which one to use, if any.
Combine all that with limited support for wireless displays across the various Android device manufacturers, and there really isn't anything here for what you want.

Check if Android is presenting its screen

Does anybody know if there is a generic way to check if the screen is currently being presented, e.g. via Miracast, Chromecast or any other app?
My app runs in the background and shows notifications every now and then. I'd like to avoid that while the screen is visible to others.

Is there any way to show two emulator for Sub Display(Presentation Class)?

I am working with Presentation Class to show different screen to the customers, but interact together.
But I have no idea how to test this out because my devices and emulators only show one screen.
Is there any way to accomplish this?
For hardware, you may be able to connect an external display. For example, many modern Samsung devices support USB-C to HDMI adapters.
For the emulator and hardware that does not support external displays, you can simulate an external display. In Developer Options, scroll down to "Simulate secondary displays", and from there choose a resolution for the secondary display. This will appear as a floating layer over the main device UI, and it will work with Presentation.

Android Presentation API - Interactive Secondary Display?

I'm building an Android Application on a SoC Board that runs Android Nougat. I have a primary HDMI Display that I connect to via the HDMI Port, and a secondary HDMI Display that I connect to via a USB-C to HDMI Converter. By default, the secondary display mirrors the primary one.
I've loaded in the Android Presentation API's Display Manager example, and I'm able to select my secondary HDMI Display, and a photo opens on it.
However, what I noticed is that my mouse is bound inside my primary display, and it can't travel to the secondary display. This isn't ideal because I want my secondary display to be interactive as well, through a touch screen display. Now, I don't want to invest in it yet as it can cost quite a lot.
My question is: Can the secondary display in the Presentation API be interacted with as well and act as if it's an "entirely separate app" from the one displayed in the primary display?

Adobe Air Invisible Buttons on Android

I am creating my first Adobe Air application from a Flash animation file via Flash Builder (I am an Android developer by trade.) One of the last updates I had to make was updating some of the text fields within the app to be dynamic so their text can be set at runtime via ActionScript.
When I view the app via the Adobe Air Simulator or push to an iOS device the buttons work fine, but when I push to an Android device some Buttons and Movie Clips are invisible. I can still click on the buttons if I touch where they should be on the screen but I cannot see them. In my testing of a fix I set the alpha of a button which is affected by this issue to 100 but it still shows as invisible.
Is this a known issue? How would I go about ensuring that all Buttons and Movie Clips are visible to the user?
Thanks,
Adam
Edit:
The only change to my code in order to set the text is running the following AS:
play_play.text = TranslationUtils.getTranslationText(TranslationUtils.PLAY_PLAY);
The AS for the TranslationUtils class is an external AS file which switchs through constants to return the correct text, based on the device's Capabilities.language

Categories

Resources