How can I create extension? (on phone with Niotron IDE)

Hello
How can i create extension for myself?
Thank you

Just install an extension builder first Rush or Fast
i recommend you to use Fast

[mod edit]

Create a New Project:

  • Open your terminal and navigate to the directory where you want to create your extension.
  • Run:

:zap: For Rush

  1. Open terminal at where you want to create a new RUSH project.
  2. Run rush create <ProjectName>
  3. Enter the package name.
  4. Enter author name.
  5. Enter version name.
  6. select Language (eg. Java/kotlin)
  7. Done.

:running_man: For Fast

  1. Open terminal at where you want to create a new FAST project.
  2. Run fast create <ProjectName>
  3. Enter the package name.
  4. Enter author name.
  5. Done.

Navigate to Your Project:

cd your_extension_name

Develop Your Extension

  1. Edit the Source Code:
  • Open the src/YourExtensionName.java file. This is where you'll implement your extension's functionality.
  • Use the following structure for your Java code:
package com.yourpackage;

import com.google.appinventor.components.annotations.*;

@DesignerComponent(version = 1, 
    description = "Your Extension Description", 
    category = ComponentCategory.EXTENSION,
    nonVisible = true,
    iconName = "your_icon.png")
public class YourExtensionName extends AndroidNonvisibleComponent {
    public YourExtensionName(ComponentContainer container) {
        super(container.$form());
    }

    // Your methods here
}

DesignerComponent and SimpleObject annotation can be used in fast but not in rush

in rush you'll use something like this

package com.yourpackage;

import com.google.appinventor.components.annotations.*;

public class YourExtensionName extends AndroidNonvisibleComponent {
    public YourExtensionName(ComponentContainer container) {
        super(container.$form());
    }

    // Your methods here
}
  1. Add Methods:
  • Define the methods you want to expose to App Inventor. Use the @SimpleFunction annotation for each method.
@SimpleFunction(description = "Your function description")
public void yourFunction() {
    // Implementation
}
  1. Add Properties:
  • Use the @SimpleProperty annotation to define properties.
private String yourProperty;

@SimpleProperty(description = "Your property description")
public String YourProperty() {
    return yourProperty;
}

@SimpleProperty
public void YourProperty(String value) {
    yourProperty = value;
}

Build Your Extension

  1. Compile the Extension:
  • Run the following command in your project directory:

:zap: For Rush

rush build

:running_man: For Fast

fast build

I hope this will help you. you can ask question if any

1 Like

Read a detailed guide of Fast here

Unfortunate, i dont have a laptop, i only have a phone and i always using a niotron ide and everytime i dont know how to set it as a extensiom

what do you mean by this

You should ask on the Niotron community.

closing

2 Likes