帮我解决 j2me Polish -蓝牙问题

发布于 2024-11-29 17:32:14 字数 12153 浏览 8 评论 0原文

我对 j2me 波兰语有疑问。我正在使用 Eclipse IDE。以下是我的j2me文件:

BluetoothHandler.java

import javax.bluetooth.DeviceClass;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.DiscoveryListener;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.RemoteDevice;
import javax.bluetooth.ServiceRecord;
import javax.microedition.lcdui.Form;

/**
 * @author sivakumar.j1
 *
 */
public class BluetoothHandler implements DiscoveryListener {

 Form frm=null;
 LocalDevice localDevice=null;
 DiscoveryAgent agent=null;
 boolean inquiry_started=false;
 boolean bluetooth_turned_on=false;

 public BluetoothHandler(Form frm1)
 {
  frm=frm1;
  frm1=null;

 }

 public void doDeviceSearching()
 {
  localDevice=null;
  agent=null;

  try
  {
   localDevice=LocalDevice.getLocalDevice();
   localDevice.setDiscoverable(DiscoveryAgent.GIAC);
   bluetooth_turned_on=true;
  }
  catch(Exception ex)
  {
   ex.printStackTrace();
   frm.append("\n\tTurn on bluetooth in ur device");
   bluetooth_turned_on=false;
  }

  agent=localDevice.getDiscoveryAgent();
  inquiry_started=false;

  if(this.bluetooth_turned_on)
  {
   try
   {
    inquiry_started=agent.startInquiry(DiscoveryAgent.GIAC,this);
    if(inquiry_started==false)
     frm.append("\n\tCannot able to start inquiry");
    else
     frm.append("\n\tStarted inquiry");

   }
   catch(Exception ex)
   {
    ex.printStackTrace();
    frm.append("\n\tInquiry starting exception : "+ex.toString());
   }
  }

 }
 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#deviceDiscovered(javax.bluetooth.RemoteDevice, javax.bluetooth.DeviceClass)
  */
 public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
  // TODO Auto-generated method stub
  RemoteDevice remoteDevice=remoteDevice1;
  String address=null;
  String name=null;
  try
  {
   address=remoteDevice.getBluetoothAddress();
   name=remoteDevice.getFriendlyName(true);
   frm.append("\n\tDevice address : "+address+" , name : "+name);
   address=name=null;
  }
  catch(Exception ex)
  {
   frm.append("\n\tException in getting name & address of device : "+ex.toString());
  }

 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#inquiryCompleted(int)
  */
 public void inquiryCompleted(int arg0) {
  // TODO Auto-generated method stub
  frm.append("\n\tInquiry completed");
 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#serviceSearchCompleted(int, int)
  */
 public void serviceSearchCompleted(int arg0, int arg1) {
  // TODO Auto-generated method stub

 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#servicesDiscovered(int, javax.bluetooth.ServiceRecord[])
  */
 public void servicesDiscovered(int arg0, ServiceRecord[] arg1) {
  // TODO Auto-generated method stub

 }

}

BluetoothMidlet.java

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class BluetoothMidlet extends MIDlet implements CommandListener
{

 Form frm=null;
 Display display=null;
 Command cmdExit=null;
 Command cmdPair=null;
 BluetoothHandler handler=null;

 public BluetoothMidlet() {
  // TODO Auto-generated constructor stub

  display=Display.getDisplay(this);
  frm=new Form("Tesing bluetooth");
  cmdExit=new Command("Exit",Command.EXIT,0);
  cmdPair=new Command("Pair",Command.OK,1);
  frm.append("\n\tTesting bluetooth");
  frm.addCommand(this.cmdExit);
  frm.addCommand(this.cmdPair);
  frm.setCommandListener(this);

  display.setCurrent(frm);
 }

 protected void destroyApp(boolean flag) throws MIDletStateChangeException {
  // TODO Auto-generated method stub



  this.cmdExit=this.cmdPair=null;
  this.frm=null;
  this.display=null;

  this.notifyDestroyed();
 }

 protected void pauseApp() {
  // TODO Auto-generated method stub

 }

 protected void startApp() throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 public void commandAction(Command cmd, Displayable arg1) {
  // TODO Auto-generated method stub

  if(cmd==this.cmdExit)
  {
   try
   {
    this.destroyApp(true);
   }
   catch(Exception ex)
   {
    ex.printStackTrace();
    this.notifyDestroyed();
   }
  }
  else if(cmd==this.cmdPair)
  {
   handler=null;
   this.handler=new BluetoothHandler(frm);
   handler.doDeviceSearching();
  }

 }

}

上面是我的j2me蓝牙应用程序中的两个java文件。当我在移动设备中部署并执行时它工作正常。(显示发现的设备地址和名称)。

但是我创建了一个新的 j2me Polish 项目。将这两个 java 文件复制到 j2me Polish 项目的源目录中。我还在构建路径中添加了“\J2ME-Polish\import\btapi.jar”,方法是右键单击该项目,然后选择属性->java构建路径,然后选择选项卡库,然后添加btapi.jar。

然后我在 Eclipse 中使用无线工具包 simulaotr 运行 j2me Polish 应用程序。然后出现以下错误

Errors:

j2mepolish:
[j2mepolish] info: the license attribute is no longer supported. Please place your license.key file either to ${project.home} or to ${polish.home}.
[j2mepolish] J2ME Polish 2.0 (2008-02-10) (GPL License)
[j2mepolish] Loading device database...
[j2mepolish] using locale [de_DE]...
[j2mepolish] assembling resources for device [Generic/DefaultColorPhone].
[j2mepolish] preprocessing for device [Generic/DefaultColorPhone].
[j2mepolish] Warning: CSS-Style [focused] not found, now using the default style instead. If you use Forms or Lists, you should define the style [focused].
[j2mepolish] Warning: CSS style [title] not found, you should define it for designing the titles of screens.
[j2mepolish] processing locale code...
[j2mepolish] compiling for device [Generic/DefaultColorPhone].
[j2mepolish-javac-Generic/DefaultColorPhone] Compiling 287 source files to C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\classes
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:6: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DeviceClass;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:7: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DiscoveryAgent;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:8: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DiscoveryListener;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:9: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.LocalDevice;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:10: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.RemoteDevice;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:11: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.ServiceRecord;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:18: cannot find symbol
    [javac] symbol: class DiscoveryListener
    [javac] public class BluetoothHandler implements DiscoveryListener {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:21: cannot find symbol
    [javac] symbol  : class LocalDevice
    [javac] location: class BluetoothHandler
    [javac] LocalDevice localDevice=null;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:22: cannot find symbol
    [javac] symbol  : class DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] DiscoveryAgent agent=null;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:76: cannot find symbol
    [javac] symbol  : class RemoteDevice
    [javac] location: class BluetoothHandler
    [javac] public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:76: cannot find symbol
    [javac] symbol  : class DeviceClass
    [javac] location: class BluetoothHandler
    [javac] public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:114: cannot find symbol
    [javac] symbol  : class ServiceRecord
    [javac] location: class BluetoothHandler
    [javac] public void servicesDiscovered(int arg0, ServiceRecord[] arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:40: cannot find symbol
    [javac] symbol  : variable LocalDevice
    [javac] location: class BluetoothHandler
    [javac] localDevice=LocalDevice.getLocalDevice();
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:41: cannot find symbol
    [javac] symbol  : variable DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] localDevice.setDiscoverable(DiscoveryAgent.GIAC);
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:58: cannot find symbol
    [javac] symbol  : variable DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] inquiry_started=agent.startInquiry(DiscoveryAgent.GIAC,this);
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:78: cannot find symbol
    [javac] symbol  : class RemoteDevice
    [javac] location: class BluetoothHandler
    [javac] RemoteDevice remoteDevice=remoteDevice1;
    [javac] ^
    [javac] 16 errors
    [javac] An internal class of J2ME Polish could not be compiled. Please try a clean rebuild by either calling "ant clean j2mepolish" or by removing the working directory "C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real".
    [javac] When an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [C:\Users\sivakumar.j1\J2ME-Polish\import\mmapi.jar;C:\Users\sivakumar.j1\J2ME-Polish\import\midp-2.0.jar;C:\Users\sivakumar.j1\J2ME-Polish\import\cldc-1.1.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/mmapi.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/wmapi.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/pdaapi.jar].

BUILD FAILED
C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build.xml:107: Unable to compile source code for device [Generic/DefaultColorPhone]: Compile failed; see the compiler error output for details.

I无法解决问题。请帮助我解决问题。

**谢谢&问候,

I had a j2me polish doubt. Im using eclipse IDE. The following are the my j2me files:

BluetoothHandler.java

import javax.bluetooth.DeviceClass;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.DiscoveryListener;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.RemoteDevice;
import javax.bluetooth.ServiceRecord;
import javax.microedition.lcdui.Form;

/**
 * @author sivakumar.j1
 *
 */
public class BluetoothHandler implements DiscoveryListener {

 Form frm=null;
 LocalDevice localDevice=null;
 DiscoveryAgent agent=null;
 boolean inquiry_started=false;
 boolean bluetooth_turned_on=false;

 public BluetoothHandler(Form frm1)
 {
  frm=frm1;
  frm1=null;

 }

 public void doDeviceSearching()
 {
  localDevice=null;
  agent=null;

  try
  {
   localDevice=LocalDevice.getLocalDevice();
   localDevice.setDiscoverable(DiscoveryAgent.GIAC);
   bluetooth_turned_on=true;
  }
  catch(Exception ex)
  {
   ex.printStackTrace();
   frm.append("\n\tTurn on bluetooth in ur device");
   bluetooth_turned_on=false;
  }

  agent=localDevice.getDiscoveryAgent();
  inquiry_started=false;

  if(this.bluetooth_turned_on)
  {
   try
   {
    inquiry_started=agent.startInquiry(DiscoveryAgent.GIAC,this);
    if(inquiry_started==false)
     frm.append("\n\tCannot able to start inquiry");
    else
     frm.append("\n\tStarted inquiry");

   }
   catch(Exception ex)
   {
    ex.printStackTrace();
    frm.append("\n\tInquiry starting exception : "+ex.toString());
   }
  }

 }
 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#deviceDiscovered(javax.bluetooth.RemoteDevice, javax.bluetooth.DeviceClass)
  */
 public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
  // TODO Auto-generated method stub
  RemoteDevice remoteDevice=remoteDevice1;
  String address=null;
  String name=null;
  try
  {
   address=remoteDevice.getBluetoothAddress();
   name=remoteDevice.getFriendlyName(true);
   frm.append("\n\tDevice address : "+address+" , name : "+name);
   address=name=null;
  }
  catch(Exception ex)
  {
   frm.append("\n\tException in getting name & address of device : "+ex.toString());
  }

 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#inquiryCompleted(int)
  */
 public void inquiryCompleted(int arg0) {
  // TODO Auto-generated method stub
  frm.append("\n\tInquiry completed");
 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#serviceSearchCompleted(int, int)
  */
 public void serviceSearchCompleted(int arg0, int arg1) {
  // TODO Auto-generated method stub

 }

 /* (non-Javadoc)
  * @see javax.bluetooth.DiscoveryListener#servicesDiscovered(int, javax.bluetooth.ServiceRecord[])
  */
 public void servicesDiscovered(int arg0, ServiceRecord[] arg1) {
  // TODO Auto-generated method stub

 }

}

BluetoothMidlet.java

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class BluetoothMidlet extends MIDlet implements CommandListener
{

 Form frm=null;
 Display display=null;
 Command cmdExit=null;
 Command cmdPair=null;
 BluetoothHandler handler=null;

 public BluetoothMidlet() {
  // TODO Auto-generated constructor stub

  display=Display.getDisplay(this);
  frm=new Form("Tesing bluetooth");
  cmdExit=new Command("Exit",Command.EXIT,0);
  cmdPair=new Command("Pair",Command.OK,1);
  frm.append("\n\tTesting bluetooth");
  frm.addCommand(this.cmdExit);
  frm.addCommand(this.cmdPair);
  frm.setCommandListener(this);

  display.setCurrent(frm);
 }

 protected void destroyApp(boolean flag) throws MIDletStateChangeException {
  // TODO Auto-generated method stub



  this.cmdExit=this.cmdPair=null;
  this.frm=null;
  this.display=null;

  this.notifyDestroyed();
 }

 protected void pauseApp() {
  // TODO Auto-generated method stub

 }

 protected void startApp() throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 public void commandAction(Command cmd, Displayable arg1) {
  // TODO Auto-generated method stub

  if(cmd==this.cmdExit)
  {
   try
   {
    this.destroyApp(true);
   }
   catch(Exception ex)
   {
    ex.printStackTrace();
    this.notifyDestroyed();
   }
  }
  else if(cmd==this.cmdPair)
  {
   handler=null;
   this.handler=new BluetoothHandler(frm);
   handler.doDeviceSearching();
  }

 }

}

The above the are the two java files in my bluetooth application of j2me.When i deploy in mobile and execute it works fine.(That displays the device address and name which are discovered).

But I create a new j2me polish project.Copy thes two java files into source directory of the j2me polish project.I also add the "\J2ME-Polish\import\btapi.jar" in the build path by right clicking the project then select properties->java build path,then select the tab libraries,then add the btapi.jar.

Then I run the j2me polish application in eclipse with wirless toolkit simulaotr.then the following error is arised

Errors:

j2mepolish:
[j2mepolish] info: the license attribute is no longer supported. Please place your license.key file either to ${project.home} or to ${polish.home}.
[j2mepolish] J2ME Polish 2.0 (2008-02-10) (GPL License)
[j2mepolish] Loading device database...
[j2mepolish] using locale [de_DE]...
[j2mepolish] assembling resources for device [Generic/DefaultColorPhone].
[j2mepolish] preprocessing for device [Generic/DefaultColorPhone].
[j2mepolish] Warning: CSS-Style [focused] not found, now using the default style instead. If you use Forms or Lists, you should define the style [focused].
[j2mepolish] Warning: CSS style [title] not found, you should define it for designing the titles of screens.
[j2mepolish] processing locale code...
[j2mepolish] compiling for device [Generic/DefaultColorPhone].
[j2mepolish-javac-Generic/DefaultColorPhone] Compiling 287 source files to C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\classes
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:6: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DeviceClass;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:7: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DiscoveryAgent;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:8: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.DiscoveryListener;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:9: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.LocalDevice;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:10: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.RemoteDevice;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:11: package javax.bluetooth does not exist
    [javac] import javax.bluetooth.ServiceRecord;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:18: cannot find symbol
    [javac] symbol: class DiscoveryListener
    [javac] public class BluetoothHandler implements DiscoveryListener {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:21: cannot find symbol
    [javac] symbol  : class LocalDevice
    [javac] location: class BluetoothHandler
    [javac] LocalDevice localDevice=null;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:22: cannot find symbol
    [javac] symbol  : class DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] DiscoveryAgent agent=null;
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:76: cannot find symbol
    [javac] symbol  : class RemoteDevice
    [javac] location: class BluetoothHandler
    [javac] public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:76: cannot find symbol
    [javac] symbol  : class DeviceClass
    [javac] location: class BluetoothHandler
    [javac] public void deviceDiscovered(RemoteDevice remoteDevice1, DeviceClass arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:114: cannot find symbol
    [javac] symbol  : class ServiceRecord
    [javac] location: class BluetoothHandler
    [javac] public void servicesDiscovered(int arg0, ServiceRecord[] arg1) {
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:40: cannot find symbol
    [javac] symbol  : variable LocalDevice
    [javac] location: class BluetoothHandler
    [javac] localDevice=LocalDevice.getLocalDevice();
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:41: cannot find symbol
    [javac] symbol  : variable DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] localDevice.setDiscoverable(DiscoveryAgent.GIAC);
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:58: cannot find symbol
    [javac] symbol  : variable DiscoveryAgent
    [javac] location: class BluetoothHandler
    [javac] inquiry_started=agent.startInquiry(DiscoveryAgent.GIAC,this);
    [javac] ^
    [javac] Internal J2ME Polish class: C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real\Generic\DefaultColorPhone\de_DE\source\BluetoothHandler.java:78: cannot find symbol
    [javac] symbol  : class RemoteDevice
    [javac] location: class BluetoothHandler
    [javac] RemoteDevice remoteDevice=remoteDevice1;
    [javac] ^
    [javac] 16 errors
    [javac] An internal class of J2ME Polish could not be compiled. Please try a clean rebuild by either calling "ant clean j2mepolish" or by removing the working directory "C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build\real".
    [javac] When an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [C:\Users\sivakumar.j1\J2ME-Polish\import\mmapi.jar;C:\Users\sivakumar.j1\J2ME-Polish\import\midp-2.0.jar;C:\Users\sivakumar.j1\J2ME-Polish\import\cldc-1.1.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/mmapi.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/wmapi.jar;C:/Users/sivakumar.j1/J2ME-Polish/import/pdaapi.jar].

BUILD FAILED
C:\Users\sivakumar.j1\j2me_polish_workspace\test_bluetooth1\build.xml:107: Unable to compile source code for device [Generic/DefaultColorPhone]: Compile failed; see the compiler error output for details.

I cannot able to solve the issues.Please help me to solve the issues.

**Thanks & Regards,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野心澎湃 2024-12-06 17:32:15

从 j2me Polish-Eclipse 的设备选择程序中选择适当的设备。如果设备在 j2me Polish 中没有蓝牙设置。可能会出现上述错误,因此请选择“虚拟默认彩色手机”以外的适当设备。

Select the appropriate device from the device selection procedure of j2me polish-eclipse..If the device is not having bluetooth setting in j2me polish.The the above errors may aarie so select the appropriate device other than "virtul default color phone".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文