Posts tagged Bluetooth

Discover remote bluetooth devices MIDlet


going from the previous sample
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


Discover Remote bluetooth devices


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();
        } catch (BluetoothStateException ex) {


Simple bluetooth connection


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

the required libraries we must import in the first

import javax.bluetooth.*;


Go to Top