You Are Here:

Community: Developer Discussion Boards

#1 Old Bluetooth MIDlet - Sending Data - 2008-03-25, 12:50

Join Date: Mar 2008
Posts: 2
smitty350z
Offline
Registered User
Hi All!

My project involves sending a String from one Bluetooth device to another, then back again.

Currenlty I have the Discovery feature working fully, searching for devices in range - the user then selects the device they wish to send the data to and this is stored as a RemoteDevice.

My question is, what is the simpliest way to then send a string to the device, which will then reply automatically with another string (i.e Client/Server sort of set up, where the response from the Server will be hard coded).

The following code, sets the selected remote device so how do I progress from here? I'm not really looking for anything all that clever, just simply send a string, and recieve a response. Can you do this without discovering the service's of the other device?

Code:
public void setSelectedDevice() {
        try {
            theSelectedRemoteDevice = (RemoteDevice) theDiscoveredDevices.elementAt(theDeviceDisplayList.getSelectedIndex());
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
Any help appreciated

Cheers!!
Reply With Quote

#2 Old 2008-03-26, 20:07

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
No, you have to search for the services as you have no control over its channel identifier (normally) and the channel identifier might change over time (possibly). However for the start, you might have a look at DiscoveryAgent.selectService which does device and service search in one step.
Reply With Quote

#3 Old Smile Re: Bluetooth MIDlet - Sending Data - 2008-03-26, 22:20

Join Date: Mar 2008
Posts: 2
smitty350z
Offline
Registered User
Truad

Thank for yur reply. I have the application working now by discovering the service, but I am doing this in two steps. I'll take your advice and try to simplfy it!

Cheers
Reply With Quote

#4 Old 2008-03-28, 13:22

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
Personally, I avoid to use SelectService. I mentioned this just as a short hand alternative.
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
nokia 6600 - a problem with sending data with HTTP POST Ludwik Ejsmont Mobile Java Networking & Messaging & Security 1 2006-08-31 09:44
How to activated the bluetooth interface for sending GPRS data to bluetooth printer Loner77 General Symbian C++ 0 2004-04-12 13:22
How to activated the bluetooth interface for sending GPRS data to bluetooth printer Loner77 Symbian User Interface 0 2004-04-12 13:21
Sending large amounts of data via bluetooth j1978 Symbian Networking & Messaging 2 2004-01-12 04:40
sending data from computer to midlet Strunker Mobile Java General 4 2003-08-26 01:27

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