简体   繁体   中英

Android To Web Database Connection

Can someone give me a broad overview of what pieces would have to be in place to implement a user-content-driven Android app with a web-based database? Or, link me to some helpful relevant articles on web and app architecture to study?

Further, if II already have a website where people can add content and others can vote on it, and I want to have the same capabilities available via an app, utilizing the same central database, how would I proceed?

I'm guessing I could provide remote authentication into the site via the Android app, and then enable the user's content submissions and votes to sync with the database (and website), but how is that handshake process done? And what elements of the site have to be exposed for the app to "connect to"?

Where are lines drawn between a website just being presented inside an Android web view and being made mobile friendly, versus a stand-alone app having the web/database functionality?

I know if I already have a mobile-friendly website, it might seem logical to simply direct people to the mobile site, but obviously a lot of people use apps and there are some benefits over mobile web.

Sorry for such a general question, but I can't seem to find any good examples of people doing this to learn from, even though I imagine it must be very common.

Thanks!

The best practice is to build REST API on server side to manage content from database, and just hook to it with mobile apps. There is a lot of different libraries to do that on both Android/iOS

create your rest api and make it return json. i think that the better way is to use okhttp http://square.github.io/okhttp/ for http connection, retrofit and gson http://square.github.io/retrofit/ for parsing json results;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM