Seeding data in IPAD application - ios

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.

Related

swift ios does core data have any function to pre populate

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.

how i can avoid my data lost when i updates my apps in iOS?

When using PhoneGap, do users lose all of their saved data when they update an iOS app downloaded from iTunes?
I am hoping that anything stored in either Webstorage feature in Construct 2 will be preserved whenever someone downloads a new version of the app from iTunes, but I'm afraid to build a whole Apps only to have a bunch of upset users when they update the app. I know when I build an app in Objective C I have to go through some hoops to get the Core Data store to migrate correctly.
The other option is to mirror the data to an external server/database, but I want to avoid that expense and complication if I can.
If you change anything in the tables in CoreData then you would have to implement migration for the tables by creating a new version (check apple's documentation here: Lightweight Migration)
Otherwise if you don't change anything updating the app would not make the user lose any data.

ios how to manage DB with iphone app version by version?

My question contains two ways:
1. For example I have an app which is on appstore and containing sqlite database. After sometime I want to update app version without changing database schema. what happened when app will be updated on user's device ? would all data in old database removed or just remains with same database and data ?
2.For example I have an app which is on appstore and containing sqlite database. After sometime I want to update app version with changed database schema. what happened when app will be updated on user's device ? its must changed the DB file but how can we save old data entries those are in old DB version. I have read many posts but still confused which approach I should use.
Thanks in advance for Helping
It is quite simple. When updating the application documents folder remains intact, so you can assume that the user data continues to be available.
For case 2 make sure you do not compromise the data in your update routines at the first start after the update. The app should detect that it is in a new version and modify the schema (e.g. via SQL scripts) while taking care of not deleting user data.

Retrieving database into an iphone app

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

Which database can be used with Xcode and at the same time be populated through a website?

We are trying to create an iPhone application that will automatically receive data from a database. Which is a database that will work with Xcode. Our goal is that users can go to our website and input information. That data will be recorded to a database. Once the user downloads our app, the info should then be retrieved from the database and included in the app. We are wondering what database is suitable. It must be able to receive information from a website AND submit it to an application.
You're unlikely to find a iOS "aware" database that can automatically sync content over the internet.
However, you can of course obtain the data over the internet yourself and then insert it into the local database on the device, in which case the popular (and supported out of the box) SQLite would seem like an obvious choice.
As #Deepak also suggests, you could use Core Data which is a (sort-of, ish) ORM that can automatically use SQLite as it's underlying storage mechanism.
The solution that most people use in this case is to use an RDBMS like MySQL and build a web-service layer on top of the database for the entities that your iPhone app is interested in.
This way, when a user goes to the web-app, they can add the data that you allow them to add there, and later on they can access the same data from the iPhone app via the web-service layer also.
Couchbase's new iOS-Couchbase framework is in beta right now - all the functionality of Apache CouchDB on your favourite developer platform - at https://github.com/couchbaselabs/iOS-Couchbase. the iOS release is new but we're looking for it to go places!
Its awesome sync abilities would allow you to pull down any relevant content from your website via HTTP/JSON, or further formats using shows and lists if needed. Pushing data the other way is just as easy. Sync can be continuous, or on demand, bidirectional or one way.
Take a look at some of the Couch App frameworks (not for iOS but for your website)
http://techzone.couchbase.com/community/articles/couchdb/recipes
http://www.mail-archive.com/user#couchdb.apache.org/msg13928.html lots of comments on this thread
A+
Dave

Resources