1

I am in the process of trying to developp a small app with BeeWare for Android for my own use. The purpose of the app is to pick a random word from a pre-built list, and ask the user for the translation (english to korean, or korean to english), and then check if it is correct or not. The app also should offer the option of curating the list, by adding or updating entries of the dictionnary holding the words. To this end, I need to store the data somewhere on the device, and to be able to access it. When I run it locally using 'briefcase dev' I can just use the local path to the data but it obviously doesn't work on the since it can't access that same data. My question is: how do I add data (preferably in .json format) to the project, and how can I then use it to read or update it.

I initially developped this project only for desktop, by using 'input' functions etc. but I would like to be able to have a slightly more complex interface.

When I use the app locally, I can use the direct path to the data, but I don't know which path I should use when the app is packaged.

1 Answers1

1

Your App object has a paths attribute, with the following sub-attributes:

  • app: for read-only access to files from your source code directory
  • data: for read-write access to any other files you want to create
mhsmith
  • 6,675
  • 3
  • 41
  • 58
  • not work in android , but work in linux output . – alireza Jun 13 '23 at 15:54
  • @alireza: It should work on all platforms. If you had a problem, please create an issue on the [Toga GitHub page](https://github.com/beeware/toga/issues). – mhsmith Jun 14 '23 at 22:20