2011-03-02 5 views
0

지난 며칠 동안 터치 스크린을 사용하여 내 컴퓨터에서 커서를 움직이는 Android 애플리케이션을 개발했습니다.자바 WTK 2.5.2를 사용하는 블루투스 서버 응용 프로그램이 시작시 충돌합니다.

나는 WiFi를 사용하여 휴대 전화와 내 컴퓨터 간의 통신을 구현했습니다. 모든 것은 괜찮습니다.하지만 블루투스를 사용하고 싶습니다.

전화 측면에서 모든 것이 간단하고 쉽습니다. 내가 성취 할 수없는 것은 블루투스 서버입니다.

Java Wireless Toolkit 2.5.2 및 JavaSE jdk를 다운로드하여 (아쉽게) 설치했습니다. 대한

지금 내 코드는 매우 간단하고 다음과 같습니다 : 나는 javax.bluetooth 및 javax.microedition에 대한 가져 오기를 얻기 위해 외부 항아리를 추가 한

import java.io.IOException; 
import javax.bluetooth.*; 
import javax.microedition.io.*; 

public class BluetoothServer extends Thread { 
    //private static LocalDevice localDevice; 
    static LocalDevice localDevice; 
    DiscoveryAgent agent; 

    //start server 
    private StreamConnection startServer() throws IOException{ 
     System.loadLibrary("zayit"); 

     //Create a UUID for SPP 
     UUID uuid = new UUID(0x1101); 
     //Create the servicve url 
     String connectionString = "btspp://localhost:" + uuid +";name=SampleSPPServer"; 

     //open server url 
     StreamConnectionNotifier streamConnNotifier = (StreamConnectionNotifier)Connector.open(connectionString); 

     //Wait for client connection 
     System.out.println("\nServer Started. Waiting for clients to connect..."); 
     StreamConnection connection = streamConnNotifier.acceptAndOpen(); 

     return connection; 
    } 
} 

.

이 프로젝트는 일반적으로 빌드 내가 그것을 실행하면, 그것은 다음과 같은 오류와 충돌 : 나는 오류 다음당한 System.loadLibrary를()없이

# A fatal error has been detected by the Java Runtime Environment: 
# 
# SIGSEGV (0xb) at pc=0xb27d6400, pid=25778, tid=2999303024 
# 
# JRE version: 6.0_24-b07 
# Java VM: Java HotSpot(TM) Server VM (19.1-b02 mixed mode linux-x86) 
# Problematic frame: 
# C [libzayit.so+0x23e400] kvm_resetOperandStack+0x8 
# 
# An error report file with more information is saved as: 
# /home/ixm/workspace/RemoteControlServer/hs_err_pid25778.log 
# 
# If you would like to submit a bug report, please visit: 
# http://java.sun.com/webapps/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 

:

Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: javax.microedition.io.Connector.isNetworkMonitorActive()Z 
    at javax.microedition.io.Connector.isNetworkMonitorActive(Native Method) 
    at javax.microedition.io.Connector.<clinit>(Connector.java:153) 
    at BluetoothServer.startServer(BluetoothServer.java:20) 
    at BluetoothServer.run(BluetoothServer.java:43) 

나는 어떤이 없습니다 내가해야 할 일이나 시도 할 단서. 인터넷에서 도움이되는 것을 찾지 못했습니다.

나를 도와 줄 사람이 있습니까? 어쩌면 진짜 질문은 "블루투스를 사용하는 Java 애플리케이션 (컴퓨터 용)을 개발할 수 있습니까?"

대단히 감사합니다!

안부,

ixM는

답변

0

나는 juste 내가 자바 (대신 ME의 SE)의 잘못된 버전을 설치 한 것으로 나타났습니다. 모바일 장치 용으로 설계되었으므로 올바른 설치를 시도하지 않겠습니다.

대신에 블루 코트로 촬영 해 보겠습니다. 나는 그것이 창문을위한 파이썬 라이브러리라고 생각했기 때문에 그 방법을 조사하지 않았다. 분명히 이것은 사실이 아니며 나는 프로젝트 페이지를 처음 읽을 때 맹목적이거나 어리 석다.

죄송합니다.

관련 문제