Are you sure it compiles? Even it compiles it will not open apk because of these reasons
- Missing category in designer
- Wrong pacage name it should have in three parts (io.aaaa.yyyy) or (com.aaaaa.yyy)
Me too used this ide before FAST. CLi but i become fast lover, credit @JEWEL
package io.gsr.TermuxRunPermission;
import android.app.Activity;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
@DesignerComponent(
version = 1,
description = "Requests Termux RUN_COMMAND permission",
category = ComponentCategory.EXTENSION,// REQUIRED
nonVisible = true,
iconName = "images/extension.png" // optional
)
@SimpleObject(external = true)
@UsesPermissions(permissionNames = "com.termux.permission.RUN_COMMAND")
public class TermuxRunPermission extends AndroidNonvisibleComponent {
private final Activity activity;
private static final int PERMISSION_REQUEST_CODE = 12345;
public TermuxRunPermission(ComponentContainer container) {
super(container.$form());
this.activity = container.$context();
}
@SimpleFunction(description = "Request Termux RUN_COMMAND permission")
public void RequestPermission() {
try {
activity.requestPermissions(
new String[]{"com.termux.permission.RUN_COMMAND"},
PERMISSION_REQUEST_CODE
);
PermissionResult(false); // Indicates request is pending
} catch (Exception e) {
PermissionResult(false); // Error occurred
}
}
@SimpleEvent(description = "Called when permission is requested")
public void PermissionResult(boolean granted) {
EventDispatcher.dispatchEvent(this, "PermissionResult", granted);
}
}
compiled in EIDE
