Is there any way to play the same background video in all activities? (preferably not to restart when opening a new activity)
Some methods from here: Integrating video file in android app as app background kinda works, but only in one activity. For example, if I go from my main activity into another, when I come back some elements from my .xml file fails to visible load. In fact, the buttons are still there if I press where they should be, it works, but they are not visible.
Related
I'd like to create an app (actually just a menu) that should work just like the Android TV settings menu.
To be more specific, I'd like my app to cover only part of the screen and let any background video play on the remaining area (exactly like what happens with the settings menu).
Here's a picture of what I'd like to obtain:
This means that I should be able to:
open Live Channels
play some content
press the home button (at this point the channel will be playing in background behind the leanback launcher)
open my app, and have the background content continue playing
Of this, I just need to figure out how to obtain point 4, the rest is just how Android TV works by default.
Just to be clear, I don't want advices on how to create an app that plays a video and has a side menu, I want to integrate this menu inside the existing Android TV background videos feature.
Is it possible? I can't find any API for this.
For the app, you can do that using a transparent theme on the activity, that should keep the background visible (you can also decide to have a pseudo-transparent background to partially hide what's behind the activity, same way settings do).
The other question about playing the live channel on the background of the leanback launcher, I am not sure, but it sounds like it should be the standard procedure.
I'm working for few weeks with Vuforia,unity and Android in one package and i a bit stuck on one problem. I manage to almost finish all parts of my application besides one.
Because i run some videos, I had to implement another activities besides main camera one, to show them there. I manage to start video, and everything is working like charm up to point when i'm getting back to main camera activity, problem is - camera is black and object is not visibile. I tried to resume or restart whole window again using resume methods and getting focus request on unityPlayer no luck though.
One thing which is even more confusing for me is, clicking app stac in android (icon which is showing all runing apps), and getting back from there is making camera work again, same thing with clicking home button.
Any ideas how i can make camera work after activity is resumed?
Marek
edit: I notice that turning of screen works too.
In Android , Is it possible to display one application(rendering Video) as a floating screen in one half of the screen. and at the same time interacting with another application(e.g chat application or any other application. ).The floating screen appliction will be my application so that it will allow the user to do multitasking.
The idea is to keep the surfaceview of the application, which is rendering the video, on top, and at the same time interact with other applications.e.g gallery or any other application..
If by "two active applications" then you mean real applications (i.e. with activities, back stack, &c) active at the same time, then no (except in some specialized devices, with custom APIs).
However, there is a trick you can use to achieve a similar effect. Applications with the android.permission.SYSTEM_ALERT_WINDOW (displayed as "draw over other apps" in Play Store) can create windows from a service and show them. So you could probably get the effect you want with this method.
There is an open source library called StandOut which provides this behavior in an easy to use manner. You might want to take a look at it.
In short, the answer is no. There is no way currently for multiple apps to be visible on the screen at the same time.
You could theoretically reuse code over multiple different applications, so you could create a video window that could play video, while simultaneously showing a text editor fragment that allows notes to be taken, and you can send data between different applications using an Intent, but unlike modern desktop computers, only one application can currently have the focus of the screen at a time in Android.
how is it possible to show an image ontop of a running activity while still being able to control the background?
in case some ppl say it is not possible, check this app out:
https://play.google.com/store/apps/details?id=com.myboyfriendisageek.stickit&hl=en
is there a way to open a transparent activity but still being able to control the previous activity?
ive also tried using a toast, but that is capped by a timer, and i have not been able to find a way to control it.
I want to have a single video playing in the background of my application, so that when any new activity is pushed on the stack, it will have a transparent background so that the application background video is all the time visible.
How would I accomplish this, without any risk of the activity containing the video gets destroyed at any stage?
What you want is not possible.
You will have to implement this as a single activity, possibly using fragments to handle your changing content. Even then, the user can always exit this activity.
Bear in mind that this will not work well except on devices offering 2D graphic hardware acceleration. That is possible on Android 3.0+ devices when you request hardware acceleration in the manifest. On Android 1.x and 2.x devices, this will likely perform very poorly.