Need to launch one android application (say Watsapp) from another android application (custom application) . I could achieve this using intent. My problem is : Once watsapp opens, it is not returning back to my custom app. Watsapp should run in background and control should return back to my custom app.
If you are working on rooted device, you can use command to kill process instead
Related
Currently, I app developing an application which uses share intent. but when I share a file to my app, my application starts another process.
Steps to reproduce.
start the application.
go to gallery/file manager.
select a file and share to the current application.
Show list applications are running.
Result:
My application starts in two different processes (Please see the screenshot)
I got the answer. It needs android:launchMode="singleTask/singleInstance" in the activity.
Is it possible to launch an application within another application in Android and iOS. Something like this.
In Android - No, every app in Android runs in its own "sandbox". Only one thing you can is start another app via intent if you know the package name of the app like described in this answer. But the app will be started separatelly.
If I'm writing my own Android app, I know how to structure it as a Service so it will start running in the background.
However, is there a way to launch an existing app (for example, any random .apk from the Play Store) so that it starts up in the background, without its screen taking over the display?
Alternatively, I'd be willing to launch the app, force it into the background, and redisplay the window of the previous app (whatever it might have been) that was running in the foreground. I don't know how to programmatically put the current app in the background and then determine the previous app and bring it back to the foreground.
I'm willing to do this any way possible: via Java, via one or more command-line utilities, via a Tasker plugin, via an Xposed module, or whatever.
Thank you in advance for any pointers to docs or any suggestions.
I discovered that the #0 entry of "dumpsys activity recents" gives the currently displayed activity ... at least on my rooted Marshmallow device. This gives me what I need.
Basically i want to write a E2E test for my app as an SDK app used by another app.
I have an android app A that invokes another android app B.
I want to write test that starts app A, clicks on a button which opens app B.
I then want to click a button in app B. Which terminate app B and return the focus to app A with some data.
Is it possible to get the context of app B when it's open by app A?
Meaning to be able to click on elements from app B even though it was open by an intent from app A and not open by appium?
Usually I open an app myself and get it context from that.
like this:
AndroidDriver AndroidDriver = new AndroidDriver( "http://localhost:53761/wd/hub" , capabilitiesObj);
What do you mean by get the context? If you're talking about switching between a web view or a native app, then that operation is done on the driver itself.
If you're talking about having the ability to interact with elements on the screen for app B, then you can also do that. I currently open a separate app using adb, and Appium seems to recognize whatever view is on the screen.
i'm building an application and need a layout that shows another application, there is any way to open the another app from in my own application?
(i don't want an intent to open the normal app, I want to open it from in my application)
I need that because my layout have some good animation(for example, fade in and out every 20 sec)
for example -
You cannot start another application within your application. this is now how android works. The only option you have is to start the application using an intent.
From Android documentation: https://developer.android.com/training/articles/security-tips.html
The Android Application Sandbox, which isolates your app data and code execution from other apps.