Hello,
I've been looking at some tutorials...
Thank you very much for your help, I have added what you have told me, but I keep getting another error.
Code:>
/** ~~~~~
- 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
*/
package com.meulencv.Internet_speed;import android.net.wifi.WifiManager;
import android.net.wifi.WifiInfo;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 Internet_speed extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
* @param container container, component will be placed in
*/
public Internet_speed(ComponentContainer container) {
super(container.$form());
this.container = container;
}@SimpleFunction(description = "")
public int GetWifiSpeed () {
WifiManager wifiManager = container.$context().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo != null) {
Integer linkSpeed = wifiInfo.getLinkSpeed();
}
return linkSpeed;}
}
Error:
Error: Failed execute ant extensions: Command executing error occured: code(1)stdout:
Buildfile: %SERVER_WORKSPACE%/appinventor/build.xmlextensions:
clean:
init:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/build/components
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/build
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/build/classes
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/reports
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/reports/raw
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/reports/htmlCommonConstants:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/build/classes/CommonConstants
[javac] Compiling 7 source files to %SERVER_WORKSPACE%/appinventor/components/build/classes/CommonConstants
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[javac] Creating empty %SERVER_WORKSPACE%/appinventor/components/build/classes/CommonConstants/com/google/appinventor/components/common/package-info.class
[jar] Building jar: %SERVER_WORKSPACE%/appinventor/build/components/CommonConstants.jar
[jar] Building jar: %SERVER_WORKSPACE%/appinventor/build/components/CommonConstants-gwt.jarHtmlEntities:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/build/classes/HtmlEntities
[javac] Compiling 1 source file to %SERVER_WORKSPACE%/appinventor/components/build/classes/HtmlEntities
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[jar] Building jar: %SERVER_WORKSPACE%/appinventor/components/build/HtmlEntities.jarcommon_CommonVersion:
init:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/build/common
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/build
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/build/classes
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/reports
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/reports/raw
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/reports/htmlCommonVersion:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/build/classes/CommonVersion
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/common/build/src/com/google/appinventor/common/version
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/common/build/src/com/google/appinventor/common/version
[javac] Compiling 3 source files to %SERVER_WORKSPACE%/appinventor/common/build/classes/CommonVersion
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[javac] Creating empty %SERVER_WORKSPACE%/appinventor/common/build/classes/CommonVersion/com/google/appinventor/common/version/package-info.class
[jar] Building jar: %SERVER_WORKSPACE%/appinventor/build/common/CommonVersion.jar
[jar] Building jar: %SERVER_WORKSPACE%/appinventor/build/common/CommonVersion-gwt.jarCopyComponentLibraries:
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps/armeabi-v7a
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps/arm64-v8a
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps/x86_64
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 57 files to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 2 files to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/deps
[copy] Copying 1 file to %SERVER_WORKSPACE%/appinventor/build/components/depsAndroidRuntime:
[mkdir] Created dir: %SERVER_WORKSPACE%/appinventor/components/build/classes/AndroidRuntime
[javac] Compiling 266 source files to %SERVER_WORKSPACE%/appinventor/components/build/classes/AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] %SERVER_WORKSPACE%/appinventor/components/src/com/meulencv/Internet_speed/Internet_speed.java:41: error: incompatible types: Object cannot be converted to WifiManager
[javac] WifiManager wifiManager = container.$context().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
[javac] ^
[javac] %SERVER_WORKSPACE%/appinventor/components/src/com/meulencv/Internet_speed/Internet_speed.java:46: error: cannot find symbol
[javac] return linkSpeed;
[javac] ^
[javac] symbol: variable linkSpeed
[javac] location: class Internet_speed
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
[javac] 1 warningstderr:
BUILD FAILED
%SERVER_WORKSPACE%/appinventor/build.xml:42: The following error occurred while executing this line:
%SERVER_WORKSPACE%/appinventor/components/build.xml:193: The following error occurred while executing this line:
%SERVER_WORKSPACE%/appinventor/build-common.xml:125: Compile failed; see the compiler error output for details.Total time: 14 seconds
can you help me, please?