Make a mobile device remote control for a tablet?

I am trying to create an application on an Android device that will control the application on an iPad or Android tablet. (I am testing Samsung Galaxy S2 and iPad 2).

The application is pretty simple. When you select a color on an Android mobile phone, that color is displayed on the tablet device.

The question is how to connect two devices. Only now I have verified that I can connect two devices using Bluetooth. In addition, Samsung has a β€œKies” Wifi Direct function (which I don’t quite understand) that allows the iPad to connect to the Galaxy as a Wi-Fi hotspot.

There are connections, but I don’t know if any protocol can be used to actually make applications talk to each other in order to get the control I'm looking for.

Should I use bluetooth, wifi or something else?

And anyway, how?

+7
source share
4 answers

My opinion is that you should not be so locked up on the physical media used to connect, either in WiFi or in Bluetooth. You should abstract this aspect, in both cases you will use sockets (I'm talking about Android), if it is Bluetooth, you will use Bluetooth Sockets if it is WiFi: TCP sockets. You may have an intermediate layer that abstracts the type of connection and through the factory to use Bluetooth or TCP.

Bluetooth - http://developer.android.com/guide/topics/wireless/bluetooth.html

For Wi-Fi, you should learn if P2P helps.

You will need two applications: - one on the tablet - a server that listens to commands from the client (change the color, do this or that) - the second on the smartphone - the client that sends the commands.

+7
source

I have created several applications that do just that between the iPhone and iPad. But the principle is the same. I used the Bonjour network. This is just a fancy name for ZeroConfig networks between devices. It was originally written by Apple, but with open source code, so it should also have Android support. Actually simple and easy to operate.

+5
source

If you already have a working connection, you already have the first half of the answer, which says that you should really consider introducing a solution that uses various types of connections, WIFI, Bluetooth, etc. The question that I think you are really asked is how to transfer data and messages between applications when you have a connection.

There are many ways to do this. You can implement your own lightweight messaging system. If you have not done this before it is more complex than it seems initially, the more so that you will need to implement a system for each OS that you ultimately use.

+4
source

Should I use bluetooth, wifi or something else?

It depends on the situations in which you want to work in your program.

Bluetooth can provide a direct connection between your devices. The potential problem with bluetooth is that it has a limited range. If you need to be far apart, you can go with Wi-Fi. Otherwise, bluetooth may work fine.

If both devices are connected to the Internet, you can make them talk to each other. The advantage of this approach is that it doesn't matter how far apart your devices are from each other as long as they are both online. The downside is that you will need to figure out how to find the IP address of the tablet before you can talk to it. This is actually a HUGE drawback because it can be quite problematic if both devices are not on the same Wi-Fi. You can enter the user type in the destination IP address, but you will have problems with its operation if the user is behind the router (which will almost always be the case). The fact is that he is getting hairy.

If both devices are on the same Wi-Fi, you can use the ZeroConf AKA bonjour (e.g. Dancreek) to find out which IP address you need to send the information. Earlier, I used the jmdns library (easy to find using google) to implement a zero network configuration. This is good because the user does not need to worry about IP addresses ... it is intuitive for the user.

And anyway, how?

The network is a pretty big topic, so I can’t talk in detail about this issue. Short answer: it depends on which method you choose. Find some tutorials and start by sending one of your devices something simple, like int, to the other.

+1
source

All Articles