dimanche 11 octobre 2015

Access IOS documents directory via Java and IOS native app

I have created a native app using swift to collect data and load to the SQLite Db in the devices document directory.

When user click on submit button, I was asked to invoke a web application to read SQLite DB and insert into DB2 database(present in web sphere server).

There are no issues with IOS native app but I am not sure on how to access IOS documents directory to connect to SQLite DB via java to read and insert into DB2.

I first used NSURLSession/ NSURLConnection to pass the SQLite Data to Java as JSON strings. The Sqlite Data has Images stored as Blobs. So when I try to send data with more than 3 images encoded and sent in JSON, I g0t memory issues and app crashes.

So, I thought that accessing SQLite DB directly from Java will be a good solution. So, I pass the Absolute URL ("file:///var/mobile/Containers/Data/Applicaiton/.../Documents/Sqlitedb.db") of the Sqlite DB to Java to connect and access SQLite DB.

But java fails as path does not exist and I can find that Java is trying to find the file inside /opt/websphere/.. directory.

Could anyone assist me on how can a Java web module directly read Sqlite stored in IOS documents Directory. If java cannot read the IOS documents directory is there any other better option for me to go ahead with my requirement.

Please review and guide. Thanks.

Aucun commentaire:

Enregistrer un commentaire