Sander
(Sander Jochems)
July 11, 2017, 8:32am
#1
This guide is old. Please follow this updated guide: Create Extensions - Kodular Docs
Hello,
I this Tutorial I am going to teach you how to create Extensions for AppInventor and Makeroid.
Tools you will need:
Step 1: Download and Install Java JDK
Click to Download
Install Java JDK
Set the Environmental Variables:
Set “JAVA_HOME
” to your install Java install path. Example: “C:/Java/jdk1.8.0_31
”
Edit “PATH
” and add those:
%JAVA_HOME%/bin
%JAVA_HOME%/jre/bin
Set “CLASSPATH
” to “%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar
”
Step 2: Download and Install Apache Ant
Click to Download
Download Apache Ant 1.10.1
Unzip the folder and move it to a place where it is safe
Set the Environmental Variables:
Set “ANT_HOME
” to the Folder where ant is. Example: “C:/Ant/apache-ant-1.10.1
”
Edit “Path
” and add “Folder where ant is+ \bin
”. Example: “C:/Ant/apache-ant-1.10.1\bin
”
Edit “ClassPath
” and add “Folder where ant is+ \lib
”. Example: “C:/Ant/apache-ant-1.10.1\lib
”
Step 3: Download and Install Git Bash
Click to Download
Download and Install Git Bash
Step 4: Download AppInventor Sources
Click to Download
Download appinventor-sources
Unzip the folder and move it to a place where it is safe
Step 5: Testing if it works
Go to your appinventor-sources folder and open the appinventor
folder
Right click in the folder and select “Git Bash Here
”
Type “ant
” and click on enter
If says: “BUILD SUCCESSFUL
”, then you can go to Step 6
If says: “BUILD FAILED
”, then you did something wrong or missed a step
Step 6: Building an Extension
SimpleExtension.java (2.8 KB)
Download the file and move it to “appinventor-sources/appinventor/components/src/com/sanderjochems/
”
Note: If you want a other package name, then you need to put the SimpleExtensions.java in a other folder and update the package name in the file
Go back to the “appinventor
” folder
Right click in the folder and select “Git Bash Here
”
Type “ant extensions
” and click on enter
If says: “BUILD SUCCESSFUL
”, then you can create Extensions
If says: “BUILD FAILED
”, then you did something wrong
35 Likes
BEST TUTORIAL LINK: YouTube
6 Likes
but voice of the host was not clear
Sander
(Sander Jochems)
August 5, 2017, 2:20pm
#5
I will try to create a video tutorial on how to make extensions. With my high quality microphone according to a very cheap chinees webshop
8 Likes
good going to be helpful for freshers
3 Likes
any way to resolve this error
java.lang.RuntimeException: Cannot convert Java type 'java.net.URL' to Yail type
pavi2410
(Pavitra Golchha)
December 1, 2017, 2:47pm
#8
What object is your parameter? You take Strings, int, boolean, views as params
1 Like
It is url.
imported this
import java.net .*;
i am just try to learn how to create extension.
my methord is
public long getFileSize(URL url) {
HttpURLConnection conn = null;
try {
conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("HEAD");
return conn.getContentLengthLong();
} catch (IOException e) {
return -1;
} finally {
if (conn != null) {
conn.disconnect();
}
}
}
pavi2410
(Pavitra Golchha)
December 1, 2017, 2:54pm
#10
You can only use that objects as params which can be dragged and snapped into a socket like number block (int), text block (String), etc
1 Like
pavi2410
(Pavitra Golchha)
December 1, 2017, 2:58pm
#12
You can look into source of Web component for how to get URL input.
4 Likes
yeah i am finding it .
right now i am thinking to take string as parameter and later on convert in URL.
i will update when i find it
This post was flagged by the community and is temporarily hidden.
pavi2410
(Pavitra Golchha)
December 1, 2017, 3:12pm
#15
This post was flagged by the community and is temporarily hidden.
import android.os.Build.VERSION;
public static final int VERSION = 1;
pavi2410
(Pavitra Golchha)
December 1, 2017, 3:17pm
#18
import android.os.Build;
Check -->
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP /* 21 */) {
...
}
pavi2410
(Pavitra Golchha)
December 1, 2017, 3:19pm
#19
This post was flagged by the community and is temporarily hidden.
This post was flagged by the community and is temporarily hidden.
TRY THIS
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < android.os.Build.VERSION_CODES.LOLLIPOP) {
// YOUR CODE
}