Android Tutorial GUI SDK Manager for newer versions of Android tools

Status
Not open for further replies.
Edit: If you are using B4A v7.8+ then a newer version of B4A Sdk Manager is preinstalled. Follow these instructions instead: https://www.b4x.com/b4a.html#installation

The GUI interface of Android SDK Manager has been removed in the latest version of Android SDK.
It was replaced with a command line tool named sdkmanager.bat.

Most developers, including new B4A developers, still use a version which does include the GUI interface, as the B4A download page points to an older version.
You can continue to use the currently installed Android tools.

A custom tool named B4A SDK Manager is provided as an alternative for developers who like to upgrade:

SS-2017-06-06_12.53.22.png


Installation instructions:

1. Download the latest sdk tools: https://developer.android.com/studio/index.html#command-tools
2. Create a folder for Android SDK. Don't put it under Program Files as it is a restricted folder. C:\android-sdk is a good option.
3. Unzip the sdk tools and copy the tools library to android sdk folder. It should look similar to:

SS-2017-05-29_15.44.54.png


4. Download B4ASdkManager.jar and double click on it. It requires Java 8u40+ to be installed.
5. Click on the open folder button and select sdkmanager.bat. It will be under <sdk path>\tools\bin
6. Install all recommended items. It can take a few minutes or more.
Licenses agreements will be printed. Read them and approve.
7. Don't forget to update B4A IDE to use the new SDK (Tools - Configure Paths - android.jar).

Next tutorial: AVD Manager / Emulator

The B4J source code is attached. It depends on jShell v1.5+.

Android SDK currently doesn't support Java 9. Make sure that B4A is configured to use Java 8 (Tools - Configure Paths).
 

Attachments

  • B4A-SdkManager-Source.zip
    63.3 KB · Views: 4,089
Last edited:

eSolution

Member
Licensed User
I updated to 7.80 and I deleted my Android Sdk that was installed with Android Studio and I installed a new one as explained above (using the SDK Manager from B4A).
Now B4A can't compile my apps because it can't find the appcompat styles. I installed B4A 7.8 on my desktop where I still have the Android SDK from Android Studio and it compiled the app without any problem... So with the Android SDK installed by the included SDK Manager we have missing files i think... I get this error: "AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.AppCompat')."

How can I fix this without installing Android Studio and using its SDK? (is another 10G of wasted SSD)
 

anaylor01

Well-Known Member
Licensed User
I am getting these errors:
Error: org.apache.commons.exec.executeexception:The stop timeout of 500 ms was exceeded (exit value: -559038737)
java.ioexception:C:\tools\lib is not a folder

I am using Windows 10 Build 16299
 

lemonisdead

Well-Known Member
Licensed User
Is the code still the same with B4A 8.30, please ? (new working icon excluded, of course) Thanks
 

Erel

Administrator
Staff member
Licensed User
FindJava was updated:
B4X:
Private Sub FindJava As String
   If JavaPath <> "" Then Return JavaPath
   JavaPath = GetSystemProperty("java.home", "")
   Log($"Java Path: ${JavaPath}"$)
   Dim s As String = GetSystemProperty("java.version", "")
   If s.StartsWith("9") Or s.StartsWith("10") Then
       AdditionalJavaOpts = " --add-modules java.se.ee"
   End If
   Return JavaPath
End Sub

There might be some other small changes.
Tip: you can use this tool to quickly compare the codes: http://winmerge.org/
 

lemonisdead

Well-Known Member
Licensed User
Thanks Erel. I have asked because I couldn't see if the code in the first post was updated and got error 1252 with the manager from B4A and not with the previous version of that one. Would create a new post if required.
 
Status
Not open for further replies.
Top