开发者

android server side architecture

开发者 https://www.devze.com 2023-03-11 20:15 出处:网络
I\'m writing my first client/server android app, and need an advice regarding server architecture. My app is not a browser based app, but a stand alone client.

I'm writing my first client/server android app, and need an advice regarding server architecture. My app is not a browser based app, but a stand alone client. On server side i use hibernate/JPA and would like to transfer objects to client side. What should I use:

  1. Implement MVC- mean开发者_如何学运维ing writing servlets that will handle http requests (via Apache for example).

  2. Write my own stand alone primitive server, meaning using simple sockets connection(in java for example), and handle each client in a different thread.

if you can think on a better way, you're more than welcome to share..


HTTP is definitly your choice since many carrier will block other protocols, since application servers/containers will take care of handling the multiple connexions and since it will also be a base if you decide to have a browser-based version some day ...

REST + JSON based webservices are well suited for android, given its simplicity, lightness and readability, but SOAP is also available via kSOAP2.


In my opinion. writing your own socket server is only warranted if you are required to implement your own wire protocol. Most likely it's not a case for you.

So stick with http since it's widely adopted and has excellent client support in Android. As for specific server side technology, you need to enumerate your requirements and do some research. Don't start with Apache if plan to use Java, though. Pick Tomcat or Jetty. For framework, my personal choice would be Spring MVC.


Well, I have some experience in this very sphere and we used apache + php "covered" with nginx. I believe it's better to use standard approach, such Apache + PHP or Tomcat + servlets, cause it's easy to scale if needed and support... Of course it interesting to write your own application, but you might have some troubles with when traffic grows or server is down etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号