Android: Update sqlite db downloading file from webserver - android

I have a SQLite database in my Android application, and I want to update it over the internet.
So I decided to use a webserver were I can store a txt file with sql statements. Then I'll download the file, and execute sql statements.
Now I have some questions:
How I can protect the txt file? I don't want anyone to get access to my file using a normal browser.
If I protect the file or the webserver, how I can authenticate to download it?
Is this implementation the best way to update a local database over the internet?

You can add authentication layer to your web server and when you need to access the file just send Authentication parameters with your request and you'll be able to access the file. Not sure if its the best implementation or not, depends on your application. How are you planning to update your database second time, is user going to request update on database?

Related

Convert mysql data to protobuf

I have a HTTP server to respond to the rest requests from a mobile devices. Server data won't change frequently so I am thinking to store the data inside the devices. The data is read only for the users. So I am thinking to share the whole db with the devices as a file. If I update the db, I will create this file again. When user open the application, it will check for update time from the server. If there is an update, the device will download new file. I need to convert MySql db into the Android and IOS readable file. Protocol-buffers can easily read from the both platforms. Are there any way to dump MySql data into a protobuf. Or should I use a different mechanism?

How to create sqlite database in online storage?

I need to make a app that adds data to local SQLite database and uploads data to a database so other people that use the app can download that data. I thought about loading SQLite database to online storage but I do not know how to do that or what the best way is.
This is one of the simple approach:
Your app <--->PHP webpage <----> sqlite (on server) --->url of SQLite to download
Your app need to connect to a web api, such as PHP, that can handle sqlite. You can perform sql operators via the api and then get the sqlite file by simply using its URL.
Tutorial
1.First create sqlite database
2.then create oracle database
Setup Apache server like xampp. After setup open php.ini. then delete ; before oci8.dll. then save.
C:xampp/htdocs create php webservice .
5.Call php webservice from android for download upload data.
If you can't I will help you

Accessing external database from Android app

I have a sqlite database with about 15MB of data (too large to store on each device). I am building an app to interact with this data. How to go about accessing the database from wherever the app is being stored. I'm not asking someone to do it for me, but where do I go about researching how to do this. Is there an android module that does just this after being passed an ip address (or FTP Server IP?). Where do I start researching the best way to host my database and then link it to my app? What's the high level brief of how this is accomplished? Thanks!
Two ways
You can send a query to the web server and retrieve the result (you need the web server URL that received your query and send the result through HTTP).
You can download the database and put it in the app database directory and then you can query this database.

storing sqlite database online

Previously, I developed an application with an internal sqlite database stored.
Now I need to upload that database in an online server so that admins can easily modify the contents.
Is it possible for my app to access/use the sqlite database online?
The application is done on both ios and android.
For iOS it is not possible to access an online database. You should send the data to a server side script like php and from there parse it into your database. Only need to recreate your database format on the server end.
Or export the database as a file and import it on your server with something like phpMyAdmin or something. It can import all different kinds of formats like .sql, .csv, .txt.. Whatever you like.
Good luck!
Hmm, after rereading I think you ask the question if the app is able to use the database from an online source after importing it there? Am I correct?
Simple answer.. for iOS. No. You have to return results to the app by using a POST or GET request.

Android Database - Write and Read from Server

I need to design an Android application that stores a database on a device and a copy of that database on a server. This application also needs the ability to query the information based on username, date, and three other parameters. What is the easiest way to go about this? I'm new to programming and any help would be appreciated.
To create Database in your Device you can use Sqlite.Refer Android Documentation for Storage.
Also create a copy of this database on your server and sync these Server Database and Local Database.
(Or) you can use Syncing to the Cloud google cloud storage and sync the local device database and cloud database.

Categories

Resources