Java me J2Me设备代号1的本机接口
我创建了一个接口类:Java me J2Me设备代号1的本机接口,java-me,native,codenameone,Java Me,Native,Codenameone,我创建了一个接口类: package userclasses; import com.codename1.system.NativeInterface; public interface NativeJ2MEInterface extends NativeInterface { public void pollBackground(); } 这是本机类-编辑后: package userclasses; import userclasses.Sta
package userclasses;
import com.codename1.system.NativeInterface;
public interface NativeJ2MEInterface extends NativeInterface {
public void pollBackground();
}
这是本机类-编辑后:
package userclasses;
import userclasses.StateMachine;
public class NativeJ2MEInterfaceImpl {
public void pollBackground() {
try {
Date now = new Date();
long timeToRun = now.getTime() + (1000 * 60 );
System.out.println("RUNNNNNNN forest runnn!");
PushRegistry.registerAlarm(StateMachine.class.getName(), timeToRun);
}
catch (Exception e) {
System.out.println("EXC-1:"+e.getMessage());
}
}
public boolean isSupported() {
return true;
}
}
我想调用javax.microedition.io.PushRegistry RegisterArm方法,但我的代码名One J2ME构建失败,原因是:
error: cannot find symbol
PushRegistry.registerAlarm(StateMachine.class.getName(), timeToRun);
我向本机j2me目录添加了一个midp_2.1.jar,但它不起作用。
我怎样才能让它工作?或者如何直接访问j2me警报API?不要添加jar,它将打包到最终版本中 尝试设置构建参数
j2me.ashaNative=true