My iPhone app is required to work offline, so I need te retrieve the db from the server into the devise.
The database contains about 10 tables with a few dozen lines each.
What is the recommended way for doing so?
Is it the sqlite3?if so, how can I build the sqlite tables from the DB?
Thanks,
Asaf
You have multiple options:
download a sqlite database file from webserver, store it in your app's document or temp folder
create the database and tables dynamically by code, set up an XML or JSON interface on your webserver, download the data from web and insert to the new database
Take a look here for a beginning with SQLite on iOS.
And yes, it is sqlite3 on iOS.
I ship my apps with the tables built, with some data, then have the app call a web service that takes "last updated" as a parameter, and returns all additions/deletions since then (as JSON)...the app then parses that, and inserts/updates/deletes as needed
Related
I want to create an offline iOS application using Realm. Users just need to read the database, they don't need to update or create entries.
I can create my pre-populated database using Realm Studio and I need to use that database file in my final app so users can access the database with the same data. For example, jobs.realm file with same data should be available to the users when they first launch the app.
I've been searching for a solution but couldn't find anything I can understand.
Follow the documentation for bundling a realm file: https://realm.io/docs/swift/latest/#bundling-a-realm
Recently started with electron. Can any one please help me with the database selection. It seems like there is no straight forward choice for it.
Suggest a database for medium size project.
In Electron app, you can use the database of your choice :
https://github.com/louischatriot/nedb
https://github.com/pouchdb/pouchdb
http://lokijs.org
https://github.com/kripken/sql.js
https://github.com/pubkey/rxdb
https://github.com/amark/gun
https://github.com/typicode/lowdb
https://github.com/google/leveldb
According to your purpose, a single JSON file can be used as a database.
You can use CouchDB, which is the non-sql database, in that you can store data in JSON format, they have inbuilt sync functionality, that means, you just need to store data locally in HTML storage provider and CouchDB will automatically sync that with the server.
I am working on turning an web app into an iOS app.
They both use the same backend/restAPI.
My question now is: Does core data have any function that makes it possible to pre populate my ios apps "database" ?
I have a few sql files with relational tables (one-to-many) that I would want to get in my app.
Eg, state/city, category/sub-category.
So is there a way to get the data form my sql file into the ios app?
I would want to build/ship the app with the data already there, instead of making an API call and then store the data.
Thanks
Do you really need Core Data? If all you need is access to your relational data, I'd create a SQLite database from your SQL dumps on your PC. Then you can include that file in your app's bundle during the "Copy Resources" step. SQLite is available on iOS, so you'd be good to go.
I am porting a desktop application to IPAD which is data centeric application. I have to move all the data which we already have in desktop version.
I have 3 tables and approx 5000+ rows.
How shold I create these 3 table and add rows to IOS application?
If you intend to use SQLite for the database on the client, you could simply load all the data into the file and deliver it as a resource. If you are looking for a SQLite GUI, there are a few in the app store, and some open source. I use Navicat sometimes, the command line the rest of the time.
If you are using CoreData and iCloud, Apple recommends that you save all the records through the standard methods and not import a pre-filled DB. You can just run through a script on first launch in the background, then popup a quick "Importing data... This will only happen once" message.
I am new to blackberry, i am doing application in eclipse,i got an situation, how to insert values into the database when entering the data in the login form which contain 2 fields username and password in blackberry applications, please provide solution.
It's quite difficult to understand what are you asking here.
Do you want to add login form data to a local (mobile) database? Or you want to add it to a centralized (to all applications) server?
In the former case, you need to use BlackBerry APIs to create and populate databases using Persistent Object Store (which is always available for BlackBerry Apps) or use any other database you can separately install in BlackBerry. Also consider using SQLite (integrated with BlackBerry OS 5 or superior).
In the latter case, you need to send login data through HTTP (or any other TCP based protocol) and once data is on you application server, you can insert it on any database it supports: MySQL, PostgreSQL, Oracle, SQLServer, Sybase, you name it.
http://docs.blackberry.com/en/developers/deliverables/8673/JDE_5.0_SQLiteGuide.pdf
DataStorage concept comes here.For this first of all learn how data can be inserted to a database table..The above link is a guide which helps you to learn everything about how table can be created,stored retrieved.
Store the data you entered in a variable viz.username,password using persistent storage..
Use these variable names in the Insertion syntax..