Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing iOS Core Data from Android

I developed a simple iPhone app by the book, using Core Data. The data is immutable and stored in a preloaded sqlite database, managed by Core Data.

Now I need to develop the (almost) same app for Android. I'm about to write a very basic set of classes that mimic Core Data, and read from the exact same sqlite database.

Before getting started on this, I was wondering if anyone knows about an Android library that does just this.

In theory, you could almost literally provide the same API as iOS does, maybe even parsing the object model as well.

like image 744
mvds Avatar asked Dec 16 '22 16:12

mvds


1 Answers

Core Data have its own data structure you can look at it and you will see something like this:

enter image description here

Tables from your model are prefixed by Z, so you can perfectly query this SQLite Database with SQL queries in Android.

Note: you can find this SQLite file after runnig your app with Simulator in the folder: /Users/<you_name>/Library/Application Support/iPhone Simulator/<ios_version>/Applications/<app_id>/Documents/<app_name>.sqlite

like image 56
Ludovic Landry Avatar answered Dec 19 '22 07:12

Ludovic Landry