开发者

How to store data accessible to both a web site and android application?

I’m developing an Android and web application that will function as a service (use the same data).

My question is how should the data be stored to allow for both the web and the android application to have access to the same set of data?

Should the android application con开发者_运维技巧nect to the sites MySQL server to store/access data?

If so how do I allow someone to access the data when they are not in a service area?


It sounds like you need to provide a REST or SOAP interface to the data on your webserver so that the Android app can get at it. As for providing access when not in a service area you would need to cache the data, or provide some sort of full data sync capabilities, to keep a working copy of the data on the Android device. I would recommend against letting Android devices connect directly to an external database, if that's even possible.

Do you have a fully functional web app that you are just copying as an Android app? If so I would suggest that you consider just letting Android users view your site via the web browser. Perhaps provide a more mobile friendly version of the CSS. This will get you Android, iPhone, Blackbeery and Windows Mobile support. If you need that webapp to be accessible when devices are not in a service area you could look into Google Gears or HTML5 client side database support. That would make your webapp accessible on Android devices that aren't in a service area (not sure about Gears or HTML5 support on other mobile devices), and it would also provide that functionality on notebooks/netbooks and other portable devices that might go in and out of service areas.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜