Tutorial Create Extension. Template. Source code. Build extension.

440 views
Skip to first unread message

Juan Antonio

unread,
Oct 20, 2017, 10:37:12 AM10/20/17
to mitappinv...@googlegroups.com
Hi friends, this is a tutorial to create extension. Build extension.

Let's create an extension on the Pythagorean theorem: pitagoras.aix


------------------------------------------------------------------------------------------------------

- Create in your PC-Windows this folder:

C:/AppInventorExtensiones

- Download in that folder these packages [or other recent version]


- Continue in this tutorial...


http://kio4.com/appinventor/125B_extensiones_crear_i.htm


- Install java JDK, GIT and ANT.

- Change User variables:

- Download appinventor-sources:





- Download Source code Pitagoras.java for Pitagoras.aix extension.



- Build extension:


- Then create other extension: Unetexto (Jointext)

-----------------------------------------------------------------------------------------------------------------

- Aquí tenemos el mismo tutorial en español. (Tutorial in Spanish)


-------------------------------------------------------------------------------------

To be continued.

In other post I will put a template file and other source codes.


- Regards.

TimAI2

unread,
Oct 20, 2017, 3:59:02 PM10/20/17
to MIT App Inventor Forum
Sets things up on Linux if you want to follow the tutorial:

##INSTALL LOCAL APPINVENTOR on LINUX (this with Xubuntu 16.04.3 LTS)
## All done in home directory (cd)
## Due to the paths chosen, had to use sudo to build and run
## replace USER with your username
## Open terminal:


## 1) Clone the AppInventor Sources
git clone --recursive https://github.com/mit-cml/appinventor-sources.git  << +500mb !!

## 2) Install dependencies and other items
sudo apt-get install ant
sudo apt-get install openjdk
sudo apt-get install lib32z1
sudo apt-get install lib32ncurses5
sudo apt-get install lib32stdc++6
sudo apt-get install libbz2-1.0  << not lib32bz2-1.0 as the howto suggests - superceded
sudo apt-get install adb

## 3) Set up Paths
export JAVA_HOME=/usr/local/build
export ANT_HOME=/usr/share/ant/adtools/java/jdk
export PATH=${PATH}:${ANT_HOME}/bin

## 4) Get and set appengine sdk
unzip appengine-java-sdk-1.9.58.zip
export PATH=$PATH:/home/USER/appengine-java-sdk-1.9.58/bin/

## 5) Create some directories
sudo mkdir /usr/local/build
sudo mkdir /usr/local/build/bin
sudo mkdir /usr/local/build/bin/java

## 6) Build Appinventor
cd appinventor-sources/appinventor
sudo ant clean
sudo ant MakeAuthKey
sudo ant              << took my machine @ 5 minutes

## 7) Run Local Appinventor
/home/USER/appengine-java-sdk-1.9.58/bin/dev_appserver.sh --port=8888 --address=0.0.0.0 /home/USER/appinventor-sources/appinventor/appengine/build/war/
localhost:8888 in browser

## 8) Run local Build Server
cd appinventor-sources/appinventor/buildserver
ant RunLocalBuildServer
sudo ant RunLocalBuildServer
localhost:9990/buildserver/vars    << gives info about build server


Andres Daniel

unread,
Oct 25, 2017, 10:21:52 PM10/25/17
to MIT App Inventor Forum
me sale este error

BlocksEditorHttpConstants:

BUILD FAILED
/appinventor-sources/appinventor/build.xml:16: The following error occurred while executing this line:
/appinventor-sources/appinventor/build-common.xml:325: The following error occurred while executing this line:
/appinventor-sources/appinventor/common/build.xml:170: The following error occurred while executing this line:
/appinventor-sources/appinventor/build-common.xml:118: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-8-openjdk-amd64/jre"

Total time: 1 second
andres@scw-51df30:/appinventor-sources/appinventor$

Juan Antonio

unread,
Oct 26, 2017, 3:44:02 PM10/26/17
to MIT App Inventor Forum
Hi Andrés, you text show this error...

Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-8-openjdk-amd64/jre"

perhaps system variable JAVA_HOME is bad configured.

try export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre


I work extension with Windows not Linux.

Juan Antonio

unread,
Nov 3, 2017, 10:09:54 AM11/3/17
to mitappinv...@googlegroups.com
Hi friends,

TEMPLATE CODE to BUILD EXTENSION

- file Plantilla.java is a Template to build a simple extension.

- It is a very simple extension, only is a didactic code.

- User set 

 textInput = Hola
 numberInput = 234

and extension return double number: 468 and this sentence by Event: Ya terminado Hola


- Copy, paste and try.



- Get template file in this link: http://kio4.com/appinventor/126_extensiones_plantilla.htm


Regards.


Juan Antonio Villalpando.








Reply all
Reply to author
Forward
0 new messages