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.
Related
Currently I am trying to build my school project in Android and I am afraid I have chosen a really difficult project to complete. I would ask if it is possible to open a 3rd party application in a small window within my application. When I try to start a 3rd party application via a button click, the application starts and I cannot go back to my application any more. I want to start another application IN my application, take a screenshot of it, and close this small window. I would kindly ask you to help me in this subject. Thank you very much in advance.
I would ask if it is possible to open a 3rd party application in a small window within my application
No, sorry.
I want to start another application IN my application, take a screenshot of it, and close this small window
You can start an activity via startActivity(). With user permission, you can take a screenshot of whatever is on the screen, by means of the media projection APIs. You cannot:
embed the UI of the other activity in yours
open the other activity in a "small window" (though the user could, using split-screen capabilities in Android 7.0+)
At the end of the day, I decided to use multiwindow. Adding the line below into my code, I made it to run in a small window. Then I was able to start the other activity in the big window.
I'm developing an AR app that's going to contain an activity with a Unity3d model. Creating such an activity is something I can do now but I've come across another problem.
To show a unity model in an activity, the latter has to extend the UnityPlayerActivity class. What if I want to load the 3D model as soon as my launch activity starts but show it in one of the following ones? My goal would be to have the user wait for the model to be loaded as the app starts (e.g. when I show them a splash screen) so that when they change activity to the one that contains the AR view the waiting time is minimal.
I know this is possible in iOS and would like to replicate that behaviour in android as well. Any ideas?
As I suspected - there aren't any answers to my question.
I'll answer my question myself with a workaround, then, and wait for someone else to come up or for the creators of Unity to provide us with the same functionality under Android as under iOS.
To achieve the desired effect, I decided to only have 1 activity and multiple fragments. The activity extends UnityPlayerActivity meaning that when it loads, that takes the time Unity needs to load. Then, when navigating throughout the app, I only swap fragments containing entire screens and make use of the UnityPlayer.pause() and UnityPlayer.resume() methods, as well as the setVisibility method to make it go away.
Hope that helps if anyone has any similar issues.
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
I have an application that needs to launch calculator application in resized window on demand and then be able to close the calculator application using close button in my app.
How can this be done?
It cannot be done. You cannot embed other applications' code or UI in yours, outside of app widgets.
Also, bear in mind that LocalActivityManager is deprecated, and so you should be trying to phase out your use of this class over the next several months.
Suppose i have an application "MyApp" which has a button and when clicked it should start another application say"App2" but this "App2" should not be installed on the phone it should dynamically be executed.how do i do this in android.it will be helpful if u can explain with some sample code .
thank u
As I know, if you want an app to run on the phone. You should have it installed or install after the your presses the button. It cannot be just run from the RAM and close it..
Other way round is, You have two activities 1. main and 2. supporting.
Onclick of button on main, you invoke the supporting activity. But this supporting activity should be a part of the main app. Hence it will not be installed as a separate application.
Regards,
Vinay