0

Is it possible to make MySQL Database in an Android Device to store data locally? Like we do in computers by setting up apache server and accessing database through phpMyAdmin.

I know that I can use a MySQL database stored on a remote server through php to fetch data from it. But since an internet connection is not always guaranteed, I would like to save the database locally.

Any type of database will do, but since I have some experience with MySQL therefore it is preferred.

Thanks! Any help is appreciated!

3
  • 2
    I haven't heard of this being possible, but SQLite is a database which can run embedded in your Android device. Try looking into SQLite. Commented Jun 13, 2017 at 6:25
  • Try sqlite. It has similar syntax as that of MySQL, or you can use Realm. Commented Jun 13, 2017 at 6:26
  • There is SQLite that you can start using right away in your android device. I do not think you would see any difference in terms of select/insert/delete statements. I assume so far that you want to approach the whole thing as a developer and not as a user.. Commented Jun 13, 2017 at 6:27

1 Answer 1

2

I think the closest thing you can have is to use sqlite3.
Sqlite is a decent SQL engine that stores data in a file (or ram)
Note that its syntax is not exactly as in mysql but it is useful.
You can choose to put the database file(s) in a private folder or on the sdcard, depending on the privacy policy you want for the database.
Note that you can open multiple sqlite instances on the same database file.

To access it, i would suggest a Tcp listener which reads line and passes them to sqlite.

Sign up to request clarification or add additional context in comments.

2 Comments

How to use a Tcp listener to access Sqlite. I have never worked with either of them, so I have no idea

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.