Thursday, 8 December 2011

Android - Install Sqlite in Android

Update1: The sqlite download link seems not working. Try to download it from other place.
Update2: I have try it on Nexus 4 with Android 4.2.2 and it works.
Update3: If you have any problem to get the sqlite, try to download this app:
https://play.google.com/store/apps/details?id=ptSoft.util.sqlite3forroot&rdid=ptSoft.util.sqlite3forroot

Note: To install Sqlite you need to became superuser, which requieres you to root your device.

By default the program sqlite is not available in the shell of Android 2.3.3 because it is not installed. To install it, you have to download the program and put it into the /system/bin folder.

1. Download the SuperOneClick package:
http://www.mediafire.com/?3z5njntui9f3k7x
2. Decompress the package. It contain many programs, one of them is SQLite3
3. Open the terminal and navigate to the SuperOneClick folder
4. Push the program to the sdcard by typing the follow command:

adb -d push sqlite3 /sdcard/

5. Open to the shell of the device

adb -d shell

6. Become super user

su

7. mount the system in order to make it writable

mount -o remount,rw /system

8. Copy the program into the /system/bin

dd if=/sdcard/sqlite3 of=/system/bin/sqlite3

9. change the permission

chmod 4755 /system/bin/sqlite3

10. Remount the unit as default

mount -o remount,ro /system

11. Exit as super user

exit

Once it is done, you should be able to use sqlite3 and check the content of the database in the device.

For more information about the usage of sqlite, you can check this post:

Source: StackOverFlow

4 comments:

  1. Thank you! Excellent step by step instructions.

    Fyi for others- On my Atrix 4G, i had to ensure the USB mode was set to none otherwise the copies resulted in permission denied.

    ReplyDelete
  2. Thanks. I just want to say that I am not the original creator of the steps. I get them from StackOverFlow and I added some explanations. The original source is included in the post as "Source".

    ReplyDelete
  3. I'm getting the following when trying to execute sqlite3, any idea?

    1|root@android:/system/xbin # sqlite3
    /system/xbin/sqlite3[1]: syntax error: '(' unexpected

    ReplyDelete
    Replies
    1. You have a syntax error with the SQL code. Could you paste your code as comment?

      Delete