2

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..

scooby
  • 493
  • 11
  • 31
  • There is a multi-window concept in samsung grand 2 , but that is a OS property. I dont think that will be available for development – Viswanath Lekshmanan Jun 03 '14 at 19:01
  • I know this thread is old, but the option now exists in Android natively, with more advanced features available through the Developer options. I use split screen to play multiple games at the same time, so obviously it works for more intensive applications (than just say weather, calendar, and etc.). – jacktrader Apr 20 '18 at 16:36

2 Answers2

2

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.

matiash
  • 54,791
  • 16
  • 125
  • 154
0

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.

Carl Anderson
  • 3,446
  • 1
  • 25
  • 45
  • How about FLAG_NOT_TOUCH_MODAL? Cant we use it in someway to achieve the same ? – scooby Jun 03 '14 at 18:57
  • FLAG_NOT_TOUCH_MODAL is a flag that is set on a fragment or dialog such that touch events not on that dialog can still be processed by underlying UI components, but it still only applies to one application. It's probably most useful in some sort of game, where a dialog pops up and presents the user with options, but you'd still want to have a working "pause" button underneath it somewhere. – Carl Anderson Jun 03 '14 at 19:00