1

I am a student and I want to learn about using sqlite3 on android. My friend tried to run the android emulator and start typing commands adb -e shell, su, navigated through the emulator storage, then run sqlite3 mydb.db. Everything went fine. But whenever we tried running adb with the use of an external physical android device, running sqlite mydb.db is a problem. ADB cannot somewhat find the sqlite executable. I already rooted my device and granted permission the adb but still it doesn't seem to find the sqlite executable.

I did some research. I found out in another post that some of android devices do not have sqlite built in. So I tried researching for any possible ways to install sqlite3 on android system. I found this. One of the answers suggested this. I already tried but The installer doesn't work for me. In the same question, the selected answer is to pull sqlite from an emulator (that supports one) and push it to my device.

The problem with this method is we have limited amount of resources. The laptop I'm working on has only 1 GHz CPU and 3 GB RAM. Android Studio won't even let me run an emulator because of the speed of my CPU. Copying from a faster and better laptop that can run emulator (that can emulate device with sqlite3) is only my last and very final option. Is there any other way?

Community
  • 1
  • 1
  • You can pull the database of the application through ADB to your pc from computer. If you want to learn database in android why don't you try to make some real example through Java using databasehelper? – Dhananjay Sarsonia Feb 03 '17 at 15:37
  • Sorry but I am a little confused. "You can pull the database of the application through ADB to your pc from computer". PC to my computer? Besides, I do not want to pull the database of the application. I want to install sqlite3 to my phone. The sqlite3 executable and not the *.db file. – Neo Anderson Feb 03 '17 at 16:52

1 Answers1

1

For future students I'll answer this question

Download here compiled sqlite3 for android

push to the device via adb push sqlite3 /data/local/tmp

give permission to execute via adb shell && cd /data/local/tmp && chmod +X sqlite3

and run

/data/local/tmp/sqlite3 /data/data/com.app/databases/some_database.db "SELECT name FROM sqlite_master WHERE type='table'"

whoopdedoo
  • 2,815
  • 23
  • 46