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.
Related
Is it possible a mobile app working like a background process to blur or fade the screen of the smartphone, no matter what active app is being displayed? Does the android and ios APIs expose such features?
Definitely not on Android. There are accessibility services which do modify the screen regardless of which app is visible but those are mostly first party applications. It would be a pretty big security risk issue if apps could block/blur the screen of other apps.
That being said you can create an overlay which lets touches through. I'm not sure if you can get the actual pixels of the UI behind the overlay and run a blur yourself but you can draw over top of elements on the screen (using accessibility APIs you can get the positions of UI elements) which may suit your needs depending on what exactly you're trying to achieve.
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.
I am building an Android app that uses the phone's camera feature. I know there is a way to build a custom camera view. Instead, I am choosing to use the camera app via an intent and not build my own camera view. I want to disable/make disappear the pause button while taking a video and have just the stop button. I looked up the Camera API Guide at www.developer.android.com but it doesn't talk about how I could do this. Does anyone know a way to do this?
I doesn't think that this is possible. Using Intents is just a way to tell Android "hey, I'd like to take a video (photo, see MapView, etc). Can you do it for me?". It may trigger one or MORE Apps listening to that Intent, depending on what apps the user has Installed. Usually you can only choose very basic options via Intents, i.e. take video/picture or tell the MapView at which Position it should show up. These options usually also appear inside the App during normal use. I never see a "CustomCamera-App" that hasn't a pause Button, or where one is able to deactivate it inside the menu. Therefore the chances that it is possible to set that special option tends to zero.
i'm developing an app and need to make Activity that take snapshot from current content of device screen.
note: i dont want take picture from my activity content or some view, i want take a picture from all of device screen content. ( like home screen or every applications that are on foreground). i googled many times and search so much.
there is an example code:
View screen = (View)findViewById(R.id.screen);
screen.setDrawingCacheEnabled(true);
bmScreen = screen.getDrawingCache();
showBitmap(bmScreen); // function that show my bitmap image
with this code can capture my activity's view, but i dont want capture onlye my activity. i want make a thread that capture device screen with all of its contents.
can everybody help me please?
You can't do this, mostly for security reasons. If this were possible, some rogue app could silently capture and send somewhere screenshots of everything you are doing on your device.
Why this is not available to non-system apps:
Android let's SDK applications do certain things, and explicitly forbids others. An app is not supposed to read another app's data and similarly an app cannot capture another app's screen. Google has explicitly said that third party apps are not supposed to take screencaptures of other apps. The lack of screen capture API's is a deliberate decision, not an omission. ICS offers screenshot functionality, but it is implemented by the system, and requires a hardware trigger in order to make sure it cannot be started or accessed by third party apps.
While there are ways to do this, they either require root (to read the graphics buffer directly, which is device-dependent), or are not guaranteed to work on all devices/versions.
I'm writing my first Android game, and though the game itself is working well, I'm not too sure about some of the Android integration aspects of it. Specifically:
Should I provide an in-game volume control?
Should I hide the status bar?
Is the Menu button generally used to pause the game, or should I provide an on-screen control for this?
etc.
Basically I just want my game to do everything the "standard" way. I don't want to frustrate users. Is there some resource (official or not) that lists recommendations for such things? Alternatively, can anyone give me a few important guidelines?
There are no official guidelines how to do this, but some 'Android common sense' would be advisable.
As usual, there is more than one way to do anything, but most of the apps seem to follow the following principles:
full screen games (especially ones in landscape mode) seem to hide the status bar most of the time
you should override the menu button, so it does not get pressed accidentally, but provide a quick way to leave the game
back button usually pauses the app
you do not need in-game volume control since all of existing android devices include a volume rocker, but make turning the volume off available as soon as the game (splash screen) starts, preferably give the person a few moments to turn it off before the music start (a 'would you like to turn the music down?' dialog would be nice)
an (as usually on android) don't count on anything and specify special game requirements (trackpad support, min screen size, ...) in the manifest file
hopefully you can find some more resources online