LiveCode and Android Studio - 8.1.5 onwards

As of LiveCode 8.1.5 you can use Android Studio with LiveCode to set up Android deployment.

In this lesson we assume you have the Java SDK installed, if you have not done this yet please follow the steps in the relevant lesson.

How do I Become an Android Developer on a PC?

How do I Become an Android Developer on a Mac?

How do I become an Android developer on Linux?

 

Opening the SDK Manager

Opening the SDK Manager

Begin by starting up Android Studio.

LiveCode requires the Android 4.0.3 (API 15) Package to be installed. To open the SDK Manager, which allows additional packages to be installed select SDK Manager from the Configure menu on the Android Studio opening screen.

Installing the required packages

Installing the required packages

The Android SDK Manager lets you select the packages you would like to install in you Android development environment. By default, only a few packages are selected. From this version of the SDK I would recommend keeping the default selection.

LiveCode requires the Android 4.0.3 (API 15) Package to be installed. Select Android 4.0.3 (IceCream Sandwich) in the list and click the Apply button to install the package.

Note: you can see the Android SDK location at the top of the Window, take a note of this as you will need it in the next step.

Configuring LiveCode for Android Support

Configuring LiveCode for Android Support

By now, you should have successfully installed the required software in you development environment. The next step is to launch LiveCode and configure it to interface with the Android SDK.

Launch the LiveCode IDE and select Edit -> Preferences to launch the Preferences menu. Then select Mobile Support and you are presented with the dialog shown in this step.

This dialog allows you to configure the path to the Android SDK root, which you should already have installed. Select ... under Android SDK and choose the folder containing the Android SDK root.

Validation checks are made once you specify the location of the Android SDK root. This ensures that you have selected a valid location and have the required Android components installed.

The following error message may be raised if something is wrong with your set up:

The chosen folder is not a valid Android SDK. Please ensure you have installed it correctly, and enabled support for Android 4.0.3.

This indicates that the path you specified is not pointing at the Android SDK root. You may have to navigate one level deeper into the folder hierarchy to access the root folder. The root folder may look something like: ...android-sdk-windows.

Deploying to an Android device

Now you have your LiveCode Android preferences set up you can deploy to an Android device or emulator.

You can find a description of these setups in the following lessons

How do I Become an Android Developer on a PC?

How do I Become an Android Developer on a Mac?

How do I become an Android developer on Linux?

 

11 Comments

Nelson

I tried configuring the Android SDK without luck. Installed Java in the same directory and the Android SDK and the same message appears. The Android SDK installed is the 4.0.3 using the Android Studio. The Java is the latest version. Any help on this?

Tom Bodine

Be sure you have LiveCode 8.1.5 or later. Older tutorial lessons have directions that may not work for the latest LiveCode. (You didn't say what error message you are getting, so hard to give specific advice.)

Christopher Flatt

Should this work on Mac OS X Sierra, with Livecode 8.1.4? I'm not having success here...

Panos Merakos

Hi all,

As Tom said, this lesson will only work with LiveCode 8.1.5 RC-1 or later.

Best,
Panos
--

Tom Bodine

Hi,
I have 8.1.5 (on Windows) configured with the Android sdk and java path is populated. And I've created a virtual machine with AVD Manager. However, the "test" and "test target" menu items remain grayed out, as does the toolbar's "Test" icon. What is the trick to making LC use an Android virtual device in LC 8.1.5?

Panos Merakos

Hi Tom,

You have to open a stack, and select "Android" in the standalone application settings. This should enable the "Test Target" and "Test" options.

Tom Bodine

Still not working. I tried two approaches:
1) Opened an AVD. Then opened LC 8.1.5 (rc1), opened a stack, selected only the Android build options, confirmed Android SDK selected in Preferences. But all "Test" options remained grayed out.
2) Reset test by quitting the AVD and LC. This time, opened LC 8.1.5 first. (All Test menus grayed out.) Confirmed Prefs > Mobile Support show the Android SDK and JDK paths. Confirmed Standalone App. Settings is checked only for Android build. ("Test" menus still grayed out.) Then opened Android Studio and launched AVD Manager, selected my AVD and launched it. AVD fully loads, but LC test menus remained grayed out.

Advice?

Tom

Panos Merakos

Hi Tom,

Hmm that's strange. Sometimes the "Test" button of the LC menubar is greyed out for me too (although I have the proper setup). However, if I just click on it, it is enabled. If you have not done this already, I suggest you give it a try.

BTW which version of Android Studio are you using? And how do you launch the AVD Manager?

Panos
--

Tom Bodine

Clicking the greyed Test icon does nothing. I have Android Studio 2.3.3. I launch my AVD from Studio using menu Tools > Android > AVD Manager. Then I launch my virtual device by clicking the green arrow under Actions.

Panos Merakos

Hi Tom,

I have exactly the same setup and it works as expected for me. I suggest you file a bug report at quality.livecode.com so as we can investigate this issue further.

Best,
Panos
--

Tom Bodine

Panos,
Are you using the 64-bit version of Android SDK or x86? Mine is the 64-bit. Wonder if that could be the issue.
Tom

Add your comment

E-Mail me when someone replies to this comment