App Inventor, compiling and setup

Usage information about App Inventor is in this file:
/usr/share/doc/app-dev-setup.htm

The packages 'jdk' and 'ant' are required to compile App Inventor. Appril has both of these.

Download App Inventor sources to a partition with Linux filesystem, and compile:
# git clone https://github.com/mit-cml/appinventor-sources.git
# cd appinventor-sources
rename sample-.gitignore to .gitignore
# cd appinventor
# ant clean
# ant
If you want to read more details about the above steps, see here:
https://docs.google.com/document/pub?id=1Xc9yt02x3BRoq5m1PJHBr81OOv69rEBy8LVG_84j9jc

I have written a script, 'ai-src2pet', that extracts all required files out of folder 'appinventor-sources' and builds a folder named 'appinventor-<date>'.
The script then creates a PET package, 'appinventor-<date>.pet (which is the native package format for Puppy Linux and derivatives).

The script 'ai-src2pet' and image 'appinventor.png' are in /usr/local/android_build, and need to be copied to the same place as folder 'appinventor-sources' (but not in it), then open a terminal and run the script:
# ./ai-src2pet
Note: reading some of the docs at the MIT site, it is stated that package 'Appengine Java SDK' is required, which has the server required for the browser (that is, AI2 is a web-app, and the user interface is provided via a web browser window).
However, the Appengine Java SDK is also available in the App Inventor source, that is, inside folder 'appinventor-sources', and is extracted into the PET.

AI2 Companion App

An Android phone can be used to test an app as it is being created in App Inventor. The phone may be connected either via wi-fi or USB cable to the PC (that is running Appril). The AI2 Companion app needs to be installed into the phone.

Note, the AI2 Companion app was built in "appinventor-sources/appinventor/build/buildserver/MIT AI2 Companion.apk", and this is in Appril at /opt/appinventor -- it can be installed in the phone, by what is known as "side loading".

The AI2 Companion App is available from the Google Play Store, and this mode of installation is recommended as it automatically offers to update the installation.

USB

An Android phone can be connected via USB cable, and an app run in realtime as it is being developed in AI2.

This requires package App Inventor Setup, which is documented here:
http://appinventor.mit.edu/explore/ai2/linux.html

I have created a very cutdown ai2-setup, read below.

Emulator

AI2 will also work with an Android emulator. This requires that the AI2 Companion app be installed into the emulator.
This is taken care of at first startup of AI2 -- see script /usr/sbin/appinventor.sh and /usr/local/android_build/ai-emulator-setup.

MIT provide an 'ai2-setup' package, that has the utility 'aiStarter', used for connecting AI2 to a phone via USB, and various files taken from the Android SDK for using AI2 with an emulator.

I have created a skeleton 'ai2-setup', this is located at /usr/google/appinventor.
This is provided as AI2 looks there for certain files, however I have replaced the script /usr/google/appinventor/commands-for-Appinventor/run-emulator with my own, that uses the Android SDK directly.

In other words, my skeleton ai2-setup (that I have named aistarter*.pet), does not have any files from the Android SDK, as my script accesses them directly in the Android SDK (which is located at /root/Android/Sdk).

Links

These are further instructions at the MIT App Inventor site:
http://appinventor.mit.edu/explore/ai2/setup.html
Instructions when connect phone by usb cable:
http://appinventor.mit.edu/explore/ai2/setup-device-usb.html
Linux-specific instructions:
http://appinventor.mit.edu/explore/ai2/linux.html

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