I am working on creating multiple displays on a single screen, i.e., I want to run two different activities simultaneously.
I came to know that, to achieve this requirement we need to change the surfaceflinger code and some hardware properties in the android source.
Can anybody help me in finding the exact procedure in modifying the surfaceflinger and other parts of the android source in order to get two displays
Thanks in advance.
You cannot run two activities simultaneously just by getting two displays. Only one application/activity can be run at a time on the activity stack.
Related
I have an Audio analyzer app that was exported from processing.org to Android.
It works, but it's not organized properly to extend its functionalities. Therefore, I'd like to start coding proper Android app with activities and everything needed from scratch and include existing code where needed.
But I have a problem, how to organize such app in proper Android way.
Quick description of app :
- app captures sound from microphone in frames and calculates magnitude spectrum of the frame
- app supports 3 possible graphs (time-domain, spectrum and spectrogram)
- app has 4 screens - fist screen displays all 3 smaller graphs and then user can touch each graph to get into separate screen with bigger screen
I get that those screens are probably separate activities under Android (4 of them), but I'm not sure how to use audio capture and analysis code that is basically active in background and serves data to be displayed to all activities ?
If you can give me an advice or pointer to some similar examples where I can learn about it.
Thanks in advance,
regards,
Rob.
Hello)I suppose that the best practice to organize such structure will be one activity and fragments inside of them.
For instance: one FragmentActivity hosts your fragments and displays them together. When you press on your layouts with fragments - you go for details to another fullscreen fragment.
To use background process you have to implement services - just like in any music app. About communication of services with activities you can real below:
https://developer.android.com/guide/components/services.html
Here you can read about fragments:
https://developer.android.com/guide/components/fragments.html
I have an android application working in mobile, this app has two types of activities ones that loads a list of items, and forms that open when you touch one item.
Now I have to port the app to tablet and the layouts need to be fully restructured to fit big screens, so much that the java code has to be heavily changed so i thought to merge both activities in one as shown below
Is that possible?
And if its what i need to use, fragments?
Can each activity still in its own class?(this is critical)
Can each activity have its own network operations and AsyncTasks?
Yes as you said you can use fragments for your situation (Infact their main purpose is to support different screens without code duplication). So you'll have only 1 Activity class and 2 layouts for different devices and you just need to do some run time checks and perform actions according to them.
Here you can find tutorial :- https://developer.android.com/training/basics/fragments/index.html
is not possible because only one activity working in single screen in android. i have one idea to put two fragment in single activity then use your own AsyncTasks network operation.
I'm trying to build an application that would run at the same time as another one, on top of it (hiding only partially the original app), that would display useful information for the user of the main app.
But it seems that 2 activities cannot run at the same time, overlap, etc...
For argument sake, lets say the app would be displaying date & time in a corner of the screen, while playing a specific game.
Anyone got any doc or sample code on how to achieve such a result ?
I'm also interested in how to know which app is currently running in order to decide in my app-on-top to be visible or invisible.
Any help appreciated :)
Thx
Looks like you are in need of Fragments: Fragments
The Android system is designed to be user friendly, and two activities at same time is not, so only one activity is on foreground at once. if you need the other to be running in background make it a Service, if you want to show some data and get back first one use a Dialog, finally if you want both you can either put them in one activity or use Fragments as #Tooroop suggsets.
Its propably too late ... but for others with the same problem:
check out how-to-draw-on-top-of-other-applications
and maybe also this if your app need to be on top on fullscreen apps
I'm developing an android app that needs 2 separate activities running at the same time, they both have their own layout. What i am doing right now is creating 2 different intents and start them in sequence. But it looks like they are not running at the same time, I have to quit the first activity to start the second one.
Can someone help me with this issue? If I can display 2 activities at the same time using split screen, that will be awesome.
Thank you!
Take a look at Fragments. They were originally designed with a different goal in mind, but they might work for what you're trying to do.
What exactly are your needs for the project? You can setup a single layout with 2 RelativeLayouts overlapping, and just bringToFront the one that you will need, and use Threads to do your processing. Not clean, but it would work.
I'm developing an android app that needs 2 separate activities running at the same time
That is not supported by the stock Android OS at this time. You will need to come up with some other solution for whatever problem you think you have. Fragments, as Mr. Cherkashyn mentions in his answer, would be one candidate.
What i am doing right now is creating 2 different intents and start them in sequence. But it looks like they are not running at the same time, I have to quit the first activity to start the second one.
Correct.
Can someone help me with this issue?
Step #1: Download the Android source code.
Step #2: Modify the OS to support displaying two activities at once.
Step #3: Compile your revised OS and put it into a ROM mod.
Step #4: Install that ROM mod on the device of your choice.
I need to split the Android screen into two parts and run 2
applications (app A and app B) simultaneously.
App A will run on screen 1 and App B will run on screen 2. Both are visible to the
users. I need to implement this thing in the Android Framework.
I do not know much about the android framework and this is urgent and should be done on android 2.1
Is this possible, if yes please explain the procedure to achieve this.
Thanks in advance.
Implement Application A as a ActivityGroup and run Applicatoin B inside of it.