App development setup

If you are interested in creating apps, Appril gives you a plethora of choices!
The traditional technique to create Android apps is to code in Java, and for this Android Studio is provided.
Qt Creator is an alternative, where you can code in QML and/or C++ to create Android or Linux apps (may also be extended to other platforms).
Or, if you are a non-programmer, or just want to create Android apps the easiest possible way, with minimal learning-curve, visual design with App Inventor is the way to go.
Then there is LiveCode, with an easy GUI designer and simple scripting language, targeting multiple platforms (including Linux and Android).

Note that these tools are under various GPL licenses, and you need to understand those if you want to create an app to sell. Yes, it is allowed, including closed-source apps, however there are various conditions.

Android Studio logo Android Studio

Android Studio is a powerful tool for creating Android apps. It has a GUI drag-and-drop user-interface designer, and supports real-time evaluation of the app in an emulator or on an actual phone (via USB cable).

Android Studio requires the Oracle Java Development Kit (JDK) and the Android SDK. Both of these are in Appril. However, at first startup, Android Studio is not able to automatically locate them. Thus, it is highly recommended to click on the "AStudio" icon on the desktop right now, before doing anything else, and setup the paths.

At first startup of Android Studio, you will see this window, just accept the default:
startup1

The next window is a menu, and navigate Configure -> Project Defaults -> Project Structure, and then you will see this:
structure

Manually enter the paths as shown. PLEASE DO THIS NOW

Navigating back through the menu, you will find the SDK Manager. There is no need to run this just now. It populates the Android SDK, which is located at /root/Android/Sdk.
The Android SDK is already populated with support for Android 4.0.3 (API-15) and with an armv7 emulator. This is fine as the lowest version that you can design an app to run on -- which will cover 90% of the phones that are recorded as accessing the Google Play Store.

Note, when you do decide to run the SDK Manager, make sure that you have a fast Internet connection, and be prepared for the automatic selection of huge packages to download.
I repeat though, this is not required to get going and use Android Studio.

QtCreator logo Qt Creator

After the first startup, go to the menu Tools -> Options...

Click on Build & Run, and then the Qt Versions tab, and you will see this:
qt-versions

...make sure that the entry is there, "/opt/android/ndk-api15-armv7/platforms/android-15/arch-arm/opt/qt5a/bin/qmake". This is the Android build of Qt. Then click the Apply button.

Click on Android, and make sure that JDK location, Android SDK location, Android NDK location and Ant executable fields have entries exactly as shown here:
android


AI2 logo App Inventor

App Inventor (AI2) normally runs online, from the MIT servers, however, I have set it up to run offline, without needing an Internet connection.

Note, this also means you can run Appril's AI2 as a server over a local network. However, that is a more advanced topic. Just getting started for now...

You can visually design an app with the superb GUI on your PC, and you can at the same time see the app running in an emulator, or on your phone by simply connecting the phone via a USB cable.

In the phone, you need to install App Inventor Companion App from the Google Play Store, and enable USB debugging in the phone's Settings.
If you cannot find the setting to enable USB debugging, see here:
http://appinventor.mit.edu/explore/ai2/setup-device-usb.html

Then, plug in the USB cable and start App Inventor in your PC (the icon on the desktop labeled "AI2"). Choose the menu Connect -> USB, and that's it, you are in business.

Create your first app and see it run on your phone:
http://appinventor.mit.edu/explore/ai2/hellopurr.html

You choose Connect -> Emulator to use the emulator. Note though, that this is a bit slow and lacks some functionality of an actual physical device.

For further technical information about how I compiled AI2 and set it up to run in Appril, see here:
/usr/local/android_build/ai-build-readme.htm  

livecode LiveCode

LiveCode is an IDE with GUI drag-and-drop user-interface designer, and a simple scripting language for the backend glue. A major feature of LiveCode is that it will create standalone executables for Linux, Windows, Mac, iOS and Android.

Note however, the LiveCode bundled in Appril is cut-down and only targets Linux (x86) and Android (armv7).

The main thrust of Appril is to offer a variety of coding tools targeting Linux and Android. The cut-down LiveCode is adequate for this purpose, however, you may at any time download the full version.

It is recommended to register, and you will then be able to upgrade, and access other online resources. Appril has the GPL open source version of LiveCode, but for a fee there is a commercial version, with many more features.

To deploy to Android, the path to the SDK needs to be set in Preferences -> Mobile Support:
mobile

LiveCode is a bit different from the others. It does not use a phone-emulator, nor can it connect to a phone via USB. It does run applications in realtime within the IDE, however this is in the host environment, in this case Linux -- in other words, it does not emulate a phone at all.


Further links

There are many other ways to create applications for Linux, see the online file http://puppylinux.com/howto/programming.htm

LiveCode links:
http://livecode.com/ 
http://bkhome.org/news/?viewDetailed=00209

Regards,
Barry Kauler
August 17, 2015
(c) Copyright Barry Kauler 2015, all rights reserved