FIXED: database issues for pre 4.2 android

Added the support given in the db_fix branch into master through selective execution based on the runtime's sdk version.
FIXED: 4.2 and above issues with db

Some issues arose from adding pre 4.2 support. Also, fixed show encrypted message issue for messages received. Finally, added shared preference string keys to strings.xml.