Skip to content

Instantly share code, notes, and snippets.

@pavi2410
Last active Aug 6, 2021
Embed
What would you like to do?
Create an extension for Kodular
package io.kodular; // package of the extension will be "com.kodular.SimpleMaths"
// Only these imports are required to interact with Kodular
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.*;
@DesignerComponent(version = 1, // Update version here, You must do for each new release to upgrade your extension
description = "Simple Maths extension created by you",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "images/extension.png") // Change your extension's icon from here; can be a direct url
@SimpleObject(external = true)
public class SimpleMaths extends AndroidNonvisibleComponent {
public SimpleMaths(ComponentContainer container) {
super(container.$form());
}
@SimpleFunction(description = "Simple addition of two numbers")
public int Add(int a, int b) {
return a + b;
}
@SimpleFunction(description = "Simple subtraction of two numbers")
public int Subtract(int a, int b) {
return a - b;
}
}
@pavi2410
Copy link
Author

pavi2410 commented Dec 10, 2018

Thanks @nathan5226 for reminding us to rename Makeroid to Kodular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment