Rubén M Rubén M - 1 year ago 58
Java Question

Developing app with web and Android client with Java

I'm going to start developing a new simple "X management" kind app, like contact management or events management. What I want to know is which tools would be the best to achieve it in the way I want.

My app needs to be a web app running on a server that has a mysql database to save and retrieve some simple information. This app must have a web client but I want it to be able to be extended to work with an Android app client.

Things I've thought:

  • I've worked on Java with facelets and JPA travels management app running on a GlassFish server on localhost with a JSF web view, so maybe my web client and the full app could be done with this.

  • I've worked with web services such as SOAP and REST with Jaxb and xml schemes to retrieve information parsing some webs into xml or json to show on a client .net app. So I've thought I can add to my app, like last topic we talked about, a REST web service layer to easily work as I want, or at least I think it would be easy. If I do this the Android app could share the same app core code but using the REST service.

My question is what could be the best way to do an app with 2 client side in different platforms that could share some code to be easy to extend it moreover to a desktop app. I've talked about these 2 options because I'm a students of computers at university and those are the tools I know, but I can easy learn more. I've also think about just a REST service and create a web and an Android client to work on same service or something like that.

This post is getting long, so here is the summary: What technologies and tools do you think are the best choice to create an java web app that needs to have web and Android client? Also what server, like tomcat, GlassFish or another, should I use? And what about persistence layer? JPA with mysql is the best I know to work with.

Thanks a lot.
P.D: I work with eclipse

Answer Source

From my point of view:

You can use java jersey and java spring both ( java spring as Dependency injection) for creating RESTful Web service. So, In server side you will create endpoint and you can access data from any platform through those endpoint.

Server can be anyone. It's up to you. I always try to use tomcat but tomcat is not a full JavaEE container it's only a servlet container. So if you want to use full JavaEE version then you should use Glassfish.

And yes JPA .It can be easily used in any environment supporting JPA including Java SE applications, Java EE application servers, Enterprise OSGi containers etc.

On the other hand, still choice is yours.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download