SDK & Connecting Devices

I use latest Processing 3 software. I removed all existing SDK, Android Studio etc to get clean start.

1- Reinstalled android studio to start with

2- Used SDK updater of Processing… no update available… as 30, 29, 28 etc are installed in Android Studio and Processing are both referring to android.sdk.path=C:\Users\ruijtpie\AppData\Local\Android\Sdk

3- Genymotion device level 28 is running… but nothing is recognized by Processing.
-> also mobile device on USB not recognized

So it seems I do have a problem, but don’t know (after a almost a day search… reinstall etc etc) what else I can do.

I use APDE for all my work for Android, but I work on my PC for editing.
I use an app called Pigeon which shares the clipboards from PC and phone.
So I edit on my PC, and when I want to test my code, I press select/copy all, and then on my phone with APDE already open select/paste all. After that, I press run, and the code is compiled within a few seconds. Here you can find some Android code for views etc, @uheinema also has a nice repo here, with libs like OpenCV for Android, sound, fonts, etc.
If you have problems with the SDK you can try this.
Android Studio is of course the ultimate, but personally, for me, it’s a big Christmas tree, with too many bells and whistles, that my modest PC simply can’t handle. It takes hours to compile something.

Thanks, for your response. I reinstalled your downloadable SDK in Documents>Processing>SDK and referred to it in the reference file. But no device is recognized, although I do have Genymotion running. Processing works fine in Java, Java Script and Python mode. So I don’t know what else I can do here.

That is another difficulty, and is almost always a device driver problem.
Sometimes resetting the ADB ( in menu) helped.
Also sometimes it only worked using the USB port on the back of the PC.

Hello again,

I imaged my laptop to original status. And guess what… I got Android on processing to work. But only thanks to your SDK download and implementation. Because the download via Processing doesn’t work even on a clean machine. My mobile phone is recognized as well. And I can work nicely now with the book “Processing for Android”. I am also going to test this environment to preset Processing configuration on a Virtual Machine. So my students do not need to bother with the installation as I do.

I do have an other question. The book I currently follow only deals specific with the graphics capabilities. I do not have a clue how to create new activities and buttons as in Android Studio. (Actually I am trying to avoid Android Studio because of it’s many wissels and bells). Do you maybe have a suggestion where I could look for it. Maybe there is a book or dedicated reference in this respect.

Anyway, I can continue my journey.

Thanks again.

I already posted some links above (not visited until now), where you can find most of what you need. On request, I can add other views or methods. (If I’m able!)

Hi … for what it;s worth … my thoughts …

I have used Processing/Android Mode for a few years now and whilst it makes it very easy (once you have a working setup!) to code and run an Android app, to do more advanced stuff you are better in Android Studio. It depends what you want to do. I see you are using with students … what age and what level and what are the learning goals? If you are aiming to teach Android development then Android Studio is best, but if it is beginner programming (especially youngsters) with the fun element of being able to have a phone app, then Processing with Android Mode is a great way in. Processing itself isn’t java, although the basic rules syntax etc is the same so it’s a good starting point. The power of Processing is that it is incredibly easy to have something working with very little effort, which is great for beginners. Having said that, you can do lot with processing, and develop skills/knowledge that readily transfers to 'proper’java. Android Mode is the same … it hides the tricky things that make learning coding difficult, but can, for example, import from the android api if the needed functionality isn’t available by default. This is quite a good way into exploring the android sdk.

Re creating new Activities in a Processing sketch … I don’t think you can do this. Android mode just provides a Fragment that you code within … basically allowing for the coding of of a single view (I think!). I have never found a way to add activities or fragments within Processing. If I’m wrong, then I would be keen to know how! To get round this, I use a switch variable (displayMode is what I call it) within draw() so that different pieces of code run in draw() for differing screens.

Books are hard to find!. There is a good one from a few years back that covered the Ketai contributed library, but I think Ketai is now a bit behind Processing, with a number of compatibility issues. It may be OK now but when it started not working for me after an Android Mode upgrade, I decided to dig into the android sdk directly. That’s the trouble with contributed libraries … great if they are continually updated etc but no good long term if they’re not. It’s also a good way into ‘proper’ android for your students if they have to access the sdk documentation!

Some things are easy to do … eg making a Button. You could go to the android sdk and learn how to do this with all the various setup requirements and listener callbacks etc but a very easy way is in Processing to define your own simple Button class. Give it methods to draw rectangle or display an image, and a method to return a boolean TRUE of it is clicked (or tapped). … called from mousePressed() or alternatively touchStarted() in Android Mode.

Enough for now …

Happy to help more if you have specific questions.

Mark

1 Like

Do you have developer enabled on your phone?

Yes… and it works now with external device!