Last active
August 6, 2021 19:34
-
-
Save pavi2410/c58954d86e8510e7300b1253c5ecca4a to your computer and use it in GitHub Desktop.
Create an extension for Kodular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @nathan5226 for reminding us to rename Makeroid to Kodular.