Wednesday, September 01, 2010

HOWTO : App Inventor for Android on Ubuntu 10.04

App Inventor for Android is another example of Cloud Computing. You can build your Android apps from the Java enabled browser and sync to your Android device at ease. In addition, everyone can build Android apps by App Inventor for Android without any deep knowledge of Java and/or programming.

Go to Register Form to register your account for App Inventor for Android. You may require to wait for several weeks in order to receive the access permission email from Google.

On your Android device

Download and install "AppInventor Toggle" from the Market of your Android device.

Run "AppInventor Toggle", press "Menu", enable "Cable Detection" and disable "AppInventor Orientation".

Exit "AppInventor Toggle", Press "Menu", "Settings", "Applications" and "Development", then enable "USB Debugging"

On your Ubuntu 10.04 desktop

Ubuntu 10.04 comes with OpenJDK (open source version of Java) and it is ready to go. You can download OpenJDK at Ubuntu Software Centre if it is not installed. Or, you can use Sun Java instead but you are required to enable the repository at "System", "Administration", "Synaptic management".

Be keep in mind that App Inventor for Android official site recommend Sun Java instead of OpenJDK. If you encounter abnormal behavior on the web application, please install Sun Java instead.

Go to Extra Software page and download the Debian package. The current version at this writing is 1.02.

sudo dpkg -i appinventor-extras_1.02_all.deb

You may encounter "Unable to get SyncService for device" when you are connecting to your Android smartphone from Blocks Editor of App Inventor web application. The following is the procedure to solve this problem.

sudo nano /etc/udev/rules.d/51-android.rule

Append the following line.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ff9", MODE="0666

Create a shell script.
nano android-syncservice

Append the following lines.
#!/bin/sh
# Solve the problme of "Unable to get SyncService for device" while connecting to Nexus One under Blocks Editor of App Inventor
cd /usr/google/appinventor-extras/commands-for-Appinventor/
./adb kill-server
./adb devices
cd ~
exit 0


Copy the shell script to /etc/init.d and make it running automatically on every boot.
sudo cp android-syncservice /etc/init.d/
sudo chmod +x /etc/init.d/android-syncservice


sudo update-rc.d android-syncservice defaults

Or, you may require to reboot your system when need.

Now connect your Android device to your Ubuntu 10.04 desktop with the USB cable. You are ready to go ....

Follow the instructions at Connect App Inventor to Your Phone.

Then, study the Tutorials.

Finally, Live Development, Testing and Debugging.

Known Issue

The size of the apk (application package) is quite large, it is at least about 3 to 4 MB of size for a very simple application, such as tutorial apps.

That's all! See you.