We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have added "processing-android-core.jar" file to my Android Studio project. In order to run my Processing sketches on Android Studio I also need classes like "PFragment" and for my project "JSONObject". They are not included in the added "jar-file". It is quite hard to locate those files.
Can anyone point me to the right files?
Kind regards,
Niels
Answers
Try exporting your application (or an/any application) from the Processing PDE. Then go to the generated folder and check what jars are being bundle together as part of the export.
Kf
Great, this indeed works for most of the code..
I follow the procedure explained on the website: http://android.processing.org/tutorials/android_studio/index.html
My code to load the code "Sketch.class" is the following:
}
Two errors here: - The "onRequestPermissionsResult" call requires API level 23, this would allow me to target only 40% of devices. Is there a way to circumvent this call and include more devices?
Any ideas, suggestions?
Thank you very much for your help..
@nvwingh===
as for testing p5 code with AS you have only to export it (with P5) as android project; then go to AS and on launch select "import from existing code" and choose your android folder created when you exported as the src code.
the call for permissions does not requires API level 23 (or more); the main activity extends appCompatActivity and (with P5) the minSDK is 15 (or 16, i dont remember)
put the code you are using in the fragment. Are you using "dangerous permissions"??? - and what version of the android mode are you using?
have a look (with AS) to your buil.gradle and your dependencies
I have exported it with Processing, then imported it as an Android Project. Seems to work, they use a few additional libraries, now the code seems to work. Only question is how to do this properly with an existing Android Project.
Will try to add all the libraries and the code and then launch again.. Step in the good direction, thank you!