• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting a mobile phone to PC via Bluetooth

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[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
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://faq.javaranch.com/java/DontWakeTheZombies
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!...
 
Alas, poor Yorick, he knew this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic