Scentyoo
Posts: 4
Joined: Tue Mar 03, 2015 10:57 am

Start an Android App by pressing a button?

Tue Mar 03, 2015 11:06 am

Hello! Is it possible to start an App on my Android cellphone (e.g. Google Voice Search) by pressing a button connected to my RaspberryPi ? My cellphone is connected by wifi with my RaspberryPi.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Start an Android App by pressing a button?

Tue Mar 03, 2015 12:17 pm

Probably.

There might be many ways of doing this, depending much on if you plan to write an app on your mobile phone or not.

Personally I would probably try to use "Tasker" to do the work on the phone. And MQTT for sending the signal from the Pi to Tasker.

Scentyoo
Posts: 4
Joined: Tue Mar 03, 2015 10:57 am

Re: Start an Android App by pressing a button?

Wed Mar 04, 2015 4:40 pm

Thanks for your reply! Sounds great! I thought about writing my own app. But if it is possible to do that with tasker it would be perfect!! Could you please explain how the communication between Tasker and MQTT works? Do you have a tutorial?

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: Start an Android App by pressing a button?

Wed Mar 04, 2015 6:50 pm

You could install a SSH server on Android device and then SSH-in from Raspberry and execute actions of apps you want to run (you have to know/find them), like for chrome browser:

Code: Select all

am start -a android.intent.action.VIEW -n com.android.chrome/.Main -d http://example.com

Scentyoo
Posts: 4
Joined: Tue Mar 03, 2015 10:57 am

Re: Start an Android App by pressing a button?

Thu Mar 05, 2015 7:06 am

Ok, here is my scenario: I want to build the RPi in my car. Once I get in the car my phone should connect to the RPi (preferably by wifi). When I press a button I want to start the "Google Voice Search" on my phone, to interact with my phone.

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: Start an Android App by pressing a button?

Thu Mar 05, 2015 7:13 am

That can be done by profiles and NFC tag in the car too. If your phone doesn't have NFC then QRCode triggering the profile.

If you want a network between them then either you will have to configure WiFi direct connection or add WiFi access point. That will be more work, some codding etc.

Scentyoo
Posts: 4
Joined: Tue Mar 03, 2015 10:57 am

Re: Start an Android App by pressing a button?

Thu Mar 05, 2015 7:20 am

The Button is supposed to be for starting the "Google Voice Search". It is easier to push a button while driving than unlock my phone and start Voice Search.

Connecting the two devices could be achieved by setting up the RPi as accesspoint. I already use NFC to activate the wifi on my phone with profiles.

Return to “Beginners”