So, for the last couple of months I’ve been working on the H.I.I.T. Timer app (High Intensity Interval Training). I didn’t find what I needed on Android Play Store so I figure out “why not do it myself?”. Anyway…
Right now I’m almost done. But unfortunately only just now I’ve noticed a big → huge → gargantuan problem: Screen is dimming and the whole phone is falling asleep after some time.
As you probably figure it out by yourselves by now.
A Timer app that shows you time counter that falls asleep after couple of seconds and needs user interaction during exercises kinda misses a point (at least for other people who need an app like this and would want to download mine)…
So here are my two questions I really hope someone could help me with:
Is there any way to implement WAKE LOCK permission inside (javascript extension or something) or outside (i.e. Android Studio) of GDevelop?
Could you kindly provide me with necessary information so I could do it myself?
PS: I tried to implement the permission myself but I failed every time so I gave up and now I’m asking for your kind help
i’m a absolutely beginner in that issue, i know it´s a really hard work to explain the steps in a more detailed way (really a “oh nooooo not again dude” thing ), but maybe you are in the mood to show a more detailed way? Please? i mean… please? really please?
3 = where do i go where? i mean, how do i “go” with cmd to the exported directory?
4 = where do i type this?
5 = i´ve loaded phonegap, but it doesn´t start anyhow, just the loading image all over the time, so i would use the cordova cli, but what i have to type there?
Please mate, help me up (and my unknowing fellows after me)
thank you in before
Open the command line and type npm i --global cordova
Change the directory if the command line to your GDevelop installation directory (changing directory in command line is with cd, Google that if you don’t know how to use it)
Change directory to resources\GDJS\Runtime\Cordova
Enter the command cordova plugin add [https://github.com/Viras-/cordova-plugin-powermanagement.git](https://github.com/Viras-/cordova-plugin-powermanagement.git) in the command line
meanwhile i did it (partly at least) with your first description.
This “cd” thing in cmd was the key, i didn´t understand what has been the meaning of “Go with cmd to exported directory” now i got it.
And i´ve uploaded the for cordova exported files to phonegap and i was able to download my app.
But the app doesn´t work, it freez, maybe i did something wrong in your description “Create a JS event that will be called a single time”?
Hello. If the app freezes during the loading (at 100%) check if it’s because of the JS script you’ve added (remove it and check if the app exports correctly and works). For me my app worked perfectly as long as there was no JS script in the events. If that’s the case then you may want to export the game manually once again and then in cmd do this (after you have installed the gihub addon - git smc: Git - Downloads):
Go to the exported directory of the exported project with cmd.
Wait until the plugin gets added to the directory and your project
After that in the same window type: cordova platform add android
Wait until it gets finished and then type: cordova build android
After that go to the directory shown in the cmd window (there should be a prompt that cordova successfully build android apk and saved it in a {} directory) everything should work
Hopefully that helps .
PS: you may want to type: “npm i -g cordova” to update it to the newest version.
Plus check what type of Java you have installed on your PC, If it’s JDK 1.8. (not JRE) then you’re good. If it’s JDK 9, 10, 14 or something new then for some reason it won’t work.
Plus make sure you have Android Studio IDE installed (preferably build 173, it automatically installs Android SDK and Gradles which are required to build android via cordova)
Of course i had exactly that problem you descriped (Problems with JDK a.s.o.)
After many installations, De-installations, Re-installations, i´ve found out that i hav to set the enviroment for JDK and Gradle.
I had several JDK Versions, so i deleted all of them but JDK 8. (1.8_XXX)
further i´ve found good sites where you get good explainments how to set the enviroment:
I’m glad it worked . Now you’re one step further towards the release. Once you get a hang on the manual export and then cmd you can open the exported project files in Android studio and, for example, change the color of your Splashscreen background (pretty simple to do) and more (pretty hard to do ).
I´ve tried to upload my apk, but Google Play prompt me an error because of debugable App.
I have to set debuggable to “false”.
I´ve try to change in android studio, but the file is readable only.
Where do i change this?