I want to write my songbook, which will contain a very large amount of textual information.

Could you tell me how best to do this in order not to load the application with a volume of more than 4-6 MB, are there any options?
Is it possible to load a database from any server when you first start the application?

  • Does this base affect the size of the original apk? - Kirill
  • Android application? - Alex Krass
  • Yes, I use Android Studio - Cyril
  • In this case, it is better to use SQLite with which Android runs by default, in the process you can upload files from the server database when the application starts and save locally to the internal database if desired by the user. I don’t know how much the apk will grow up, I think somewhere around 1 MB - Alex Krass
  • And what methods should be used to upload files from the database from the server? Are there any examples? Googled, found little - Kirill

1 answer 1

When making such a decision, you should always take into account several opposite factors:

  • If you decide to include the database in the application, then how large will the size of the application? How will you update the database? Updating the application or from a remote server?
  • If you decide to use a remote service, does the application justify the use of the Internet? How to download the original database if it is big enough? What if the server is temporarily unavailable or the user has internet disabled? And if you don’t score support for some time and will the application turn into a pumpkin?

Personally, I would like this application to not require a mandatory Internet connection, so I can offer this option:

  • Put in apk a certain primary version of the database, as far as the size will allow. Since this is text information, it is easy to press, and when you first start it can be unpacked into a local database.
  • The database is updated in the background using a remote service, for example, each time it is started. It is important that this does not bother the user with messages like "could not connect to the service." The user may not turn on the Internet, or your service will die. This will ensure the utility of the application immediately after installation and relieve the user from the risks of being left without a working application.
  • I also like more than the second, you proposed option. Could you tell or show an example of the code, how should the update of the database through a remote service be arranged? - Kirill
  • @Kirill too many options: starting from the platform and finishing up in a specific way. And what's so difficult? Send the request, get the data, deserialize them into some "entities", save to the database. - andreycha
  • It would be easier for me to somehow realize this, to understand how this should work. - Kirill