Showing posts with label J2ME. Show all posts
Showing posts with label J2ME. Show all posts

07 July, 2010

J2ME program to capture a picture through mobile phone


Here is a simple J2ME program to take a snapshot using the camera of the mobile phone.This program display the camera and allow the user to capture the image and store the picture in the specific location. Import the respective packages after copying the following code.



06 July, 2010

J2ME program to search for Bluetooth Devices through Mobile Phone


Here we will discuss about a sample program to search for Bluetooth enabled devices around your mobile phone. J2ME community has defined a standard for Bluetooth communication in JSR 82, which describes the standard APIs used to communicate with Bluetooth enabled devices. The JSR 82 contains the following packages to exchange data between two devices.



  • javax.bluetooth – Core Bluetooth API
  • javax.obex -- APIs for Object Exchange (OBEX) protocol
Most of the below code is self explanatory. The actual scanning is started when the discoveryAgent.startInquery() method is called. So, Whenever a new device is found then deviceDiscovered() method will be invoked and once the discovery process is complete then inquiryCompleted() method is called.