Android dialog in another application - java

My use case is very specific so I will explain it as detailed as I can.
I am developing an android application. I call this application A. Then there is an pre-existing application B. B is a navigation app that I cannot alter.
I want to show a dialog or pop-up whenever something special occurs in application B. for example app A receives a message through a broadcast that a dialog should be shown. then code in App A should be able to show a dialog in app B.
Is this possible to do in android? can I show a dialog outside of an application? if it is not then is it possible to show a dialog on the OS itself perhaps? I would like to ask if you can answer in a simple manner as I am not that experienced with android to begin with.
Thank you for reading.

Related

Launch my application when a user opens a certain application - Android

Is there a way to open my application when a user opens a certain application?
For instance, I want to launch my application's floating button as soon as the user opens Instagram. Or even better is they open the "story" camera?
This is different from inexplicit intent, since, I don't have a way of interacting with Instagram, but is it still possible?
Do I need to check with the system to see which application are currently open or is there another way of doing this?
As NomadMaker says, in general this is difficult to do because it would be a security issue. In fact, an issue like this was published as the Strandhogg vulnerability. That said, some apps (like LastPass) use/abuse the AccessibilityService API to get this information. This would be an OK way to do this if you're making an app for yourself, but is discouraged if you plan to distribute the app.

Clear other apps data programmatically?

I am developing an android application and i need clear the data of another application upon clicking an button.
i.e.: if i click button name "gmail" in my app,the data should be cleared of that "gmail" app
doubt:
1.Is it possible?
2.Do we need to be rooted our android device in order to do this?
° because greenify works with root access to force stop the other app flexibly.
I know that greenify works without root but pop that "force stop" ui screen of each single app to do that action.
MY APP FUNCTIONALITY:
I just wanted to develop an android apllication named "anti-theft cloud apps"
simply if an thief stols our mobile then my app detects when he changes the sim or an unique code send by mobile owner through sms from other mobile and logouts all the cloud based applications like gmail,google photos etc to protect our data to be stolen ,so in order to do that i thought of clearing other apps data(like gmail) PROGTAMITICALLY to logout. Is it possible
This is not possible with stock Android. You can do it with superuser, access root/data/data/PACKAGE and clear its content. But as seen in comment, this seems like evil thing.

Get State of Toggle Button in Another Running Android App

I am writing an App (MyApp) in Tasker that would need to read the State of a Toggle Button in another App (AppB) that I haven't written. It's for reporting purposes. I am a seasoned programmer, but are new to Android. Please bear that in mind:-)
Tasker have support for Java code, and have access to the full SDK of my Android 4.3 Phone.
The app will run on Android 4.3+.
I am already using AutoInput that is perfectly capable of getting the ID of widgets (Buttons etc) in other Apps, and AutoInput is also capable of Pressing these Buttons (AutoInput Accessibility must be turned ON). AutoInput will have support for what I am asking later, but I badly need it now!
So the question is:
How can MyApp get the State of a Toggle Button (with ID "toggle") in AppB using Java?
I am afraid this will not be possible by easy means. The applications in Android are isolated and cannot ask for others' applications controls due to the security policy. Without the access to the AppB code and possibility to change it this will not be possible.
The AppB would have to share the state of the toggle to your app: either via content provider or simple intent each time the toggle is changed. This requires changes in AppB code which I assume is not possible in your case. I see no other way to get around this.
I am writing an App (MyApp) in Tasker that would need to read the
State of a Toggle Button in another App (AppB) that I haven't
written
In Android, by default each of the application runs in its own process and each app is Sand-Boxed.
Therefore, you cannot read the data from other application until it is shared explicitly by the particular application.

Getting notification / listener when action is performed (chimpChat / monkeyrunner tool)

I want to get a notification if someone has performed an action in an android app from outside of the app. I don't want to make any (android) code changes. To do the actions I use the Chimpchat.jar, the .jar that the monkeyrunner tool uses.
To be clear: Can I get a notification or register listeners on components from outside of the app?
e.g.
Run my android app
My java application links into the device with chimpChat via the adb
The user touches a button
My java application gets a notification what was performed
=> am I able to get that information? If not, am I able to get the information on which position the tab was?
Hopefully it's clear what I want to do.
Thanks, soeren

Android: how to have my app open automatically?

Basically I want my app to start running in the background when the ACTION_MEDIA_BUTTON is clicked. I've seen other apps do this, so it must be possible. I just don't know how it is possible. Some kind of special manifest code?
Currently my app can receive intents from the ACTION_MEDIA_BUTTON when it has been opened (and even running in the background) via intentfilter that I register in Java code of the main activity (when the app is first opened). But how would I have this button just... open up the app?
For reference, the following app can already do this functionality: https://market.android.com/details?id=com.kober.headset
Much appreciated, thanks.
Use a BroadcastReceiver and register for the intent. See this Android Developers Blog post for more details.

Categories

Resources