0

I am trying to develop a system that involves a:

  1. server with a database that will handle the system's logic and manipulate data
  2. an android app that will interact with that server (pull and push data into the server)
  3. a website that will do the same as the android app, but from a website with slightly different data.

What I thought of is to use SQLite with Apache Tomcat installed on the server and deploy a Grails war file on it. That will take care of the 'website' side of the system. But what about the android app? Can it communicate with Tomcat as well?

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
Martin Klosi
  • 3,098
  • 4
  • 32
  • 39

3 Answers3

1

If you have an API that is web accessible, an Android can access it.

Dan
  • 1,002
  • 12
  • 24
1

Android shouldn't have any problems communicating with Tomcat. Look at http://grails.org/doc/latest/guide/13.%20Web%20Services.html for more information. A RESTful web service is most likely what you'll need. Android can consume SOAP web services but it requires more work for less overall functionality.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
DOKKA
  • 165
  • 7
  • what about if I want to do smth like ... twitter for example. they allow the user to download their API and the user can import the classes of that API in his code and just make calls to twitter's classes. User doesnt have to know anything about Twitter URIs and hhtpRequests and responses. I guess that is all part of the Twitter's API source. I tried to see what goes on inside those classes, but I can't find that source. Does Twitter uses REST internally in this case? – Martin Klosi Oct 01 '11 at 04:47
1

Tomcat will suit your needs. I would look at hosting options though. Are you hosting your own server, or do you have a hosting provider? Do you have experience hosting a tomcat server etc. Do you have experience with java web applications, or other web frameworks? All of the above, and probably more should lead you to your decision on what type of framework/language to use on the server. This in turn will lead you to your options for hosting, and web-container to use.

Once that is determined all major web frameworks will allow you to publish web-services Rest, Soap, etc. that can be consumed by an android application.

Also, if you are planning on providing a web interface and service at the server level, my guess is you are going to be storing a fair amount of data, I would look into a more robust and scalable database such as mysql or postgres. This post contains some insights into this.

Community
  • 1
  • 1
broschb
  • 4,976
  • 4
  • 35
  • 52
  • well, this is a school project and the bigger part of the project is to learn. The problem is that our team doesnt really know what we need since this is the first time we've done smth like this. It would be Ideal though to have some kind of architecture that allows the android app to use an API that is shipped with the app (meaning is part of the app) and it uses that API the same way I would use Twitter's API (explained above). – Martin Klosi Oct 01 '11 at 04:54
  • Given that it is a school project, i'm assuming you are using java, so I would probably go with tomcat as an application server, especially if you have experience already creating java webapps. The twitter api is rest based(https://dev.twitter.com/docs/api). If you want to provide a client to your webservice, you would still need to create a web-application that exposes a rest based web service. You could then create a jar that contains methods to interact with the service but hiding the complexity of the calls and translation of the json/xml. This could be included in the project. – broschb Oct 01 '11 at 14:56
  • Some examples of how to consume a rest service in android in can be found easily with some quick searches.(http://timewasted.net/?p=127,http://stackoverflow.com/questions/3505930/make-in-http-request-with-android,http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/). If you are going with tomcat, then I would probably use jersey for your webservices, info can be found here(http://www.ibm.com/developerworks/web/library/wa-aj-tomcat/). Now it's up to you and your team to dig in and start getting your hands dirty. – broschb Oct 01 '11 at 15:01