Posts tagged Bluetooth

Discover remote bluetooth devices MIDlet

0

going from the previous sample
discover-remote-bluetooth-devices
we are now going to make an advanced sample

we want MIDlet Application that can turn on/off Bluetooth discovery, and can make a search for devices and can stop the search any time

we need some attributes like a refrence to the local device and the discovery agent and a vector to store the discovered remote devices in.

also we will need commands to turn on/off discovery and one to start searching and another to stop it.

our class implements DiscoveryListener interface to listen to the actions generated by DiscoveryAgent
also it implements CommandListener to listen to the events of commands

(more…)

Discover Remote bluetooth devices

3

To make a useful bluetooth client in J2ME it’s important to discover remote devices
first thing in making any bluetooth-enabled application is to get a reference to the Local device and after that turning on the bluetooth

        LocalDevice localDevice;
        try {
            localDevice = LocalDevice.getLocalDevice();
            localDevice.setDiscoverable(DiscoveryAgent.GIAC);
        } catch (BluetoothStateException ex) {
            ex.printStackTrace();
        }

(more…)

Simple bluetooth connection

0


A sample code to make a connection between two cell phones using Bluetooth connection

the required libraries we must import in the first

import java.io.*;
import javax.bluetooth.*;
import javax.microedition.io.*;

(more…)

Go to Top