i am doing one application.In that i am using sqlite database.I am storing my information in that sqlite file.But when i install my application in device,user able to access the application database file using iExplorer.Using this application,user can change or delete the database? If yes then how to stop this process.
The only thing you can do is encrypt your data in the database, or find some way to encrypt the whole database file. Look here for some suggestions:
Encrypting SQLite database file on iOS
Related
I'm working for an iOS app that was earlier developed using phone gap. It is having a sqlite database for storing data. But now while developing the same app in native, I'm using core data for storing the data.
Now when the new native app replaces the old phone gap app on user's device, I want to copy data from already existing sqlite file into core data.
So when I run the application on device with phone gap build pre installed my app(native) replaces the old build as I'm using same bundle ID but I'm not able to find out the path to that sqlite file. Does sqlite file still exists in documents directory?
If you have an example old database file still installed on one of your devices you could try downloading the App off the device using the Device manager in Xcode.
Then you open up the bundle and search for your file. Then if you know its location / name you can simply access it, read it using some SQLite library and load the data into your CoreData backing store. Keep in mind you either want to mark it in NSUserDefaults or delete the old DB all together so your app does not keep on migrating ( And then maybe accidentally deleting new data from a user. ) I would choose for keeping the old one around for at least a version or 2 so you can verify that your migration works without bugs / deleting user data in the process.
Tip: It is probably a good idea depending on how big your database is to show the user some kind of progress or "migrating / optimizing db" while you're doing this. So you don't end up with the user adding more data to the database before you're done migrating.
I use this https://github.com/sanathp/DatabaseManager_For_Android sqlite manager for my android project which helps me a lot. It's a single class file that enabled me to see my database tables. So I didn't had to work blindly. I could see my database when I'm running the app on device with this manager. Is there any sqlite database manager library for iOS similar to this? I'm using swift for my project & for sqlite database I'm using Sqlite.swift project. Thanks.
Though in android you have it as a activity i kind of have a separate mac app call SqliteBrowser by which i will manage the data
Check it here: http://sqlitebrowser.org/
I would locate the sqlite file in the documents directory(Or location where you store your sqlite file) and will load the sqlite file in this manager
To check the data is inserted correctly
To insert data and check whether i can retrieve via code
The tables inserted into the DB are correct
also you can use sqdatabase sqlite database manager ı made this application for check database you can insert update browse and delete or only check your datas easy to use
link corrected sory you can check from here
I am developing my first application for iOS. I use data I uploaded in the Sqlite Db using core data.
I would like to know if the Sqlite file is included in the generated Archive file by Xcode, if not, how to have these data available in the final application in app store ?
Thanks for help.
Yes, you can include the database as part of the other resources just like any other resource. Note, however, that it will be read-only, and you can only use it as a read-only database for searching, or for seeding a read-write database.
I'm using a sqlite database in my iOS app. I have all its tables definitions in an .sqlite file I've placed in the "Supporting Files" group of the Xcode project, and in code I copy this file to "Documents" to be able to perform database operations. While developing, I've found that, when I need to add/remove a table or change its fields and I remove the .sqlite file from "Supporting Files" to add the new one, then I need to uninstall the app from the device or the simulator and build again to get the new database.
How could I make changes in database tables by replacing the .sqlite file without having to uninstall the app? When the app will be submitted to the App Store, will the users have to reinstall the app when a new update with changes in database is available?
EDIT. Is it possible to replace the database and to keep/copy the data the user had in the old one? Or will user loose all the stored data when downloading an app update from the Store where the .sqlite database is replaced, as if he were installing the app from scratch?
I've never submitted an app to the Store yet, I need some guidelines about how to handle app updates if I need to make changes in database tables when having such database in an .sqlite file. I'm not using Core Data.
Thanks
for it, you need to modify database by using programmatically. Means, if you want to create/add new table in database then you need to add code like Create Table.... In this case, you can't use predefine database in code.
But if you want to use database instead of writing code, then you need to rename your database and copy all old database data to new database programmatically.
Thanks
I made a database using phonegap[cordova 1.7.0] sqlite on IOS5.
But I now want to switch this database with one that I already have on an online server.
Is there some method to do that ?
Thanks a lot.
If I understood correctly you want to use your current logic for handling database access to connect to remote sqlite database.
I think such use case is not possible out of the box. Cordova is using support for WebSQL built into iOS and Android (or provides own compatible implementation).
There are at least 2 solutions to your problem:
Create service which allows access to your remote database, and then create client side sync service which synchronizes that on the client and server. This way you will have full offline support plus data will be backed up on the server.
Write your own Cordova plugin which allows access to remote sqlite databases but uses WebSQL interface. I guess you could reuse most of the current logic from iOS WebSQL implementation, but instead of accessing local sqlite file on the device, use the database on the server.
Write a server side application that provides access to the database.
There's an sqlite plugin for Phonegap. If the online sqlite is (semi-)publicly available/downloadable, you could have the Phonegap download the db file (there's a Download plugin, I think), and have your customized sqlite plugin use this db.
Either you can also do it in this way. Create a XML file dbase on server and parse it then you can make changes to your existing database by reading the xml files contents.