I am doing a project. For my project i need to create an Android application. I will use Java and Eclipse.
The main idea of app. The application works on environment/location. Example the applic开发者_JS百科ation needs to pick up on the users location. He should then also be able to communicate with his friends or colleagues which are in the same location.
There will be real-time communication. And the client must be able to communicate with the serve. The system will also set location by WiFi and GPS. A database will store information. Also it should be open source.
I have just started looking and reading up on XML-RPC, JSON-RPC and SOAP. This is my first Android application.
I am looking for a good alternatives to XMPP or REST for communication between servers and clients? Any recommendation would be appreciated or advice.
Kind regards
It really depends on your requirements. You might just stick to something based on HTTP(S), since it is easy to implement, well supported on Android, you have lots of options to choose from on the server side, works through proxies, and HTTP is allowed through firewalls virtually everywhere (think of restrictive firewalls when you use WiFi).
If you have special needs e.g. real-time communication, then it's a whole different story. But we should first really know more about what you're trying to do exactly.
Some parts of Android use Protocol Buffers to communicate: http://code.google.com/apis/protocolbuffers/
It's the mechanism that Google was using internally, but they've wrapped up and released the tools. The Markplace app uses protocol buffers to communicate between the client and server for example. It's a more compact alternative than many others, in terms of "on the wire" size of the exchanges. However, if you're going to have to support multiple platforms on the client side make sure there's appropriate protocol buffer libs for all of them, it's not nearly as popular of a technique as something like JSON or XML based systems.
If it should be real time you can use WebSockets: http://jwebsocket.org/mobile/android/android_part1.htm
精彩评论