PCL Support Now Available on SQLCipher for Xamarin

2015-12-10 07:00:00 -0500

xamarin

Following the release of the SQLCipher for Windows Universal Application Platform package, we have issued a major update to our SQLCipher packages on the Xamarin platform which now includes PCL support.

SQLCipher for Xamarin iOS and SQLCipher for Xamarin Android include two different client libraries for interfacing with a SQLCipher database. First, the Mono.Data.Sqlcipher library for data access with an ADO.NET style interface. We have recently replaced our second client library, previously based on sqlite-net with that of SQLite.Net.Core-PCL. While the new library maintains much of the same behavior as its predecessor, providing a light weight ORM, it is now PCL compatible. This will allow developers targeting both iOS and Android devices using the Xamarin platform to share much of their data model source code, minimizing duplication across platforms.

A sample below shows how quickly you can construct a secured SQLCipher database connection for your Xamarin iOS application.

var password = "SQLCipher!";
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
var libraryPath = Path.Combine(documentsPath, "..", "Library");
var databasePath = Path.Combine(libraryPath, "sqlcipher.db");
var conn = new SQLiteConnection(new SQLitePlatformIOS(password), databasePath);

If you are interested in giving either SQLCipher for Xamarin iOS, or SQLCipher for Xamarin Android a try, trials are available for both. Please feel to reach out if you have any questions.