Building an app with group messaging feature. Suggestions? - android

without getting into too many details, I would like to build an app capable of messaging between small groups of people. Basically, I need an API that will allow me to a) create a group message, and b) will allow me to later add people to it based on their selections from the application itself. I am relatively new to server side coding and am looking for some suggestions, tutorials, suggested apis (google hangouts vs facebook vs any other services that would be of use), etc. I already have google plus integration with the client side and server side authentication, so it seems like if something is possible with hangouts that would be the easiest route, but again I am just looking for anything really at this point.
The way I was kind of (hoping) it would work is that some messaging service provides the group chat and gives me an ID to it, which I could then have the clients request to be added to a particular chat and then I pass them back the ID to the chat and it begins an intent that takes them to the app itself that is hosting the chat between my users. Let me know if this is possible please, along with any suggestions!

You might want to try researching the ejabberd messaging server. It is probably going to be a bit heavy for your needs as well as difficult to learn (it is in Erlang) but I've found it extremely steady as a back-end for building a messaging server.

Related

Develop a Instance Messaging Client + Server for Android

Hi I need to develop a fully functional IM solution (like viber or whatsapp) for android. It will have the basic chat features plus many more. Can any one direct me on this. I don't want to re invent the wheel so my target is to use the existing thing as much as possible for the chat server etc (some thing like jabber). If one can direct me for this, or give me some good advice for this it will be a great help.
Edit -
I will extend the application future to allow other platform clients like Windows Mobile or iOS clients. In that sense what would be the best technology to implement the server? It must handle real time traffic well. Will I be able to wrap or extend some sort of a XAMPP server to get my work done?
This is what you need. http://developer.android.com/google/gcm/index.html
It has everything you need for developing applications like viber, gtalk, instant messaging sistems, global user notifications etc...and its pretty easy to implement.
A good solution if you don't want to reinvent the wheel is to create a Jabber / XMPP client on Android and all other platforms.
Server-side, you can use an OpenFire server for managing the roster and conversations with the Smack Library
Google Cloud Messaging as mentioned Janbo is the best way for sending push notifications to your mobile app.
What you could look into, is something like Firebase. They have an incredible api for such applications
firebase link to android docs
Plus it gives you a backend at the same time for free.

Send text to app (not specific phone number)

I don't know if this is even possible, couldn't find anything usefull on the internet.
I wanted to make an app, that me and some of my friends could send a message trough "my app" and that everyone who has that app, receive the message, without using a phone number.
So basically, same as WhatsApp GroupConversation, but then without using a phone number.
Is this even possible?
If it is possible, could you put me on the right track to start with.
Hope I am clear enough, if not, tell me :)
Edit:
This just pops up in my head (didn't look on internet yet), but what I want, is a kind of a shoutbox.
This is possible, in fact WhatsApp does not use your phone number for this at all.
You simply provide your phone number to asure a unique ID and proof that you are indeed in possession of this phone with the validation SMS.
From there on, your phone number isn't even used anymore.
You can go 2 ways with this;
Create a simple webservice with a database on which you just save and request messages. Maybe make a little difference between get all or get latest message. Anyone, hooking into the group, can just fetch the same data. With the use of GCM push notifications, you can make this pretty instant.
Use XMPP, which is a chat protocol kinda all the chats use. Whatsapp, Google talk, FB messenger... This will provide you with instant messaging just like any other chat app or program you know.
Option 2 is by far the best in final functionality, but be warned that XMPP is quite complex and error prone.
You can look into the asmack and asmackx libraries for Android, which will give you the basic functionality with ease. Going a bit deeper, you'll have to dig into the protocol and really get to know it though.
ps. For both you'll need your own server, however with asmack(x) you are also allowed to use Google's Talk servers for free. Communication will go through your Gmail account. Basically with this you just make your own version of Google Talk.
It is possible by implementing server-client architecture. Your app will use a common database for all the users. whenever an user install your app, he will achieve an unique user ID. if anyone uninstall it, his id will be destroyed. You can track the users from those ID in database. You don't need phone numbers.

Is there a way to use GCM in Android without a dedicated server?

I am conceptualizing an Android app that sends data from one device to another (like a picture message), but because I do not have a server, I am looking into other ways of messaging. Google Cloud Messaging (GCM) seems like a good choice, since its made for Android, and is free to use, but it still requires a server to use. Is there a way around this requirement- such as running the GCM server on the app itself? Or is there a better approach to serverless messaging on Android?
Yes you can - it's possible to send the same messages from a device that would be sent from a server. However, this has the following problems:
You're putting your API key in your app, so somebody could decompile your APK to get it.
Your users would need some way to share their GCM registration IDs with each other. If two users had both their IDs expire at the same time, there would be no way to share them again.
Really, building your app and hosting it on AppEngine would take about an hour to write, and cost less than $10 a month, even for a ton of users.
For a dead-simple messaging server example written in Java, check out the server backing one of my apps:
https://github.com/charlesmunger/touch-to-text-server.git
I think that will be hard to do what you want effectively without a server but you can check out Parse's SDK. It is free to try and free up to a certain monthly limit.
The docs.
You may want to read "Sending Pushes to Channels" and "Using Advanced Targeting".

Android App With Server Interaction

I am trying to write an app that will have a web interface for business owners who can select a specific Android mobile app user via querying a database and then have either the website or database(a little unsure about how this would work) push information to the queried user's phone to create a notification for them via the app.
I have never created an app like this and the connection between the website, the database, and the mobile app on a user's phone are all a mystery to me. I've searched the Android developer website and cannot find anything that will accurately explain how to do this, and have also Google'd the topic without much luck.
All I ask is for someone to point me in the right direction to place the pieces together, any information you can provide would be greatly appreciated, thanks!
Your solution will almost certainly involve Google Cloud Messaging.
Implementing GCM will involve a server in which all devices are registered with a central service. So you are half way there once you have GCM implemented. Well perhaps more so, almost everything you mentioned is basically just GCM.
http://developer.android.com/guide/google/gcm/index.html
For this you can use PHP programming to interact with the website.
Refer Android App interaction with Web
and also
Android App Development and Web Server Interactions
These links will be useful.Good luck..

Android two player game to be played in internet

I have developed a simple two player chess game in android to be played using Bluetooth. I want to extend it by making it possible to be played through internet. whenever a player makes a move, the move should be transferred to the other player via internet.
How to make this possible?
I have heard of C2DM mechanism.Does that suites the scenario i described and is it reliable?
Thanks:)
Yes, C2DM is ideally suited to this type of game. This is what I am using for my own game (http://www.chesspresso.net) which is a correspondence chess client for android.
Things to consider when using C2DM:
You don't send the info to the devices, you notify the devices that a move has been made. You don't use C2DM to transfer data, you use it to notify that something has changed.
Its available for 2.2+ Android, which is the majority of devices. But if you wanted to support older devices you'd have to consider an alternative. I am using polling for older devices.
You have to request for developer access, then once your app is ready you have to request production status. If you don't do this you'll hit the developer status quota very quickly once its released! They are very generous with production quota, but you have to explain what you're using it for and it also can take a few weeks to get accepted!
Your users will have to have a google account that is authorised, otherswise C2DM won't work. Most users will have an account associated with their device, but some don't so this means that you'll possibly want to validate for the presence of an account to notify the user.
Its reliable, but every now and again a device will have to wait for the message. Sometimes a few minutes. Usually its instant.
Hope that helps!
UPDATE:
C2DM has now been deprecated, and replaced by Google's GCM.
Also, I strongly suggest looking at other options as tying yourself down to a Google specific API means you won't be able to support external marketplaces. For alternatives, I am currently evaluating Amazon SNS and I will also be looking at Urban Airship. There are possibly other alternatives I have not considered evaluating yet.
UPDATE:
Evaluation update of non google based push notifications:
Amazon SNS is just not a project for this task and Urban Airship for the vast majority of apps is too expensive. Unfortunately all the other alternatives are all very expensive also, especially if your app (like mine) relies heavily on push.
A good way of doing that is using a simple direct TCP connection between the peers.
If you're new to socket programming on Java, try this:
All About Sockets
Another option is to use some sort of IM as a communication medium for app. For eg. Use Asmack to connect to XMPP Im like GTalk. Prompt user to create an account there, for your game.
And use it to send and receive commands via IM. This way you won't need to setup your mediating server.
This works if user knows who he is playing with. To collect the user data and let them search for available players, you still need to setup a server. IRC chat room may be an option to avoid this also.
GTalk was just an example. You can use any IM or IRC also.
C2DM it's not design to transfer informations, even if they are small like "horse in b4" or things like this. It's designed to inform the device of something, maybe a newer version of a document or more articles on a website.. Stuff like this.. It's not designed to communicate device to device. And also it may be not fast enough for a real time chess play.
You should look for a more traditional way of communicate via internet or to search for some libraries (I'm pretty sure that something exists..) that will help you.
IMHO, C2DM is exactly the kind of thing you would want for a chess game; to be notified when the oppo has made his turn (which may be minutes /hours / days later ?). I have discussed my game with a few google android devs and they've stated that C2DM is ideal for this. You'll need to go via a centralised server though (well, not essential but very advisable) as there may be issues with resync'ing game state etc. Worried about "hitting the limit" ? Well, for a start my c2dm acct is restricted to "just" 100,000 messages per day. I guess you're buying the drinks if you hit that !!
Chess is often played by email. You could do that.
Of course, any centralized/federated messaging system will work.
What might be better for your use is to add a jabber client to the application and have the program generate an account name that is used for automated messaging. You could host the jabber server or generate the accounts on a free provider.
Google App Engine if you know Python or Java.
Alternatively there are two web app API styles in wide use today: SOAP XML and RESTful web services.
If you know RoR I would recommend using JSON/REST, because you can just use Phusion Passenger with Apache to deploy your app. Free, extremely easy, and makes your server very reliable.
You could, and I only mention this because my friends do this all the time, use twitter as a server between the games.
I also found a lib called mages which looks quite promising.
Good luck.
I did this for my online 2D rpg: http://developingthedream.blogspot.com
Basically, use a middle-man server to co-ordinate data between all your clients.
You simply open a socket and communicate with the middle server and it takes care of passing on the information to any other connected clients.
I wouldn't recommend C2DM because of the message limit, and because the latency is still to big. Using your own server you can optimize it, plus you'll be the only one using the service so your data will be delivered faster.
I think that C2DM is not right way for playing chess because there is no warranty that messages will be delivered. You need more reliable way for data transfer

Categories

Resources