Geekzone: technology news, blogs, forums
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.

8 posts

Wannabe Geek

Topic # 9561 27-Sep-2006 10:19
Send private message


Im running a java bluetooth server on my laptop using avetana bluetooth api and have a client that i have installed on
a Motorola Razor V3i. My client is not able to discover the services. It returns the message Unable to find service!

Can someone please help me with this problem?


The server code looks like:

//import java.lang.*;
import javax.bluetooth.*;
//import javax.bluetooth.UUID;

public class blueconn {
public static final UUID uuid = new UUID(
"27012f0c68af4fbf8dbe6bbaf7ab651b", false);

public blueconn() {
try {

LocalDevice local = LocalDevice.getLocalDevice();
if(!local.setDiscoverable(DiscoveryAgent.GIAC)) {
System.out.println("failed to Set Discoverable");
// f.append("Failed to change to the dicoverable mode");

System.out.println("Set Discoverable");
StreamConnectionNotifier server = (StreamConnectionNotifier) Connector
+ uuid
//+ ";name="
//+ name
//+ ";authorize=false;authenticate=false;encrypt=false"
StreamConnection conn = server.acceptAndOpen();

// Open the input to read data from
InputStream in = conn.openInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();

// Read the data sent from the client until the end of stream
int data;
while((data = != -1){
System.out.println("Data Read");


// Close all open resources

} catch (IOException e) {

public static void main(String[] args) {
new blueconn();


and the Client code looks like:

* Created on 20 September 2006, 01:48

package messagepassing;

import java.lang.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.bluetooth.*;

* @author Saguna
* @version
public class HelloClient extends BluetoothMIDlet {

* Connects to the server and sends 'Hello, World'
* to the server.

public void run() {

// Creates the Form and adds the Exit Command to it
Form f = new Form("Client");
f.addCommand(new Command("Exit", Command.EXIT, 1));
try {

// Retrieve the connection string to connect to the server
LocalDevice local = LocalDevice.getLocalDevice();
DiscoveryAgent agent = local.getDiscoveryAgent();

String connString = agent.selectService (
new UUID("27012f0c68af4fbf8dbe6bbaf7ab651b", false),
if (connString != null){

try {
//Connect to the server and send 'Hello World'
StreamConnection conn = (StreamConnection);
OutputStream out = conn.openOutputStream();
out.write("Hello, World".getBytes());

f.append("Message sent correctly");

} catch (IOException e) {
f.append("IOException: ");
} else {
// Unable to locate a service so just print an error message
// on the screen
f.append("Unable to locate service");

} catch (BluetoothStateException e){
f.append("BluetoothStateException: ");


Create new topic
871 posts

Ultimate Geek


  Reply # 47013 28-Sep-2006 09:11
Send private message

Is bluetooth set to discoverable?

BDFL - Memuneh
59831 posts

Uber Geek
+1 received by user: 10936

Lifetime subscriber


8 posts

Wannabe Geek

Reply # 47183 30-Sep-2006 02:42
Send private message

ya bluetooth is set to discoverable and services are enabled! Infact there is just one service that is represented by the UUID!
Can someone plz plz help me out! Its drivin me a little crazy now!

All ur help is really appreciated!

8 posts

Wannabe Geek

Reply # 47360 3-Oct-2006 03:48
Send private message

hey guys,

im still looking for help on this! I tried communicatin between two laptops using two BT dongles,

i am able to discover the service but it seems my client is not able to make a connection to my server.

Can someone please help!!


Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:

Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:

Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:

News »

Stuff Pix enters streaming video market
Posted 21-Mar-2018 09:18

Windows no longer Microsoft’s main focus
Posted 13-Mar-2018 07:47

Why phone makers are obsessed with cameras
Posted 11-Mar-2018 12:25

New Zealand Adopts International Open Data Charter
Posted 3-Mar-2018 12:48

Shipments tumble as NZ phone upgrades slow
Posted 2-Mar-2018 11:48

Oppo R11s: high-end Android, budget price
Posted 27-Feb-2018 16:27

Samsung New Zealand introducing the Galaxy S9 and S9+
Posted 26-Feb-2018 07:00

Fujifilm X beats its best with new top of the range, high-performance camera
Posted 24-Feb-2018 14:05

One million kiwis affected by cybercrime
Posted 24-Feb-2018 13:58

New Zealanders want to engage with government online and via mobile apps
Posted 24-Feb-2018 13:56

Samsung launches Samsung Max
Posted 24-Feb-2018 13:52

CPTPP text and National Interest Analysis released for public scrutiny
Posted 21-Feb-2018 19:43

Foodstuffs to trial digitised shopping trolleys
Posted 21-Feb-2018 18:27

2018: The year of zero-login, smart cars & the biometrics of things
Posted 21-Feb-2018 18:25

Intel reimagines data centre storage with new 3D NAND SSDs
Posted 16-Feb-2018 15:21

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.