开发者

Needs workflow ideas for Android app

I'm planning on writing an android app that can view and update data on 开发者_JAVA百科a local network Oracle DB.

I have already written a python script which checks the oracle db every couple of minutes and writes out XML files which I then plan to parse through my android app to display the data.

As I mentioned though this will only work if the android device is part of the same network (either connected locally or through a vpn), and the XML will be stored on a Unix server.

The question is how to access that Unix server with the android app? Can I use FTP via an android app, or should I be looking to change the python script to send the XML to an easily retrievable location?

EDIT To clarify what you mean, you have a web service running on something like tomcat, the client sends a request to get the data from the oracle db (can also use some form of authentication), the web service responds and sends the data in a format (XML, JSON etc.), the client then sends a request back to the web service to change some data on the oracle db, and in turn it does the clients bidding?


Normally you would create a web service to provide data to mobile clients. There are several reasons for this:

  1. Web services are accessed via HTTP/HTTPS which is a standard protocol and is guaranteed to work on all networks. Corporate wifi networks are especially notorious for locking down protocols except for web and email.

  2. Web services compared to static XML files have an advantage of creating response on the fly. Which means that data will be current.

  3. Web services can take some input parameters and create response based on this parameters.

  4. Authentication: it is a common approach to implement username/passord authentication in the web service, especially if you serve some private data.

Update:

REST is a very popular type of web service. Look at some implementations in Python: Recommendations of Python REST (web services) framework?


This book helped me a lot: http://oreilly.com/catalog/9780596529260

REST is a way of designing your web service. Folks much more intelligent than you and me have divined that all of the work needed for something to work on the net can be handled through a combination of HTTP status codes, HTTP verbs like POST, GET, DELETE, PUT etc. and a clear hierarchy of resources (nouns). It sounds very limiting but it's quite beautiful when it all works together.

Have a look at the Facebook Open Graph API (developers.facebook.com) to get an idea of what a proper REST service looks like.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜