Hello to anyone who is reading this. I’ve developed apps on Kodular without problems, but now its time for me advance my skills and start creating extensions. I have read through all extension threads and have read everyone’s response to issues pertaining to extensions and extension making. I decided to do a test run and make an extension with 1 block after watching many YouTube videos. Here is my code that I have started.
~ CODE ~
package io.makeroid.jc1bryan_82242.LightningKings;
import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;
import com.google.appinventor.components.runtime.EventDispatcher;
/import com.google.appinventor.components.annotations.;
import com.google.appinventor.components.runtime.;
import com.google.appinventor.components.common.;
package com.google.appinventor.components.runtime;*/
@DesignerComponent(
version = 1,
description = “Extension made with Kodular IDE”,
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = “https://ide.kodular.io/assets/logo.png”)
@SimpleObject(external = true)
public final class LightningKings extends AndroidNonvisibleComponent {
/**
Creates a new component
*/
private int num1,num2;
public LightningKings(ComponentContainer container) {
super(container.$form());
}
@SimpleFunction(description="")
public void GetValue(int number1, int number2){
num1=number1;
num2=number2;
int res = num1+num2;
GotValue(res);
}
@SimpleEvent(description="")
public void GotValue(int result){
EventDispatcher.dispatchEvent(this, “GotValue”, result);
}
}
~ END CODE ~
Im not sure what the problem here is. If anyone would like to chip in and help, that would be greatly appreciated.
Last question is once i compile and create the extension, can i import it straight to my application? Heres a better example. “I download the extension from the email that was sent to me, I open it up and download it.” Can I then import it straight to my application?
Once again any help is appreciated. Thanks to all who give their advice and input! Have a great day!!