Access iOS Basic Data with Android

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

Now I need to develop an (almost) Android app. I am going to write a very simple set of classes that mimic Core Data and read from the same sqlite database.

Before starting with this, I was wondering if anyone knew about the Android library that does just that.

In theory, you could almost literally provide the same API as iOS, and you might even have analyzed the object model.

+4
source share
2 answers

Core Data has its own data structure that you can look at, and you will see something like this:

enter image description here

The tables from your model are prefixed with Z, so you can ideally query this SQLite database with SQL queries in Android.

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

+7
source

In a more complex project, we used greenDAO as a replacement for Core Data when porting code from iOS to Android. This is not related to visual modeling, but the basic operations are very similar. As an ORM tool, greenDAO maps Java objects to SQLite and offers things like relationships.

+5
source

Source: https://habr.com/ru/post/1343428/


All Articles