Connect two android applications to send and receive data - android

I am developing a chatting app for android using phonegap , i have developed the UI but now im struck for how to connect two apps for sending and receiving data over internet, Messages in this case. I know this type of questions are not allowed on stackoverflow but im helpless.
Can anyone suggest what methodology or technology to use, i dont have a server all the data is stored locally in the mobile phone.
Thanks in advance.

Look at MQTT.
You can find references in http://www.eclipse.org/paho

Related

How can you share data between multiple android devices using the same Unity application?

I would like to get and send data to android devices that runs the same Unity application. Most data that will be sent will be booleans and locations (longitudes and latitudes).
I'm not sure if I understand your question, but if what you want is to make your Unity3d app/game communicate with other mobile phones using the same app/game you can either do it with: the internet, bluetooth, NFC. The easier solution is communicating through the internet which you'd have two solutions:
Create a server that will receive the data you want to send and which will "pair" the devices you want to send. Each device will send the data to the server and the server will then send the data back to the other devices.
Make some P2P solution(peer 2 peer solution) which is probabaly what you want. In this solution the devices will connect directly to each other and send the data.
Luckily Unity3D has a networking engine that can help you with that. Look at:
https://unity3d.com/learn/tutorials/topics/multiplayer-networking
https://docs.unity3d.com/Manual/UNetOverview.html
And here is a simple tutorial on how to use the Unity solution https://unity3d.com/learn/tutorials/topics/multiplayer-networking/introduction-simple-multiplayer-example

Creating a web server for communication with Android apps

I want to create a web server at home and upgrade it to communicate with my Android app. Eventually I would like to store SQL data on it and collect data from it in my Android app. I have no idea where to start, and I am worried that I might start with one tutorial which will eventually not be able to give me the end result I want.(I am looking for tutorials at the moment since I have no knowledge on server side coding or anything similar)
So I was wondering if XAMPP is the thing I am looking for? I found many tutorials on that but I can't find anywhere if it is possible to eventually store my SQL data and communicate with android app. Also I read that XAMPP is for testing purposes and I would like to start learning something I might actually use as a web server later on for commercial apps.
If not, what else can I use? Many websites suggest JSON server communication but I am still not sure if that is the thing I am looking for.
Install xamp on your pc
Create the php file to communicate with the android data
Use http://10.0.2.2:80/ as a server ip in your android project
Consider Following link for more information
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

How can i keep an Android Device as Server

I had a client and a server type of mobile application. The server app is on a tablet and the client app is on several phone devices. Now I want a client-server communication with this tablet and other devices. The client app will send data to the tablet and retrieves data from the tablet. The server app will show the data inserted newly in its UI. How can I achieve this? It possible in android if then please give me a solution. I have googled a lot and read about socket programming. But I didn't find a proper solution to my question.
please refer the following links for help-
http://developer.android.com/reference/java/net/ServerSocket.html this is for server side http://developer.android.com/reference/java/net/Socket.html and for client side

How to connect Arduino and Android to the same server?

I am making a project and I need to get data from the Arduino to a server (I don't have a server), and the read this data from an Android. And the same on the other way (from Android -> to the server -> to the Arduino).
I newbie to dealing with servers. I am trying to figure out which server to use (I need to save a database on it also...). I know this one:
www.parse.com
and I have read about Microsoft azure.
How can I choose with which one should I work? where can I start from to read about this?
and if you have suggestions for a free server, I would be glad if you tell about it.
There are many variables that go into the decision of what services you will need. Microsoft has a suite of IoT products that can get you going.
Here are some great resources to get you started on the Azure IoT suite. Take the time to read through and figure out which services you need.
http://azure.microsoft.com/en-us/documentation/scenarios/internet-of-things/
https://channel9.msdn.com/Events/Build/2015/2-67
https://dev.windows.com/en-us/iot
The biggest thing you need to consider with the server is the kind of data you will be collecting and how you want to store it. As far as being able to connect to the server with both Arduino and Android, any service you choose will be able to be accessed by both platforms.
Azure is a good option because there are a lot of pre-built solutions that you can modify. You can find a high level description of different solutions here.

for multiplayer online game: how to initiate data transfer by server and send data to android phone?

I'm very familiar with REST type of communication where the phone sends GET and POST messages to the server - essentially polling the server for updates. This worked well for apps where real-time data wasn't essential.
For a multiplayer game real-time data is essential; after a user has signed-in to the server the server needs to be able to send messages to the phone (instead of the phone asking for data).
Does anyone have any links to provide details on how this is done ?
Thanks to Selvin for pointing me to the "socket" keyword.
I've searched around and came up with the following online resources :
Incorporating Socket Programming into your Applications
http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/
Example: Android bi-directional network socket using AsyncTask
Example: Android bi-directional network socket using AsyncTask
If anyone has a book suggestion, please let me know with a comment.
You will need to implement Android Cloud to Device Messaging, Android's push technology, available on Android 2.2 and above.
http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html

Categories

Resources