Editor.appybuilder help with code

Help with the code. Make me a code template please. I want to put one link in the code, eg https://community.kodular.io

/** ~~~~~

  • Created with the AppyBuilder Code Editor.
  • This is a template for basic Extension.
  • Modify this template to customize your extension.
  • **** NOTE: DO NOT use a package name.
  • **** The package name will be created for you automatically.
  • **** Adding a package name will cause a compile error
    /
    import android.content.Context;
    import android.util.Log;
    import com.google.appinventor.components.annotations.
    ;
    import com.google.appinventor.components.runtime.*;
    import com.google.appinventor.components.common.ComponentCategory;

@DesignerComponent(version = 1, description = “This Extension was created with the AppyBuilder Code Editor.
” +
“Create your own here:
https://editor.appybuilder.com
”,
category = ComponentCategory.EXTENSION,
nonVisible = true, iconName = “http://appyBuilder.com/extensions/icons/extension.png”)
@SimpleObject(external = true)
public class Link55 extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
* @param container container, component will be placed in
*/
public Link55(ComponentContainer container) {
super(container.$form());
this.container = container;
}

@SimpleFunction(description = "Stores a value in TinyDB")
public void StoreValue(final String tag, final String valueToStore) {
    TinyDB tinyDB = new TinyDB(container);
    tinyDB.StoreValue(tag, valueToStore);
}

@SimpleFunction(description = "Retrieves value of a tag")
public Object GetValue(final String tag, final Object valueIfTagNotThere) {
    TinyDB tinyDB = new TinyDB(container);
    return tinyDB.GetValue(tag, valueIfTagNotThere);
}

}

21212

1 Like

You have to add an object not a string.
Eg. public void Store Value(final String link,final String linkAddress) and so idem for retrive it as you use in tinydb

could you edit the code … I don’t understand about extensions at all

It Is as example tinydb in appybuilder code editor.

Add String as tag and a String as value.

There isn’t nothing simpler

@SimpleFunction(description = “Stores a value in TinyDB”)
public void StoreValue(final String link, final String linkAddress) {
TinyDB tinyDB = new TinyDB(container);
tinyDB.StoreValue(tag, valueToStore);
}

like this? and where to register the link?

You have a pm