How to communicate with mobile devices using Bluetooth in j2me? - java-me

I need to develop a project based on Bluetooth in mobile. Since I am new to j2me I studied some of the articles and run the project until the discovery of devices and services. I need to communicate between devices and transfer the desired files. I search code for client server communication through Bluetooth and got it but I didn't know how to run those code and implement further.
I have go through articles and I can run client server communication. Now I need to transfer the file and communicate to the user which was beyond the limit of my mobile through the another mobile which was within my limit.

JSR82.com has many articles and tutorials about how to use bluetooth from J2ME.

Better you refer the book, "BLUETOTH APPLICATION PROGRAMMING WITH JAVA API" by C.Balakumar. It is helpfull to you.

Related

How to read data sent via bluetooth by an App

I am a developer and I have a Bluetooth Lamp that has RGB and Day/Warm Light that has a third party App to control it.
My goal is to do some automation with my Lamp.
Is there a way to read what this app is sending to my Lamp is order to simulate its functionality? The thing is this App is not possible to integrate with my Google assistant so I am trying to find a way to do it my self by making my own mobile application to control my Lamp.
Or maybe my question should be something like: is there a generic App that can control generic Bluetooth Lamps?
Any information is greatly appreciated.
You could either hack the hardware itself, or you could simply snoop on the communications to hack in to the lamp controls.
Otherwise, I would check out integration platforms like IFTTT, which allows some customization of control with proprietary systems.

establish bluetooth connection between two devices in j2me application

I need to establish a bluetooth connection between two devices so that the data can be send/received continuously. I am new to j2me and under the 'learning and implementing' phase.
So if anyone can suggest me an easiest way to get how to establish bluetooth between two mobile devices.
It can be a tutorial or a blog or any kind of reference site.
There is a bluetooth API demo application in the J2ME SDK. I would advise reading the source code it contains first.

mobile receipt printing with J2ME via Bluetooth

I need to make an app in J2ME that can be able to read a SMS and then print it on an epson tm-p60 printer(ESC/POS emulation) via bluetooth.
i looked at the epson supprt site but the only ADK/drivers they provide are for:
1.Sun Java2 SDK Standard Edition Version 1.4.2_10
2.Sun Java2 SDK Standard Edition Version 1.4.2_04
3.Sun Java SE Development Kit 6 Update 3
so i don't know how am i gonna be able to use ESC/POS commands inJ2ME.
I'm a bit clueless on how i will approach this project.. plus w/c would be better to use for this project? Netbeans or Eclipse?
Thanks!
SPP (Serial Port Profile) over Bluetooth means using an RFCOMM connection to send and receive data as if it were a physical serial connection. This is part of JSR 82, so you will be able to develop only on handsets that support this JSR.
You need to:
Figure out how to discover bluetooth devices, and scan for SPP services on a discovered device, then connect to one of those services, using one of the many JSR 82 tutorials out there.
Then send ESC/POS protocol data over that connection -- I assume you have the protocol specification available? Google turned up this application programming guide.
HTH.
JSR-82 Bluetooth API support L2CAP protocol, RFCOMM and OBEX profile. I don't know detail of Bluetooth basic printing profile (BPP) but, if you look into basic printing profile document you can find that BPP built on OBEX profile.
I can't find open source project for BPP on JSR-82. Please try to search it, but if you can't find one you might need to write your own.

Phases for mobile game development

I'm currently thinking of developing chess code with multi-player facility connected and played via bluetooth. For that I need to chalk out the phases, i mean systematic modules, that I should follow to develop the game. If anyone can state it or have any link that can help it out, it would be great.
Another thing I am developing this in J2ME, so can anyone give me an idea about the way to connect the game in two mobile devices through bluetooth in J2ME. I mean to say the class or file that is used to connect the gaming devices.
For the second part of your question: you need to make an SPP (serial) connection between the two devices, with one acting as a client and the other as a server; see this tutorial for more information.
Then you need to create your own protocol to allow the two devices to communicate everything they need to.
This will only work on handsets with JSR 82.

Auto Detect Windows Mobile Device programmatically

I am writing a windows application (written entirely in C++) which reads files from a storage card on a mobile phone running Windows Mobile. The tough part is, I don't know how to make my application detect the event that a user has connected the mobile phone to the USB of laptop. I did some reading on MSDN and have written a small code using RegisterDeviceNotification, which detects whenever a USB disk is attached/removed from the laptop. However, I am unable to tweak this to make it work for phone type devices. Please help me out through any links/tutroials which explains this(preferrably C++, as I don't know .NET or C#).
Thanks
Alok
According to this article you can use RegisterDeviceNotification to get notifications when activesync detects a device has been plugged/unplugged. (See option 3 at the end of the article)
It may just be a matter of setting up the correct notification filter.
Windows Mobile devices use RNDIS, a network interface protocol behind the scenes. Hence, the RegisterDeviceNotification method still works, but you're looking for a DEV_BROADCAST_DEVICEINTERFACE, not DEV_BROADCAST_VOLUME. (i.e. dbch_devicetype==DBT_DEVTYP_DEVICEINTERFACE)
You can use RAPI or RAPI2 to detect when a Windows Mobile device connects to a PC via Active Sync or Windows Mobile Device Center. RAPI can also be used to read the files on the storage card and much more.
RAPI is simpler to program because it is a C based API. RAPI2 has more functionality than RAPI, but is an object oriented COM API. If your needs are simple and you only care about one device/connection at a time then RAPI is good enough. There are two RAPI functions used to detect connections: CeRapiInit (blocking), and CeRapiInitEx (signals an event upon connection).

Resources