You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old Bluetooth series 60 and Java - 2003-11-14, 19:14

Join Date: Oct 2003
Posts: 3
amartey
Offline
Registered User
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,
Reply With Quote

#2 Old 2003-11-17, 19:34

Join Date: Aug 2003
Posts: 118
Location: Oldenburg, Germany
Send a message via Yahoo to sebflash
sebflash
Offline
Sebastian Szczygiel
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
Reply With Quote

#3 Old 2003-11-18, 17:21

Join Date: Mar 2003
Posts: 77
moamoa
Offline
Regular Contributor
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.
Reply With Quote

#4 Old 6600 jsr-82 - 2003-11-19, 01:00

Join Date: Oct 2003
Posts: 3
amartey
Offline
Registered User
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
Reply With Quote

#5 Old 2003-11-19, 09:44

Join Date: Nov 2003
Posts: 23
kUfa
Offline
Registered User
Well, i managed to get some bluetooth connection working properly.. But speed is .. hmm.. it's SLOW!..
Reply With Quote

#6 Old 2 emulator - 2003-11-21, 18:01

Join Date: Nov 2003
Posts: 22
jump_912
Offline
Registered User
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
Reply With Quote

#7 Old 2003-11-21, 18:05

Join Date: Nov 2003
Posts: 23
kUfa
Offline
Registered User
There are some examples in the javadoc, and also in the JSR82-spec_1.0a.pdf. Tell me if you cant find them..

/kUfa
Reply With Quote

#8 Old yes plz thanks - 2003-11-21, 18:14

Join Date: Nov 2003
Posts: 22
jump_912
Offline
Registered User
yes plz kufa. can u please tell me where to download the javadoc and jsr-82Spec1.0.pdf?
thx in advance
Reply With Quote

#9 Old 2003-11-26, 13:12

Join Date: Nov 2003
Posts: 5
Volex
Offline
Registered User
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
Reply With Quote

#10 Old 2003-11-26, 13:14

Join Date: Nov 2003
Posts: 23
kUfa
Offline
Registered User
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
Reply With Quote

#11 Old the data transfer problem - 2003-11-26, 14:21

Join Date: Nov 2003
Posts: 22
jump_912
Offline
Registered User
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!
Reply With Quote

#12 Old 2003-11-26, 14:48

Join Date: Nov 2003
Posts: 23
kUfa
Offline
Registered User
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
Reply With Quote

#13 Old i tried - 2003-11-26, 15:08

Join Date: Nov 2003
Posts: 22
jump_912
Offline
Registered User
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.
Reply With Quote

#14 Old 2003-11-28, 14:36

Join Date: Nov 2003
Posts: 23
kUfa
Offline
Registered User
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
Reply With Quote

#15 Old Post the code that you're compiling - 2003-11-28, 15:58

Join Date: Mar 2003
Posts: 27
stevecotton
Offline
Registered User
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.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia