So I got a simple app with a sqli database,
the app just shows the content which is saved in the database.
So if I am correct the sqli database is saved inside the app (apk),
what I am questioning myself is if I do have repeatedly upload the app / apk if I change, delete or add something in the database.
If yes is there a way around this, to like get the data from a database without repeatedly uploading the application if data has changed.
Yes, if you change something in the database you need to upload the apk, because the database is inside the apk. The alternative would be to put the database on a server. Then you would write a back end for your app in your language of choice, and this code would access the database. You could also use a Back End As a Service. Google BAAS to get info on the available options.
Related
I have a problem, I build an application for android that can open a single led with the use of bluetooth module and it succesfully works, now my problem is what if I want to open my led in my home while im at my office. What will I do is I will left another android that can open the led in my office and I will make another android application that will pass a data in my database and that data will retrieve by my android in my office and will trigger to open the LED.. I need tips on how I will gonna do that.. thanks
What you can do is have a realtime database like Firebase Realtime Database to store your data you need to communicate. So when a data is changed or updated your Phones will have the fresh data in sync. and then you can trigger changes accordingly
For eg, if the device in your office, clicks (Turn On LED), it will update the Firebase database with a value like (true), on the other side the device at your home would read the value, and check if the value is (true), then run the code to turn on the LED
Theme : Newspaper updates in android application.
How to fetch or retrieve data from server and post updates on android application . How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application , atleast how it consider showing updates on android application . If any one known this issue please answer about it .
I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? whether is it necessary to have permission to access the server files ?
More about the topics : if i want to syncronise the update with website , how do i handle it or implement it ? i am not asking any sort of coding here .
How to fetch or retrieve data from server and post updates on android application
use HTTPClient.
How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application
I think you don't understand what offline storage means. If there is no internet connection, that's it. You are not able to update your content. Offline storage is useful if you have internet connection, but not everytime. The content you downloaded when you had internet connection can be saved to SQLLite to be loaded when you don't have internet connection.
I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? whether is it necessary to have permission to access the server files ?
Create WebService as an interface. Do not let other system to be able to directly access your files. Or just create a PHP files that basically return Json or XML Data.
Other option : create an RSS.
More about the topics : if i want to syncronise the update with website , how do i handle it or implement it ? i am not asking any sort of coding here .
Create an event to start sync using HTTPClient. If there is new update, save it to SQLLite(for offline storage) and display the content. The event can be triggered during the start of your application or clicking refresh button and if Internet exist.
Update :
There is a new framework called couchbase mobile. You can sync the local mobile db from a couch server. You can insert/update the data locally(offline mode) and then the data can be synced also to the couch server, whenever you have internet connection. This means the need to create HTTPClient is no longer necessary.
For the database, try cloudant.
I am want to do registration in my app. So i have made all requests to my web service.
I now when user is registered.
Now i need to save somewhere that he is registered that don't give him registration form again.
How to do this ?
Do i need to save somewhere in my sqlite database and every time when app lunches check if he is registered user. Or maybe in app settings i could save this information.
I am new to developing android app and i am searching for the right way.
Thanks all for help.
You could save that with SharedPreferences. Check the link for sample code.
http://developer.android.com/guide/topics/data/data-storage.html#pref.
This data will be removed if the users uninstalls the app or clears all data from system menu.
Edit: If you really want to remember preferences across installs you should try Backup API. http://developer.android.com/guide/topics/data/backup.html
The best solution is to use Android's Account Manager to handle user account. This aproach is the most secure (credentials are not exposed), however it has two drawbacks:
It's a little bit complocated to set up
It requires at least API version 5
Once the user registered you can save in your sqlite database and you have to check for each time when your application launches. But if the user uninstalled the application and tried to reinstall it ll ask for registration again.. In order to avoid this you have to store the information like the device id and the registered details in some servers and also in sqlite database and have to check when the application launches...
I would like to write an application for iPhone/iPad which will use a database. This database is populated by a third party server so I would like to know what is the best method (SQLite,...) if I just want to drag/drop the database into my app. The database might be big so I don't think XML would be good.
What do you think?
Enable iTunes File Sharing for your app by adding UIFileSharingEnabled to it's Info.plist and setting it to YES.
Then write your app with a mock DB in place. Put the mock DB into the documents folder.
Every time you want to update your DB, simply connect your iPhone to your Mac, open iTunes, got to file sharing and drag-drop the new DB into the sharing window. This will overwrite the old DB without you needing to rebuild or reinstall.
I have problems.
I create an application which is on starting it will synchronize the database in external storage with database on website if any data changed it will appear dialog to ask "Do u want update".
I put my database on website http://example.com/folder/mydb.db
and for android I put it on external at data/data/database/mydb
How to check any database changed?
Change the name of the file you upload, adding the version number so you can just compare the file name to check for modification.
If different, download and override your existing DB using the tutorial here:
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/