someone please help me ! it is showing me error.
package mohin.patel.batterylvl;
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 android.os.BatteryManager;
@DesignerComponent(
version = 1,
description = "This extension is used to measure battery level",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "")
@SimpleObject(external = true)
public final class batterylvl extends AndroidNonvisibleComponent {
public batterylvl(ComponentContainer container) {
super(container.$form());
}
@SimpleFunction(description = "Returns Battery level")
public int batteryLevel()
{
BatteryManager bm = (BatteryManager)getSystemService(BATTERY_SERVICE);
int batLevel= bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
return batLevel;
}
}