Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java me J2Me设备代号1的本机接口_Java Me_Native_Codenameone - Fatal编程技术网

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