Today’s tutorial will be about SQLCipher and its integration in Android (with the means of Android Studio). Just to give some introduction, SQLCipher is used for a full database encryption. What full means is that the DB file is entirely encrypted, not only separate rows or tables. Zetetic, the company behind SQLCipher, provides Community and Commercial edition. You can use the former for commercial projects, though, just have to provide license doc in your app. Also, SQLCipher is not for Android only, it can be used on various platforms.
Regarding security features, SQLCipher uses 256-bit AES in CBC mode by default, with 1kB page size, and it derives the key data using PBKDF2 function. The difference in API that you instantly notice is the passphrase argument in
getWritableDatabase() methods. Now, this passphrase should never be stored in the application, otherwise the whole point of encryption is wasted. One thing to keep in mind, is that the passphrase is not a key! Yes, the DB is encrypted using the key, but it is generated based on the passphrase (~ password) and also can be re-set using PRAGMA rekey command.
Continue reading Tutorial: Add SQLCipher to your Android app
This tutorial demonstrates greenDAO 2.x integration. Since greenDAO 3.x was released, its integration differs from 2.x. Now, you can either have a generation project or everything in one app’s project. There is a build-in encryption (SQLCipher underneath) which you can use if you want. There are now annotations and the package name has been changed to
org.greenrobot.greendao. Here is a good article if you want to migrate to greenDAO 3.x – Updating to greenDAO 3 and annotations and here are some Code examples.
Today I want to present you my new tutorial about greenDAO integration. For those who haven’t heard, this is a great open source Android ORM solution which enables you to forget about SQLite low-level stuff and concentrate on the database’s overall lifecycle, models and how do they relate. You don’t actually need to bother how to populate the database and how the relations work, because greenDAO handles it for you. All you need to know is what you want to keep in your DB.
Sounds great, huh? But what about performance? Continue reading Tutorial: How to easily integrate greenDAO into your Android project
Some time ago I’ve posted a few tips & tricks when dealing with Corona SDK, and finally I got my hands on posting another portion of useful things in there! Below you can read about code style, saving persistent data, and getting community help.
Code style and work environment
- Keep all in module manageable functions
- Use camel-case style for functions and variables
- Keep in mind 200 max variables limit per module
- Always add one blank line to separate nested blocks, for example before the if block above (more than one line is unnecessary)
- Keep game settings as a separate class, so it’s not mixed with screen’s lifecycles
- Sublime 3 Beta is recommended for the development and for Sublime Corona plugin
Best Practices for Organizing Projects
Tutorial: The value of well-formatted code
Tutorial: Scope for beginners
Continue reading Best Practices in Corona SDK
Today I’m gonna share a few things which I have learned while working with Corona SDK. Those are things I wish somebody told me at the very beginning of my journey with Corona, so hopefully you find them useful as well 😉
Anchor points are the properties which allow you to change the alignment of the object within its own bounding box. As difficult as it may sound, we’re just changing a gravity of some control (it can’t be a group, as groups don’t respect anchor points).
Whenever you see
yReference in some tutorial, just know – they are deprecated. There are now
anchorY isntead, and they’re default values are 0.5, which can be changed with the call like:
Transforms and Anchors
Anchor Points in Graphics 2.0
Continue reading Tips and Tricks in Corona SDK