Can't get started with Android Mode and SDK

Hi, I’m trying to get started with Android mode. When I switch a blank sketch to Android mode it offers to auto-download the SDK or for you to locate it.

If I select auto-download it fails, same as here. I’ve tried removing and re-installing Android mode - no help. (The remove from manage libraries did nothing, I had to delete the directory.)

I’ve tried downloading the SDK command line tools, and pointing it at that e.g. D:\Programs\Android_SDK_cmdline-tools. There are bin and lib directories in there, tried them all and it doesn’t accept any.

Windows 10 Home, 22H2. Processing 4.3.1

Any help appreciated.

On my Windows 11 system the Sdk folder is at C:\Users\yourName\AppData\Local\Android\Sdk

Processing also has an android sdk at C:\Users\yourName\Documents\Processing\Android\sdk

Sometimes it helps to install Android Studio and use their Tools/SDK Manager

It installed and downloaded here with Processing (not Android Studio) using the same configuration.

I did have to add it manually to preferences.txt:

Add it to preferences.txt while Processing is NOT running.

:)

@svan. @glv, Thanks. I’ll try the Anrdroid studio and give Processing another try after that.

I have Android Studio (AS) installed and working. I can run a program on a phone. (It only runs from the Studio, apparently if you want an installed program you have to do more things. Not followed that up yet. The Processing way was better when I had it working a while back.)

When I try to run Processing Android Mode it complains about the SDK: “… install the SDK Platform for API 33”. At the top of AS there is “Medium Phone API 35”. so I think that’s the issue. I’ve found the SDK manager and am downloading v 33. More soon I hope.

I’m not winning. Whatever I try the Processing does not accept the SDK. In AS i deselected 35, selected 33, waited for it to adjust everything. Not convinced it deleted 35, I deselected both, waited, deleted the SDK files manually, reselected 33 - same.

I’ve seen words like “for the SDK manually, then download SDK command line tools”. Is the SDK the same as the CommandLineTools?

I’ve tried to find the SDK API 33 to download manually. Find lots of recommended links that say how to do it in AS. Found links that are broken. Maybe it’s moved, been deleted?

Any help appreciated.

Hello @RichardDL ,

I tried this from scratch and deleted Android Mode, Android folder, preferences.txt and had no issues on this PC.

Processing 4.3.2
W10 Pro 22H2

I can download successfully here after installing Android mode:

Try this:

  • Try and download the Processing Android SDK on another machine.
  • Copy the Android folder to your Processing folder (default) in Documents
  • Modify Preferences.txt as required to point to SDK if you have issues. Edit it while Processing is closed.

:)

@glv, Thanks for the pictures, that’s what I would expect. When I click on ‘Download SDK automatically’ it shows a dialogue: “Bad News… The Andriod SDK could not be loaded. The Android mode will be disabled.” This appears instantly, so quickly it makes me think it hasn’t gone out to the internet. (Internet is fine, YouTube, Processing Forum, etc.)(Not disk full.)

  • try updating Processing to 4.3.2 - no better.
  • Try another computer (borrowed) Windows 10 Enterprise, 22H2. Processing 4.3 (.0?) - yes, downloading and stable in Android Mode.
  • Tried 2 phones - and they run the sketch!

Samsung Galaxy S5 Neo, SM-G903F, No Sim
Samsung Galaxy S7, SM-G930F, Sim

That’s very good, thanks for the comments. Would be nice if the other computer would work, but another day.

2 Likes

Hi @RichardDL, what is the model of the computer on which this is failing?

Based this comment on GitHub, a possible workaround is to install the Android SDK manually:

downloaded android studio manually and using its sdk manager downloaded API 26 platform. Then instead of download, located to the path to Android SDK. It is also could be seen in Processing File > Preferences > C…\ preferences.txt like this: android.sdk.path=C:\Users\MyName\AppData\Local\Android\Sdk

1 Like

Hi @sableRalph, thanks for your interest. The failing computer is Windows 10 Home, 22H2. Processing 4.3.2. The working one is the same but ‘Enterprise’. Now I’ve copied the sdk directory from the working computer to the non-working. Also copied the preferences.txt. Also moved Processing (.exe etc.) and the sketch directory from D: to C:. Now everything is the same as the working PC but it still does not work. When it says ‘Locate the sdk manually’ I paste in the string lifted from explorer ‘C:\RDL\Processing\android\sdk’ (the same as is already in preferences.txt) and it says “The Android SDK could not be loaded”. I wonder what ‘loaded’ means and what is going wrong.