Skip to content
Advertisement

Kivi: How to set Path for storing Output.txt file of Android app

I am making android app with kivy and python, I have function what will create record in TXT format, in my Project it is in same folder as the .PY file, but i know once i create .apk then it can be problem where the file will be stored. For example I would like to store that Tracking.txt file in Download folder of Android device. How i can define this please?

This is how it is defined now, it should safe/open file where is the app.

JavaScript

Edit: I used the function suggested in post below, but now it showing that it cannot find the Android, what i somehow installed from the suggestion what pop up in Pycharm, but the storage and premmisions are not found. What am i missing in Import part?

Advertisement

Answer

You can use the below code snippet to get hold of the Download directory path in android. And then use the path as appropriate.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement