Skip to main content

Bluetooth Connection - Marge

No replies
eybabi
Offline
Joined: 2010-02-03
Points: 0

Hello friends,
I'm working in my thesis,i want to talk two mobile phones with each other with bluetooth and i have no enough time. So i looked for easy way to do this and found a framework called "marge". And there is a video about marge which teachs you how to a simple bluetooth chat project.
Here is links.

http://weblogs.java.net/blog/brunogh/archive/2008/04/building_a_java_1.html
direct link:
https://marge.dev.java.net/source/browse/*checkout*/marge/trunk/docs/mar...

I don't know much about JAVA ME, NETBeans and Wireless Toolkit but i watched this video. Then i a done what the video says and run the aplication. But there is some problem and i can't solve it. I have wathed that video 4 times and i have done same as it tells.I'm sure about that. But it doesn't works.And i think it will be good for me use this Marge framework beaceuse it is easy to understand and implement so i could tell my teacher what the code does.

Here is my project same as video says.
http://rapidshare.com/files/388017889/BluetoothChat.rar.html

And here is Marge jar file that you must add to libraries & resources
http://rapidshare.com/files/388018862/marge.rar.html

and you should use Wireless Toolkit 2.5.2 that video says.

Then my friends i want your help what is the problem. Here is problem.
I run two times the project samet time and first i choose server , it seems works, then in the second one i choose client but it gives a error if i click once more it goes to message form but gives some eroors too and does't send messages.

Here is my code also.

http://rapidshare.com/files/388022391/Yeni_Metin_Belgesi__2_.txt.html

ERROR when i clicked to "client" in the second run.

Starting emulator in execution mode
Running with storage root C:\Documents and Settings\Mesut\j2mewtk\2.5.2\appdb\temp.DefaultColorPhone1
Running with locale: Turkish_Turkey.1254
Running in the identified_third_party security domain
javax.bluetooth.BluetoothStateException: The previous device discovery is running...
at com.sun.kvem.jsr082.bluetooth.SelectServiceHandler.selectService(SelectServiceHandler.java:96)
at com.sun.kvem.jsr082.bluetooth.DiscoveryAgentImpl.selectService(DiscoveryAgentImpl.java:253)
at javax.bluetooth.DiscoveryAgent.selectService(DiscoveryAgent.java:327)
at net.java.dev.marge.autocon.AutoConnect.connectToServer(AutoConnect.java:93)
at BluetoothChatlMIDlet$1.run(BluetoothChatlMIDlet.java:212)
Uncaught exception java/lang/IllegalArgumentException: Null URL.

//i think here is error.
BluetoothChatlMIDlet.this.device = AutoConnect.connectToServer(SERVER_NAME,BluetoothChatlMIDlet.this);

Please my friends help me Sad((

And i'm sorry about my terrible English..
Thank you..