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.
Related
I want to find Couchbase Mobile DB file location in iOS and please also describe how to open db file?
Thanks
If you are using CBM 1.4 or earlier, you can locate the location of the cblite2 db file as discussed here
https://developer.couchbase.com/documentation/mobile/1.4/guides/couchbase-lite/native-api/manager/index.html#dude-wheres-my-database-file
To view the database , you can use CouchbaseLiteViewer which is (not officially supported ) Mac application
https://github.com/couchbaselabs/CouchbaseLiteViewer.
You could also use any sqlite browser such as http://sqlitebrowser.org to browse the sqlite content
CouchbaseLiteViewer is not updated for checking data in Cblite 2.0 , i
waiting for it so as of now following way check Cblite db data and it
will work.
Latest solution Couchbase 2.0 db check:
There is a command line tool which I believe is inside the zip file that you download to get Couchbase Lite (look in tools) called "cblite" which is similar to the sqlite command line tool. It can perform operations on a database such as listing documents, querying, etc.
Download Couchbase sdk from the website
It comes with the folder inside this, there is a folder called Tools .
Screenshots for reference :
3.Inside tools cblite is there , just launch it . now suppose i have cblite db .
Use following way to query and this tools provide you comannd terminal way to search data/document :
I tried this and it works 👍
shobhakar$ ./cblite /Downloads/mobile-travel-sample-master/ios/TravelSample/TravelSample/prebuilt/travel-sample.cblite2
Opened database /Downloads/mobile-travel-sample-master/ios/TravelSample/TravelSample/prebuilt/travel-sample.cblite2/
This is the current solution and this is awesome.
Reference link : https://github.com/couchbase/couchbase-lite-ios/issues/2176#issuecomment-423921463
Assuming I have an app on iOS that generates a data file, and I would like the user the ability to import/export that file, how is that best done?
Import from email in xcode/objc:
http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app
Is this possible in Delphi? (i.e. register an ios app as file handler for a specifc file type)
(I am planning on handling export through generating an email attaching a file? I suspect this is probably possible although if anyone knows for sure, feel free to share)
It has been asked why import/export across email is useful.
Because legally EU/US law and cloud storage is difficult with personal data
You don't need any desktop computers
You can sync data between ios and android apps if user changes mobile
You are not bound to any specific cloud provider or anything similar
Quote from above article where author explains where the file path is passed to the app:
application:didFinishLaunchingWithOptions, passing the URL in the
UIApplicationLaunchOptionsURLKey, or via application:handleOpenURL.
But since I have not used Delphi for ages (for mobile), I would just like to know for sure if Delphi supports this or not before buying a new version
You can send files using email. I use the email component from D.P.F Delphi iOS Native Components to send file attachments using email. I don't see any reason why you should not be able to send your data file as long as it is not too big. Use a file extension that is unique to your app.
You could also use iTunes filesharing in order to give your users direct access to your data file. Just set the UIFileSharingEnabled key in your info.plist and store you data file inside of the documents folder. This does require a desktop PC, but it is still a very nice addition to sending backups by email.
Depending on your needs,
I would suggest looking at perhaps saving the file to a server using FTP and Indy and then on the other device you can retrieve it?
http://www.delphipages.com/forum/showthread.php?t=208397
Set the TidFTP connection parameters
Do a FTP put : // ftp.Put('testfile.txt');
Perhaps have a Database with a column that you specify a file version etc
Do a simple Get request if you want to retrive the file with the filename
or Alternatively you can save it to a blob field in a DB and have the other device read the blobfield if you don't want to do it via FTP
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 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
I am creating a database application using the SQLite3 library.
I have created a database file using each of the file extensions: .db, .sqlite, and .sql.
All are working fine for me, but my question is which extension should I use in general?
Is there any difference between these file extentions?
The Sqlite documentation seems to use the '.db' extension consistently, but I've seen plenty of Sqlite files that use '.sqlite' instead. Use whatever is meaningful to you. For example, if you're using Core Data to create the database, you might use '.cd' or .'coredata' to remind yourself not to modify the database outside of Core Data. Unless you're planning to transfer the file to some other machine (and really, even then) it won't matter.
The database will live in your application's sandbox, so users will never have to know about the filename or the extension, and other applications typically won't ever see it either. Just give it a distinct name so you can tell it apart from other files that your app might be saving to the same location.