I am trying to create a simple Android chat app where a user can sign up and have a friends list to start conversations. I am planning on using Parse for the database backend and PubNub for the actual chat channels.
I do not have much experience with this kind of an App. I have an idea of what needs to be done but just wanted an opinion from someone who has some experience.
Here is the model that I am planning to implement:
Does this look like I am heading in the right direction? Or can something be done better? Or is there any other service that I could be using?
This approach would work. You could create a channel for every user pair. You may not need to necessarily store the channel in parse. You could just have a naming convention - something like channel_user1_user2 In addition to standard publish/subscribe, I would also suggest using history api to catch up with chat messages that the user may have missed since the last connection. Also, you can use pubnub presence api to determine if any of the users are online
The android example at https://github.com/pubnub/java/tree/master/android shows how to use publish/subscribe and history
I have put together an open source instant messenger for Android that uses Parse and Pubnub here https://github.com/WizTheEngineer/DroidMessenger. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With