I'm wondering if it's possible to have my Arduino Mega control my Android tablet. My goal is to have the Arduino Mega remotely open apps on the tablet.
(I'm using a Movi Shield (Which is a shield for Arduino that allows me to control stuff using voice commands), so I want to have the Arduino Mega open up an app when I say a certain command).
Is this possible?
If so how would I go about doing it?
You may also require an OTG cable too, to allow two way communications between both devices.
That would allow you to also interpret serial signals which your sketch could generate using the shield.
It may make your life a lot easier.
You may also require an OTG cable too, to allow two way communications between both devices.
That would allow you to also interpret serial signals which your sketch could generate using the shield.
I have the cable it came with plugged into a usb charger, to keep the tablet powered. Although that cable can also be used to import files from my computer onto the tablet Would that be an OTG cable? (Also, right now I'm using a micro SD card to store all the files and memory on the tablet)
If so, would I need a splitter so I can keep the tablet powered and still have two way communications between both devices?
But where would I go from there? How would I get the Arduino to actually communicate with the Tablet?
(I know there's apps on the tablet which you can download and they allow the Tablet to control the Arduino, but I'm looking for the opposite. Are there any apps which currently do this? Is there a way to wirelessly (through Bluetooth or WIFI) to have the tablet receive signals from the Arduino?)
Remember, though, that Android is pretty fussy about anything that could present a security risk, hence the relative paucity of remote control programs for Android devices.
Not saying it can't be done, but there will probably be hoops to jump through for the app developer.
I will look into that, but I just though of this now:
Right now, I also have a Rasperry Pi connected to the Arduino, and the Arduino triggers the Raspberry Pi by acting as a virtual button which tells the Pi to play a certain sound FX.
Perhaps I can use the Pi to trigger apps on the tablet, and use the Arduino to trigger the Pi. With all that combined, I'll have the Arduino trigger the Pi by writing the Pi's pins either Low or High, and as a result the Pi would then trigger the tablet apps.
Would that be easier or should I just stick solely to the Arduino?
Opening apps can be done using a USB keyboard connected via USB OTG cable to an Android device. An Arduino board emulating a USB keyboard should be able to do the same. However, the best Arduino board for USB Keyboard emulation is one based on the ATmega32u4 chip such as Leonardo, Pro Micro, and Micro. USB OTG cable required.
This article is 10 years old but is still relevant.
This does sound promising. But, how would I go about programming that, assuming the OTG cable is connected from the Tablet to the Arduino (How do I program a USB keyboard emulation on the Arduino)?
And how would I charge the tablet/give it constant power through the micro USB port (since the OTG cable will go in the Tablet's USB micro port, which is where the charging cable goes)?
You can certainly send commands from the Arduino to your Android and vice-versa. That's not hard.
You need to learn how to build apps. Most people start this journey with MIT App Inventor. There are many examples of apps to connect Android and Arduino via Bluetooth you can build on.
There is an app that can check if your Android is OTG compatible (not all devices are). OTG is great for uploading yr app to the Android, but more common is via Bluetooth or the Internet.
Starting an app from within an app is apparently possible with MIT App Inventor, but it doesn't look particularly simple: