All about Extension Template

What is Extension Template?

It is simplified and lightweight version of AI2 Sources, and it comes with deps and tools which is actually needed.

So now you need not to download complete source to build extensions.You will have to download in case you want to create your own version of ai2.

 

Why you need it?

This is a question which no one can answer correctly because everyone has own thoughts and perspective.

Most of the extension developers firstly run toward Code Editor by Appy Builder (Now merged with Kodular).It is a great tool but like everything it has its own limitation.You can’t add external jars there which means that you can only use jars available in AI2 System.

However, it does not need any extra setup and is easy to use so you can give it a try or if you have already worked on it then make sure to comment your experience.

After considering above facts, Mr. E.W. Patton created a lighweight tool which lets you customize it(extension development) as much as you can and that’s named Extension Template (it is actually a template).

How to setup it?

Earlier, it was quite hard to setup AI2 Source to create extension , but that problem has been solved a little bit.

Let’s divide it in steps.

First and the most important thing is installing Java.You are suggested to use Java 8 which you can download from here.

i) After downloading zip file extract it to a safe place.

ii) Now add JAVA_HOME  system variable with value as jdk dir path.Something like C:\Program Files\Java\jdk1.8.0_261

You need Apache Ant to run commands to create extension.You can download it from here.

i) Extract it to safe place after downloading zip file.

ii) Add system variable named ANT_HOME with value as installation dir.Something like D:\apache-ant-1.9.14

Similarily add another variable named ClassPath  with value as bin subdir path of ant dir.Or you can just put %ANT_HOME%\bin there.

Git is needed to fork and install deps of extension template.You can download it from here.

It has GUI which will help you in setting it up.

You can use Notepad too but it has basic options so better will be to use a rich text editor such as Sublime(Paid with Free Trial available) or Atom(Free).

However, I will suggest to use Intellij IDEA or Eclipse as they are more than a text editor i.e. IDE.

Github Repo: https://github.com/mit-cml/extension-template

Although you can download the master branch and get your work done but it is highly recommended to fork it.

i) Open CMD

ii) CD into dir where you want to fork repo

iii)run git clone –recurse-submodules https://github.com/mit-cml/extension-template

iv) CD into template dir and run git submodule update –init

 

Add jars in /lib/deps dir and @UsesLibraries(libraries = “jar_name.jar”) annotation in extension’s java file.

You can ask a question,post issues in this AI2 Community Topic:

https://community.appinventor.mit.edu/t/extension-template-repository/4452

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments