I fixed the issue of the SugarAppContextMissingException
(see docs at http://docs.elementscompiler.com/API/Sugar/SugarAppContextMissingException_Class/)
This was due to the lacks of the Android Context android.content.Context
backed on Sugar from the Android app, so I did in the SharedProject
#if java
public func context(var context:android.content.Context) ->() {
Sugar.Environment.ApplicationContext = context;
}
#endif
and then in the Android app:
SharedClassTest sampleAPI = new SharedClassTest();
sampleAPI.context( getApplicationContext() );
So I have the database working on the Android app as well with Sugar.Data:
The file system path was
01-13 17:10:04.221 27741-27758/? I/System.out: /data/user/0/musixmatch.com.sampleandroidapp/files//db.sql
and the SQLiteConnectionPool complains something, so it’s there:
01-13 17:10:04.633 27741-27749/? W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/musixmatch.com.sampleandroidapp/files//db.sql' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.