How to include data files with the app's APK?
You can save you files in \res\raw
and write the code to store this files to the desired locations if it does not exist when the app start.
Check this to access the internal memory and sdcard
and access the raw
file using the following
InputStream databaseInputStream = getResources().openRawResource(R.raw.yourfile);
How to package and access extra files inside my apk
You can add them to the res/raw/
folder.
Check this to learn how to use it.
How to store initial data in android apk file?
did you look at res/assets?
I assume that you probably have some sort of json/xml data that you want to pre-package with your app if so, then load the json/xml into the res/assets and it'll just be a file included with your apk.
Ref
https://developer.android.com/guide/topics/resources/accessing-resources.html
How to insert unique data into an Android APK package with each download?
An APK is fundamentally an archive.
I think that you should be able to unzip, edit and zip it again without changing its signature, as you can see from this detailed guide
In order to put a unique code inside your app, you could use the assets folder creating a txt or json file containing that code.
Then, you can retrieve the unique code inside your app by reading the assets folder programmatically.
How do I correctly include data folders into an APK with Buildozer? FileNotFoundError
Maybe try playing audio files using Kivy's own SoundLoader function. Like this:
from kivy.core.audio import SoundLoader
sound = SoundLoader.load('mytest.wav')
if sound:
print("Sound found at %s" % sound.source)
print("Sound is %.3f seconds" % sound.length)
sound.play()
More information can be found here.
Also, try to use os.path.join
as @NameKhan72 has mentioned in his answer. Don't forget to import os
first. Clean up the Buildozer folder (in your project folder) before rebuilding apk again.
Related Topics
Android How to Programmatically Hide Launcher Icon
How to Avoid Delay in Android Gcm Messages/Change Heartbeat
(Deprecated) Fragment Onoptionsitemselected Not Being Called
App Always Starts Fresh from Root Activity Instead of Resuming Background State (Known Bug)
Ontouchevent Not Working on Child Views
Parcelable Encountered Ioexception Writing Serializable Object Getactivity()
Java.Lang.Unsatisfiedlinkerror: Dalvik.System.Pathclassloader
How to Encrypt/Decrypt String in Android
Caused By: Java.Lang.Outofmemoryerror: Bitmap Size Exceeds Vm Budget
Rawquery(Query, Selectionargs)
Dynamically Updating an Autocompletetextview Adapter
Adding Tab Inside Fragment in Android
How to Tell If a Closed Path Contains a Given Point
How to Notify Users About an Android App Update
Android Mapview -Setting Zoom Automatically Until All Itemizedoverlay's Are Visible
How to Declare Git Repository as Dependency in Android Gradle
How to Get Value of Some Field in Firebase Firestore Android