user3075478 user3075478 - 1 year ago 90
Android Question

A good Android and Web Services structure

Suppose I have to make the following things:


  1. An Android app that must send informations periodically to a database (without the interaction of the user)

  2. Moreover, this android app, must provide various services to the user (user interaction)

  3. Also, i want to provide a web interaction to the user, and for it i would like to use Vaadin

  4. I use MySQL for the database



Is it correct to have this structure?

Android <--> PHP <--> MySQL Database (using XAMPP)

Vaadin (web side) <--> JDBC <--> MySQL Database (the same database as above)

Answer Source

Its not incorrect but you are creating double work. You are creating web services in PHP to service the android client call this API1 then you are creating a Vaadin based web site which also acts as an API call it API2.

Two API's in different frameworks to maintain which is just adding more maintenance and complexity. If the web site mimics the android application you will essentially be duplicating the code.

Or if you want that in pictures:

Duplication Of Effort

Create a web-services API that will be used by Vaddin and the Android application. This will eliminate the double work. If you create the Web-services using REST or SOAP you will be able to reuse those services across both front end application. Now when you grow the application i.e. you want to add iPhone you can simply consume the same services.

Or in pictures:

enter image description here

Hope that makes sense.

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