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?