I would suggest you should use a given service like PubNub (see Demos).
That way you could save your Server-Development, there is also a Android-Example
You simple use it within your APP like this:
dependencies {
....
compile 'com.pubnub:pubnub:3.7.4'
//'com.pubnub:pubnub-android-debug:3.7.+' For the debug version
}
and
import com.pubnub.api.*;
import org.json.*;
Pubnub pubnub = new Pubnub("demo", "demo");
try {
pubnub.subscribe("my_channel", new Callback() {
@Override
public void connectCallback(String channel, Object message) {
pubnub.publish("my_channel", "Hello from the PubNub Java SDK", new Callback() {});
}
@Override
public void disconnectCallback(String channel, Object message) {
System.out.println("SUBSCRIBE : DISCONNECT on channel:" + channel
+ " : " + message.getClass() + " : "
+ message.toString());
}
public void reconnectCallback(String channel, Object message) {
System.out.println("SUBSCRIBE : RECONNECT on channel:" + channel
+ " : " + message.getClass() + " : "
+ message.toString());
}
@Override
public void successCallback(String channel, Object message) {
System.out.println("SUBSCRIBE : " + channel + " : "
+ message.getClass() + " : " + message.toString());
}
@Override
public void errorCallback(String channel, PubnubError error) {
System.out.println("SUBSCRIBE : ERROR on channel " + channel
+ " : " + error.toString());
}
}
);
} catch (PubnubException e) {
System.out.println(e.toString());
}
If you are looking for ideas how Uber is doing this, look at the tutorial "The PubNub Connected Car Solution Kit"
So I hope I could answer, how Uber does this and how you can make it better :-)