I created a simple andriod app, and i want the user to be able to enable or disable the app full screen and wake lock when a button is press.. I know that i can easily enable/disable this in buildozer.spec file, but is there a way i can modify this in the main.py file when the user press a button? I tried editing the specific lines in the buildozer.spec file from main.py file using
if self.FullScreen:
# Check if FullScreen is False.
UpdateSpecFile = open("buildozer.spec", "r")
SpecFileLines = UpdateSpecFile.readlines()
SpecFileLines[77] = "fullscreen = 0\n"
UpdateSpecFile = open("buildozer.spec", "w")
UpdateSpecFile.writelines(SpecFileLines)
UpdateSpecFile.close()
else:
UpdateSpecFile = open("buildozer.spec", "r")
SpecFileLines = UpdateSpecFile.readlines()
SpecFileLines[77] = "fullscreen = 1\n"
UpdateSpecFile = open("buildozer.spec", "w")
UpdateSpecFile.writelines(SpecFileLines)
UpdateSpecFile.close()
# I used same function for the Wakelock
But am getting error " No such file or directory: 'buildozer.spec ".
NB: My buildozer.spec is relative to the main.py directory.
Please i need help, thanks..