SQLCipher data takes more space in memory? - memory

I am working with an sqlite database in my android app. I read data from url and write it into database using android.database.sqlite.SQLiteStatement. This way I get about 1.5 MB app data. Recently, I switched to net.sqlcipher.database.SQLiteStatement, now I get about 8.5 MB app data, which is approx. 5 times bigger. Why is it so? is there a way to decrease data size while using sqlcipher still?

The additional application data size is due to the inclusion of the ICU data file. For more information, see the Location Dependencies section of the SQLCipher for Android documentation:
SQLCipher for Android depends on localization data from the ICU
project. SQLCipher for Android will attempt to use a system provided
ICU localization data file called icudt46l.dat located in the
/system/usr/icu directory if available. If that is not found,
SQLCipher for Android will attempt to unzip the icudt46l.zip file
located within the applications asset directory. It is recommended
that the icudt46.zip file be included with your application for best
platform compatibility. If you need to adjust the size of the
localization data for your application, a ICU data library customizer
is available here.

Related

Can an embedded library invoked via FFI read an iOS app's sandboxed filesystem?

I'm toying with the notion of building an iOS app powered by a Rust library. I want this app to use the Files App for storing plain text files that my app will manipulate, but I don't know if my Rust library can read the files stored there directly or if they need to be read into memory first by my Swift code and passed in as arguments when invoking my Rust library through FFI.
I'm still learning both Swift & Rust, so I haven't gotten a workable prototype built yet (thus no code to share), but I want my Rust library to be able to
Read directory and file contents (presumably the sandboxed Documents directory available to my iOS app)
Write updates to the same files.
Is this possible? If so, how might it look?

Flutter How to see document and data and does removing imported packages reduce size?

APP document and data 3gb on IOS.
Just want to see what all comprises the document and data to be so huge.
Also if a widget has 15 imported packages, does removing the imported packages help with document and data size of app? Or does the majority of the size increase come from the package itself in the yaml file?
Hi you cmeasure the app size with this link, when you debug your app the weight is higher but when you compile the app the weight is less.
To check the size of the packages and more you can use the flag --analyze-size when you're going to build your app

Core data / Read only / Swift 3

Working with core data, I have build the following files:
MyApp_DB.sqlite, MyApp_DB.sqlite-shm, MyApp_DB.sqlite-wal.
Those files will be included in the app bundle when shipping and they are rather big.
Once my app is published I want the database to be read only. Therefore there is no need to copy the files above outside of the bundle.
Here is my question, how should I configure core data in my app so that I have access to my database?
Things have changed with Swift 3, so the code I had working before does not function anymore.
I want my app to work with iOS 9 and iOS 10.

Persistent storage (WebSQL and local storage) in iOS 6 w/ PhoneGap

The issue of iOS not persisting localStorage/WebSQL databases has been discussed frequently here and on other sites. The problem I am having is that the workarounds are so varied and have evolved over time. I have found 2 different PhoneGap plugins which use the native SQLite API, a plugin that periodically copies the SQL database to the documents directory,and even suggested settings in a Xcode .plist file that can be used to specify the location of SQL database. It's confusing because I'm not sure which solution applies best to the current point in time (iOS 6+ and Cordova 2.4+). Is this built in to Cordova now or do I still need a plugin. If so, which plugin? What about the setting the database location in an Xcode config file. Any help is deeply appreciated
Current versions of phonegap don't require a external plugin to use SQL with a sqlite database. The current code is compatible with iOS. You don't need to write/implement your own workaround, and you can be sure that phonegap will implement werever you need to get your app running (that's why the name phone-gap they will fill the GAP).
http://docs.phonegap.com/en/2.1.0/cordova_storage_storage.md.html#Storage

iOS 6 local storage file appears twice

I have an app that uses local storage (using sencha 'Ext.data.proxy.LocalStorage') to view some content offline. I was rejected by itunes for violating the iOS Data Storage Guidelines.
I thought it might be related to the localStorage being inside the /Documents folder in iOS before iOS 5.1. To confirm that in newer versions the document folder is empty I checked, but I still found a .file__0.localstorage.
The strange think is that the same file (but without the leading dot) also exists in the library/caches folder, where it should be.
Both have the same content.
Does anyone know how this can happen? I already asked in the Sencha Support but it does not seem to be related to the Sencha framework.
Note: I am not using PhoneGap, only Sencha.
Making a very small Hello World Application with Sencha that writes to local storage I could reproduce this behavior. It seems like on application exit, it will write a copy of the localstorage file to the /Documents folder.
This seemed suspicious to me and it reminded me of the PhoneGap patch for iOS 5.1 that backs up the localStorage file also.
With iOS 5.1 Apple started to put the localStorage file in the Library/Caches folder which broke many applications because the data was no longer reliable stored. So PhoneGap and others started to implement Workarrounds that backup the localStorage file to the documents folder and automatically restore it if needed.
Trying to find proof that Sencha does something similar, I opened up the resulting .app package and found a stbuild_template file that contains the native wrapper code. It is of course compiled, but searching for the string "localStorage" results in some interesting results like:
restoreLocalStorage
preserveLocalStorage
Could not remove source file while backing up localstorage Could not copy localstorage backup . Caches WebKit/LocalStorage .file__0.localstorage file__0.localstorage
SNLocalStoreageFix
Also I found a lot of references to NimbleKit which seems to be used internally for the packaging.
This thread also hints at a solution for the iOS 5.1 local storage problem in Sencha Touch 2.1 which is what the OP is using: http://www.sencha.com/forum/showthread.php?194674-Localstorage-and-native-iOS-5.1-apps&s=04149e771f9c4eea15cb6f6d97069ff6
All this is evidence for me that Sencha implemented a workarround for iOS 5.1 which will put the localStorage in the /Documents folder. Since you only use the localStorage file for caching, Apple rejected you because you store non-user data in /Documents.
I think using PhoneGap there is an option to disable this backup. So you might want to consider using this or ask Sencha if they have a similar option to disable it.

Resources