How to encrypt SQLite DB using SQLiteCrypt - android

I wanted to ecrypt the db file that i am storing on the sdcard. I have looked into SqliteCrypt library for serving my purpose but its using C libraries to perform the encryption/decryption.
I would like to know if anyone has successfully included the library in their project? If yes, please guide me through the process. Any guidance or any samples will be of great help.
Edit : Anyway, it's much more simpler to implement encryption yourself based on plain Java. It's not difficult – #barmaley
I want to encrypt the whole db file as single unit. Not individual data fields. Please let me know if there is any alnerate mechanism to achieve this.

Try using SQLCipher for Android.

try to use SqlcryptSDK
it is my project, i use android source code and add encrypt method in it.finally build the sdk and demo;

Related

How to work with sqlite DataBase in Xamarin Android?

I searched for along time for how can I use a pre made Excel table, as a reading database in Xamarin.Android.
Of course I can't use it directly, so I tried many different ways. For example, convert to Json, upload to Firebase, and later download it, while the program runs, and fill the sqlite. This way is not effective aadn most of the time doesn't work.
Is there any chance, that someone could please explain or even give a tutorial on how to create sqlite database and work with it directly? If there any other worse or better ways to do it, please tell me.
Thank You!
If you want use sqlite DataBase for Xamarin.Android, you could use sqlite-net-pcl.
Install from NuGet: sqlite-net-pcl
You could cgeck the MS docs from the link below for reference. https://learn.microsoft.com/en-us/xamarin/android/data-cloud/data-access/using-sqlite-orm

How to write .graph file

I am new to GraphQL so please sorry if it is a stupid question but, how do I know how to write a .graphql file ? I refer at the content of the files:
I have the schema.json, but I don't know how exactly to compose my .graphql files, is there any tutorial on how to structure your query?
Thank you
.graphql file stores GraphQL independent query, because GraphQL syntax have import or similar construction. So you don't have ability to compose your queries from the box. As workaround you can use approach similar to prisma graphql-import. But it related to GraphQL server based on JS. I don't know a tool for client and android.
My recommendation is don't worry about query duplication right now. Create new query at graphiql or similar tool and put them to new .graphql. When you will have experience with GraphQL you can find your approach for composing queries.

How to protect a pre made sqlite database in android?

I have a sqlite database in asset folder of my android project. I made it with sqlite database browser and use it in my project. It contains some table with 4 columns. This is working great in my apk file. But problem is if someone want he can easily break my apk file and get my real database also. Now my question is how can I protect my database? Is there any way to set password or encrypt my database.
I searched this type of problem in stackoverflow.com and found some way. But I think those ways are for, when I creating database with code. If I create database or put data with my program I would make my own encryption method also (like shuffling characters). But, again I am saying, my database is pre made and I want to protect this?
In this situation can you help me please? Sorry for bad English.
You can protect your database with help of following libraries. And make sure you use Pro-Guard to protect your code which has encryption keys.
SQL Cipher for Android but its paid library.
SQLite Encript
Android Database SQLCipher
Edit
You should check this blog and OI Safe also .. :)
You can integrate Proguard in your android app. Here is official documentation for this Proguard It will save your apk file from attack.
You can also encrypt your data in SQLite. You can apply AES Encryption to data beforing storing it to database and decrypt data in your code files before accessing it. Yo can also use SQL Cipher to protect your database
Check this Link it will help you

use data stored in android sqlite database as input to weka

I am not sure if anyone has ever tried this. I am currently storing attributes in a sqlite database on android. What I want to do next is to retrieve these data and apply Machine learning algorithms implemented by Weka. Weka can indeed take data from databases using JDBC. But can this be done with android? The SQLite database in android doesn't seem to be a normal SQLite databse.
I have read this http://weka.wikispaces.com/How+do+I+connect+to+a+database%3F, but it doesn;t help much.
Thank you
I do not think there is a ready implementation for Weka to read the data from sqlite on Android, because the helper class mainly depend on JDBC which is not available for android.
I can think of two options to achieve this:
Query the sqlite database on Android and create Weka training instances programatically on the fly. This solution might be more suitable for online training and when you have large dataset.
Export the training data from sqlite as csv file and pass the file to Weka for training.
It seems that WEKA won't work on Android without changes. J48, for example, requires the java.lang.Cloneable interface, which is not available in Android.
This is a weka port to android project here.
Hope it will help you.

I have some really huge string data to ship with my android app?

I have some really huge data that is required for my android app. I've put it into a sqlite db now. Roughly it is 39k rows and 5 columns. I want this data to be available for my app.
I'm kind of confused as to how I ship my app with it. i can ship the db file with it like discussed in this thread. or I can somehow create XML out of that data and ship it along. But the XML would be really huge. So what is the right way of doing it?
I do not want to download it after user installs the app. That'd be my last option if there are no better clean ways of doing it.
This should help you.
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
Basically just ship the database with your apk file.
I think shipping your DB could make some problems with compatibility.
Maybe it will be better to use GZIP'ed SQL code bundled to your .APK?
Or instead of XML for intermediate representation you can use google protobuf, which is most effective data representation format(Also, if you have a lot of strings, you can use it in combination with GZIP).
Check the example here to achieve this functionality.

Categories

Resources