| Reply | « Previous Thread | Next Thread » |
|
im starting work with java/bluetooth/6600. i would like to know what is required to print from the 6600 over bluetooth using java.
is it necessary to use a bluetooth jsr-82 implementation such as rococo to print from this phone? thanks, |
|
The bluetooth API is already implemented on the Nokia 6600, for what do you need Rococo?
Write your J2ME/MIDP application where you first discover your printer and the service it provides and then you can communicate with the printer. This is the theory ![]() The reality is, that till now i even can't detect from my J2ME application my USB bluetooth stick on my notebook using the DiscoveryAgent.startInquiry method from the bluetooth API. Regards, Sebastian Szczygiel |
|
there is a print example tucked away inside the bluetooth docs that come with the S60 concept 0.3.1 emulator!
not tried it yet though. |
|
in theory, yes.... ive been playing with it for a couple of days and it doesnt work yet - i was hoping someone could give me a checklist of things to do in order to get it working. i had mentioned the need for another vendor's bluetooth stack -> although javax.bluetooth is implemented, i had wondered about using obex and the basic print profile?
i have an application running on the emulater and as yet it doesnt discover bluetooth network... i quess i would like to see just one working java/bluetooth application example running on the 6600, just to know that it can be done ![]() |
|
Well, i managed to get some bluetooth connection working properly.. But speed is .. hmm.. it's SLOW!..
|
|
well i dunno. maybe this is too basic. the nokia concept sdk will open up 2 emulator at a time. i manage to get it detect the emulator beside it. but i dunno how to register service and make client search for it. i mean i need some code snippet as example. anyone plz help? i'm doing it for my final year project
|
|
There are some examples in the javadoc, and also in the JSR82-spec_1.0a.pdf. Tell me if you cant find them..
/kUfa |
|
yes plz kufa. can u please tell me where to download the javadoc and jsr-82Spec1.0.pdf?
thx in advance |
|
I have some may be stupid question: Do I need bluetooth card instsalled in my PC to use 2 emulators? Or I just can start 2 emulators and work with them without any additional harware?
jump_912 Here is the link: http://192.18.97.51/ECom/EComTicketS..._0-fr-spec.zip |
|
Well you can run two emulators without additional hardware, and it works nicely. (well, slowly indeed)
But be carefull, as usually, the devices behave in a very different way.. /kUfa |
|
hi guys, glad that this link isn't dead. first of all
volex, u'll need the nokia series 60 concept v0.3.1 to run 2 emulator at once kufa, do u know why to my problem? i've get 2 emulator connected via bluetooth. sending part is ok using OutputStream but reading part using InputStream throws NullPointerException. as far as i know, InputStream wun throws NullPointerException. will it? unless i try to pass in a byte[], but in my case, i din. it throws as soon as i try to read(). plz help...very much appreciated! |
|
Just to be sure..
If the code is: public void run() { byte buffer[]; int data; int len = 0; DataInput din = null; try{ System.out.println(din.readUTF()); }catch(IOException ioe){} } } you should initialise din, otherwise you'll get a null pointer.. (DataInput din = conn.getDataInputStream(); should do the trick, but check din) /kUfa |
|
kufa,
i did initialize my din..lemme post my code in here: sendng text part : ============= public void sendText(String textToSend){ try{ String msg = textToSend; OutputStream os = sConn.openOutputStream(); os.write(msg.getBytes()); }catch(IOException ioe){ System.out.println("error sending text : " + ioe.toString()); } } receiving text part : ============== public void start(){ running = true; thread = new Thread(this); thread.start(); System.out.println("read thread started"); } public void stop(){ running = false; } public void run() { byte buffer[]; int data; int len = 0; InputStream ip = sConn.OpenInputStream(); while(running){ try{ buffer = new byte[100]; //Read data from the stream while((data = ip.read()) != -1){ buffer[len++] = (byte)data; } System.out.println(buffer.toString()); }catch(IOException ioe){ System.out.println("error reading : " + ioe.toString()); } } }
Last edited by jump_912 : 2003-11-26 at 15:10.
|
|
I guess you are using a rfcomm connection (otherwise you can use the L2CAPConnection), btw in your code check this:
try{ buffer = new byte[100]; //Read data from the stream while((data = ip.read()) != -1){ buffer[len++] = (byte)data; } I'm not sure about the -1.. Try something like <= 0 .. Btw i had some weird things going on by using Output/Input streams, now i use the L2CAPConnection class. Btw i have a weird problems.. /kUfa |
|
It's just a capitalisation error, but the code posted by Jump
> InputStream ip = sConn.OpenInputStream(); can't compile. Also there's a buffer overflow if 101 bytes are sent to this server. |
| stevecotton |
| View Public Profile |
| Find all posts by stevecotton |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|