Can i create a program which will cut phone screen on two parts.
Those two screen will do simultaneously two things, for example to watch a clip and to read and write sms.
I think that:
1) i need to create a home luncher application first.
How can I create a custom home-screen replacement application for Android?
2) Then i can start two fragment in my activity.
http://developer.android.com/guide/components/fragments.html
3) Finaly i open app1 in first fragment and app 2 in second fragment. Can i do that, open an application in a fragment?
Any other ideas will be usefull.
I think you need a modified version of the Android ROM to be able to do this. With the standard ROM you can only have 1 application running in foreground at any given time.
Samsung has done something similar on the Galaxy Note by allowing you to watch video while doing other things.
If you don't want to change the ROM you could implement this on your own apps, but not on all the apps.
I'm no expert, but it seems to me that you can have one application with two fragments in it. The top fragment would display video and the bottom fragment would have the messaging. Since fragments are only API 11 and up you don't have to worry about old phones being able to handle it.
Your step 3 states that you'll open apps in your fragments and I don't think that's how they work.
You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in different activities).
Read more about Fragments here:
http://developer.android.com/guide/components/fragments.html
You can customize the launcher and the homescreen and lancher, check out the links below
https://android.googlesource.com/platform/packages/apps/Launcher2.git
How can I create a custom home-screen replacement application for Android?
Compile Launcher/AOSP from Eclipse:
Android Launcher application compilation on Eclipse
Read this for your information on how to compile and run your custom launcher.
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/zI9LPeU1mbc
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.
Is this is possible guys i want to add two different Activities of different application in a Fragment?
For example Video Preview and chat List view in a single view.
It is not possible to have two applications in one window. Each application runs under a different window session and cannot share windows. It is possible to display both windows side by side but the window manager has no stable API (it may change in any new version and it already did change in the history), and either each application would need to request that itself or you need root access.
Also, you understand fragments incorrectly. A fragment is hosted inside an acitivity, not the other way around.
I am a novice at Android, now, I need write a android app:two screens also shows two activities, boradcast advertising on the big screen, the small screen can be operated, and they are independent of each other.When people operate the small screen, the advertising will still play. I found the presentation class in the android 4.4 API 20,with it I can realize the two screens display different contents, I also refer to the Google demo, but Because the presentation depends on the specific activity, when the small screen operated, then intent to another activity, before playing advertising presentation disappeared. Then I came up with a method: The application only have one activity, the small screen using many fragments, but because the following screen operation is very complicated, it would be more trouble with fragment, my friends advised me not to use fragment, but I can't find other methods,who can help me?thank you very much(My English is poor,sorry)
Here is a detailed tutorial of Fragment. In my opinion, you'll be able to achieve what you want, only by using fragments :
http://www.vogella.com/tutorials/AndroidFragments/article.html
I am developing an application in android. I have situation wherein I have the need to call another app from the main app. Basically when the user presses a tab in the main app the second app should open and it should remain within the main app tab view.
I have developed the complete code for the main app. I also have the source code for the second app and the apk. I am totally not sure as how to integrate the 2 apps. Based on references I am understanding that we can call the apk of the second app from the first, but I am not clear on the same. Please advice or suggest any steps towards the same.
Regards,
Harry
You can't have one application load inside a tab of another application. You can easily have one application start a second application.
How to call one android application from another android application
I hope this helps.
I have situation wherein I have the need to call another app from the main app.
Why? You appear to be the author of both apps. Why not simply combine them?
Basically when the user presses a tab in the main app the second app should open and it should remain within the main app tab view.
This is not supported, on two levels:
You cannot embed another application's UI into your own, except via RemoteViews
Embedding activities inside of activities is now deprecated
I doubt it's possible to open up a view from another app in your existing tab view.
It is however possible to start the activity from another app by a button click. This will then allow you to go back with back button to your own app activity.