Making Android Chat Application From Scratch
Solution 1:
You can do the following
Make a persistent tcp connection between your device and the PHP server
When a message is broadcast send it over the tcp connection of each device
On the device process this notification and you are good to go.
If you want to use Java on the server side I have your project already finished and ready to ship ;) (just kidding)
But if you are interested check out the Device-To-Device messaging framework of OpenMobster Mobile Cloud platform. The project is free and open source. Here is a link to the Device-To-Device Framework: http://code.google.com/p/openmobster/wiki/D2DPushFramework
and http://code.google.com/p/openmobster/wiki/PushFramework
The above three steps are already taken care of by the framework. The developer just has to focus on the App itself
Good Luck!!!!
Solution 2:
Yes there is several ways to do this
- you can just post to the server and from the server send push notifications to the mobiles
- You can make the mobile keep checking for updates if it exists
Solution 3:
You will require to finish these steps ( at least ):
- setup a PHP web server
- register for Android Push Notification (you probably need that)
- create database schema
- write your own codes to allow users to submit & retrieve chat messages
- security !!!
Solution 4:
You'd probably want to use Google's C2DM, though it's not free.
Your php server would get a message from a phone, do it's processing, then make a HTTPS request to Google's C2DM service, which sends the messages to the destination android device.
Solution 5:
Don't use C2DM, its a deprecated. Please go through the GCM(Global Cloud Messaging),
please follow this link, http://developer.android.com/google/gcm
Post a Comment for "Making Android Chat Application From Scratch"