-4

So far, tutorials I have found create databases and tables inside Android applications.

Usually, (in other languages) I created a database and tables, then simply used them in an application.

Can I do it in an Android application?

I do not want to create them in an application, however, I want to create a database and tables beforehand I use them in the application.

For example, can I access to SQLite of an application (in a device) from the terminal?

How can I do?

Thank you!

ghchoi
  • 4,812
  • 4
  • 30
  • 53
  • You are asking if you can create a database inside an android application, and at the same time say that you don't want to do it. Please clarify your question. – Omri Luzon Jun 15 '17 at 16:50

1 Answers1

1

Usually, (in other languages) I created a database and tables, then simply used them in an application.

The challenge is not in creating a database, but in distributing the database with your app. Android educational materials, including sites like this one, tend to be focused on apps that will be installed on more than one device.

I do not want to create them in an application, however, I want to create a database and tables beforehand I use them in the application.

You can use libraries like SQLiteAssetHelper to package a prepared database with your app, if that is what you are asking.

For example, can I access to SQLite of an application (in a device) from the terminal?

There may be a sqlite3 binary on the device, but there may not be. You can certainly download it for your development machine. In addition, there are many desktop apps and Web browser plugins that allow you to work with SQLite from your development machine.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491