aspose file tools*
The moose likes Java Micro Edition and the fly likes Connecting a mobile phone to PC via Bluetooth Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Connecting a mobile phone to PC via Bluetooth" Watch "Connecting a mobile phone to PC via Bluetooth" New topic
Author

Connecting a mobile phone to PC via Bluetooth

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi.
I'm not sure if this is the right forum but I will post my question.
I want to connect a mobile phone and a PC via the Bluetooth technology, when the user press on "1" button of the mobile, the PC should take an action (taking a photo for example).
My question is how to link the mobile phone & the PC via Bluetooth?
Of course, I'm using Java Technology.
Thanks.
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
You posted to the right forum. I was looking at the jdk for ( a vendor of pda's ) and saw there are several approches to your design challenge. You will have to have a jdk for a paticular device ( micro-device ) because of compiler issues that have to target a remarkably small ramspace   ( i never heard that term, but that's what it is )   and device abilities. bluetooth is mostly engineering and we are not going to get useful information except through compiler documentation.

I wrote a class customer that is a tree map of all the open handset alliance participants with their website address. If you want, I will email it to you - this is a great opportunity and I am looking for people to work with who are reasonably motivated to do a commercially acceptable grade of work.

google: Java ME Technical Articles, let me know anywhere you get stuck, also it looks like they have NetBeans, bluetooth and just about whatever it takes to do any concievable programming task.
[ December 03, 2007: Message edited by: Nicholas Jordan ]

"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

Using Bluetooth with a J2ME device isn't a real big deal as long as the device supports the Bluetooth functions (I think it's JSR-82).

The only real hitch is that you probably will be limited to picking up events on the number pad only when your app is running. But it would be kind of hard to dial US long distance without a "1" key being routed to the telephone!


Customer surveys are for companies who didn't pay proper attention to begin with.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Using Bluetooth with a J2ME device isn't a real big deal as long as the device supports the Bluetooth functions (I think it's JSR-82)

So, I have to create a MIDlet that use Bluetooth to transmit data to the PC?
I thought I should have a Java application on the PC
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
[John Todd:]   I thought I should have a Java application on the PC

Not necessarily, but I do not really know. I have a copy of Java Network Programming and if I had read more of it I could answer your question. I would think this book to be the place to start.

Just sending to the machine, well it has to have some sort of app running to rcv, but that could be wriiten in Java more efficiently than any other approach I can think of.

[message edit: I just found this working another post: JSR 209: Advanced Graphics and User Interface Optional Package for the J2METM Platform hava a look]
[ December 06, 2007: Message edited by: Nicholas Jordan ]
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

From the beginning please:
What do I need?
Do I need an application on the mobile phone?
Do I need an application on the PC?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

You need:

1. A phone that implements Java Bluetooth (preferably using the Bluetooth JSR spec)

2. A desktop computer with a bluetooth transceiver (built-in or external like a USB Bluetooth dongle). AND bluetooth support software both for Java and any underlying OS services that the Java library invokes (again, preferably your Java Bluetooth library will implement the Bluetooth JSR spec - the same spec can do both clients and servers and peer/peer).

3. An application on the phone that implements your phone-side Bluetooth application logic.

4. An application on the desktop that implements your server-side application logic.

AND

A distance of 30 feet/10m or less between the desktop's receiving antenna and the phone. YMMV, but I think this is the range for standard Bluetooth.
Eduardo Marques
Ranch Hand

Joined: Feb 19, 2005
Posts: 231
Regarding JSR-82:

http://www.hcilab.org/documents/tutorials/BT_GPS/BT_GPS.htm - example
http://www.microjava.com/articles/Bluetooth-jsr-82-training.pdf - tutorial
http://jcp.org/en/jsr/detail?id=82 - specs

Cheers,
Eduardo


Eduardo Marques
Get ready for your SCMAD certification at J2MECertificate.com - See what all the buzz is about ...
kamal kawol
Greenhorn

Joined: Feb 19, 2008
Posts: 5
Hello all, Me too I have to develop an application where the pc will act as the server and mobile as the client. In the past I have develop a client server application for only mobile phones. Can I use the same server code for the pc??
ashraf karim
Greenhorn

Joined: Jun 09, 2009
Posts: 2
Yet no particular solution.
I have the same problem. Its okay that we can run bluetooth server or client in the mobile phone. but the library in Java support only in Midlet. What about stand alone java application. Is there any precise API or method by which we can run a server in the Desktop PC so that my midlet in mobile phone can connect to the PC (running the java program) and talk with the application using bluetooth.
in short, how can we write a bluetooth midlet like application in PC using Java API? or what is the way around that provide same functionality?
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

You need to use Java Communication API in order to establish connection between phone and PC.
then send AT (Attension Command ) from PC to take actions in Phone such as take Picture.

link for downloading and installing COM API :http://javanext.wordpress.com/java-comm-api-instalation/

hope it will help you :-)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

http://faq.javaranch.com/java/DontWakeTheZombies
ranatrix xtrem
Greenhorn

Joined: Apr 12, 2011
Posts: 1
I found an excelent Example of how connect PC and J2ME Mobile phone in this blog.

http://mobile-programming-and-games.blogspot.com/2011/04/java-connect-pc-and-mobile-phone-over.html

and include code source for testing!...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Connecting a mobile phone to PC via Bluetooth