Search code examples
androidinputautomationsmscross-application

How do I open and use another android app through my own after a certain event?


I'm looking to do the following, but have no idea where to start, I have some basic android understanding and hope someone can point me in the right direction.

I have an app. That app waits for an SMS from a certain number. As I understand it's not so hard to accomplish using the content://sms/inbox content resolver. (this is as far I can manage on my own)

Upon receiving such an SMS I want to open another app (not mine) and press a certain button (or even navigate the UI until i get to it).

Is this possible to achieve? If yes, how?

I don't care how to, it can be a classy solution using libraries meant for it, or it could be brute force "record the touch input", but I really have no idea where to start in order to accomplish this.


Solution

  • The app you want to launch must have certain intents that you can invoke form you app when you recieve the SMS

    Intent intent = getPackageManager().getLaunchIntentForPackage("com.thirdparty.package");
    startActivity( intent );