Travel Agency

s it possible to build a full featured instant messaging app using Parse.com only? Just to mention that the app is basically a group chat app where users login, choose group or "search/add" specific peer to chat with.

App features:

peer to group or peer to peer messaging
Users will be able to Send photos
Presence detection (Detect when user is online/offline)
Customized stickers


I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?

I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one? And how would this work? Some example code would be really helpful..

Tnx!
android instant-messaging google-cloud-messaging
shareimprove this question
   
asked Jul 6 "12 at 19:08
dumazy
3,87052563
   
add a comment
4 Answers
active
oldest
votes
up vote
14
down vote
accepted
   

The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.

    ...or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly).

So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)

So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
shareimprove this answer
   
edited Jul 25 "13 at 17:22
   
answered Jul 25 "13 at 15:24
appsroxcom
2,656514
   
        
   
Cool tutorial. How much time did it take you to create this? And how much people were involved? – mlatu Nov 10 "14 at 12:02
add a comment
up vote
8
down vote
   

Just my two cents:

I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an "online list" to all the apps.

GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate "XXXX wants to chat". They can then launch your app and automatically connects to a chat session.

Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
shareimprove this answer
   
answered Jul 7 "12 at 19:55
azgolfer
9,24343242
   
        
   
And do you know a some kind of alternative for IM? tnx – dumazy Jul 8 "12 at 19:53
4      
   
IM is a complex beast, it"s best not to reinvent the wheels if possible. Do a google search on XMPP, you may find some free or cheap solution that you can integrate into your environment. Also see this topic: stackoverflow.com/questions/4769020/… – azgolfer Jul 8 "12 at 21:00
        
   
Hi check out pub nub - it is pretty easy to implement - see if they have a java client here is a javascript only solution works on mobile. <stackoverflow.com/questions/7316186/…; – ozmike Oct 20 "12 at 1:25
        
   
I totally agree given that I"ve had some delays in message delivery and even some that were skipped totally. – Michael Obi May 4 "15 at 11:44
add a comment
up vote
0
down vote
   

Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with "no server". Code is for javascript but they also have java. Chat app using jquerymobile web app framework
shareimprove this answer
   

   

   

You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.



I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?

I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one? And how would this work? Some example code would be really helpful..

Tnx!
android instant-messaging google-cloud-messaging
shareimprove this question
   
asked Jul 6 "12 at 19:08
dumazy
3,87052563
   
add a comment
4 Answers
active
oldest
votes
up vote
14
down vote
accepted
   

The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.

    ...or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly).

So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)

So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
shareimprove this answer
   
edited Jul 25 "13 at 17:22
   
answered Jul 25 "13 at 15:24
appsroxcom
2,656514
   
        
   
Cool tutorial. How much time did it take you to create this? And how much people were involved? – mlatu Nov 10 "14 at 12:02
add a comment
up vote
8
down vote
   

Just my two cents:

I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an "online list" to all the apps.

GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate "XXXX wants to chat". They can then launch your app and automatically connects to a chat session.

Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
shareimprove this answer
   
answered Jul 7 "12 at 19:55
azgolfer
9,24343242
   
        
   
And do you know a some kind of alternative for IM? tnx – dumazy Jul 8 "12 at 19:53
4      
   
IM is a complex beast, it"s best not to reinvent the wheels if possible. Do a google search on XMPP, you may find some free or cheap solution that you can integrate into your environment. Also see this topic: stackoverflow.com/questions/4769020/… – azgolfer Jul 8 "12 at 21:00
        
   
Hi check out pub nub - it is pretty easy to implement - see if they have a java client here is a javascript only solution works on mobile. <stackoverflow.com/questions/7316186/…; – ozmike Oct 20 "12 at 1:25
        
   
I totally agree given that I"ve had some delays in message delivery and even some that were skipped totally. – Michael Obi May 4 "15 at 11:44
add a comment
up vote
0
down vote
   

Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with "no server". Code is for javascript but they also have java. Chat app using jquerymobile web app framework
shareimprove this answer
   
answered Oct 20 "12 at 1:32
ozmike
9591121
   
add a comment
up vote
0
down vote
   

You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.


Source
Stackoverflow.com


کلمات کلیدی:


نوشته شده توسط Abteen 94/10/17:: 6:30 عصر     |     () نظر