How to create an Extension

Most of Android library not working only JAR file need AAR file like - Java.class with Value.xml file.

2 Likes

I’m gonna try making an extension with no skills and some of googles help and see where I get my 1,00 errors worth of time :joy:, I’m unzipping appinventor-sources now.

Edit: I have successfully built my extension however added no blocks or properties, I wanted to test to see if it worked and now I’m on my way.

4 Likes

These may help you get on your way:

Taifun has shared some great source code here:
http://puravidaapps.com/clipboard.php

And here:
http://puravidaapps.com/headset.php

Scroll to the bottom of the page to see source code.

Also check out:
https://groups.google.com/forum/m/#!topic/app-inventor-open-source-dev

2 Likes

The new link is not working. It’s showing 404 Not Found.

1 Like

Updated the link

3 Likes

Very much appreciated! Waiting for the Video… Also if you can please Do a Example Extension Building from Scratch too. Thanks

1 Like

Template

Template.java (3.8 KB)

This will give you all blocks which can be used in Kodular and any other AI for an extension in case you can’t find it anywhere else. IT WILL THROW YOU AROUND! Also includes:

- Properties
- Defining variables
- Context is included in definition
- Some others

3 Likes

I have been looking for something like this for a long time!! Thank you very much

Hi, I am getting these errors :

BUILD FAILED
C:\AppInventor Source Code\appinventor\build.xml:35: The following error occurre d while executing this line:
C:\AppInventor Source Code\appinventor\build-common.xml:412: The following error occurred while executing this line:
C:\AppInventor Source Code\appinventor\components\build.xml:417: The following e rror occurred while executing this line:
C:\AppInventor Source Code\appinventor\components\build.xml:258: Compile failed; see the compiler error output for details.

These are the lines that cause errors :
(C:\AppInventor Source Code\appinventor\build.xml:35: The following error occurre d while executing this line:)

(C:\AppInventor Source Code\appinventor\build-common.xml:412: The following error occurred while executing this line:)

(C:\AppInventor Source Code\appinventor\components\build.xml:417: The following e rror occurred while executing this line:)
apt-target="${ComponentList-class.dir}/simple_components.txt"/>

(C:\AppInventor Source Code\appinventor\components\build.xml:258: Compile failed; see the compiler error output for details.)
includeantruntime=“false”>

Thanks

1 Like

You’re not supposed to build it, it’s an example… Create a new extension and just use those examples to create your blocks and use Android documentation to get your code. You are also meant to go into the AppInventor folder and CMD not the first AppInventorSources folder to build.

Oh Sorry, I did not compile the Template.java file

I did this and Build Failed

You’re supposed to do ant extension not ant.

Send me your Java file and I’ll take a look. If you trust me.

1 Like

So the thing mentioned there is wrong? And we must ant extension after making one extension?

You can try it.

1 Like

Can this be made into a Extension?

I’m not a magician. So I have no idea. The one thing I know can be included is the permission it needs :joy:

1 Like

But an extension Developer :grinning_face_with_smiling_eyes:

1 Like

Same but don’t know about the build.gradle adding and dependencies

1 Like

Do you think I know everything in this world? Let me know so I can respond with the correct answer…

Neither do I, I gave you a template to start with… Use this.

@DesignerComponent(version = 0,
                   description = "",
                   category = ComponentCategory.EXTENSION,
                   nonVisible = true,
                   iconName = "websiteToIcon")
@SimpleObject(external = true)
@UsesPermissions(permissionNames = "android.permission.READ_PHONE_STATE, android.permission.READ_PHONE_NUMBERS") // For example
public class ExtensionName extends AndroidNonvisibleComponent implements Component {
1 Like