I am looking for some assistance. Long story short, I have most of my UI done for an Android app. That being said, I want to read questions (strings) from a web-based server to populate the app, rather than a local database. Essentially, I want to be able to add items to my web database and have the Android app query it to retrieve new questions, as well as submit responses. It turns out, the SQLite aspect is a bit over my head.
So I'm looking for two things: help with deploying a local SQLlite db that I can query and write to for now, that once I am done testing, I will deploy on a web server for anyone who downloads the app to utilize. Obviously all the writing and querying will be invisible to the user, but I need to code it in anyways. And then the second aspect will be the actual accessing of the db in Android via code. So far I've pulled off downloading text and images from webpages without too much trouble.
In terms of what I have done, I have downloaded SQLite Database Browser from Sourceforge and made a local db, but I can't determine how to access it via Android or to make it a locally hosted, rather than just local db.
I don't necessarily need code from anyone directly, I am just having trouble finding a good tutorial/guide that applies to my circumstances well. Any suggestions?
Edit: Someone on another server just said this: "SQLite is not a suitable choice for this, it's typically meant for being embedded in an application. Have a look at MySQL or PostgreSQL."
So, if anyone knows of the same type tutorials for MySQL, I'd appreciate that:
1)deploying a MySQL db onto my local machine (that I would eventually move to a webserver, even if it's just a second deployment)
2)programming an android class to query and write to said database
preguntado el 09 de marzo de 12 a las 22:03
If I was you then I would write the server using Google App Engine and use whatever data format you want to send data back to yourself. Then just read this page to learn how to start using SQLite databases inside your own app so that you can manage the data on the client side. If you become well versed in those two then you should be on good ground to build any client-server app that you like for Android devices.
I used this tutorial word for word, only changing my data base user/password/address/database: http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Beyond that, I am now in the process of adapting the tutorial to implement ASyncTask so that I can run it on all Android devices.