This discussion is archived
1 Reply Latest reply: Aug 27, 2011 3:02 PM by DarrylBurke RSS

Bluetooth using j2me....

884981 Newbie
Currently Being Moderated
Dear Mayanktaneja,
I’ve written a SPP client-server program (I mean a program that serves both of client and server chat application) by Java Me in NetBeans. It works in emulator perfectly. But when I launch it on a phone, it doesn’t work.
In my program, the application searches remote devices and add them without searching services. For making the connection, the application makes the URL based on the remote address and a channel, for example: “btspp://001B3372D6A5:3”.
As I mentioned, in emulator, the application finds the remote devices, sends a text to the selected device as the client part of the app, and waits for the receiving data as the server part of the app; it works perfectly.
But on the phone (Nokia 5800 XpressMusic and Nokia 3110c) the story is different. These steps happen and at the end, no data is transferred:
1-     After running the application, the phone asks whether the user want to turn on the Bluetooth: is there any way to turn on the Bluetooth programmatically without asking a confirmation?
2-     Next, it phone asks for the confirmation to java making a connection: is there any way to make a connection without asking the confirmation?
3-     It finds the visible devices. After selecting a device (Nokia 3110c), the app shows the friendly name and the address of the remote and local device. But when the client wants to send a text these steps happen:
4-     The server phone asking for the accepting the serial port connection: any way to bypass this question?
5-     After accept, the server phone asks to generate a password: how can I manage it to ask for a password or not?
6-     After generating, client phone prompts “Accept pairing request from Nokia 3110c?” and then the client phone asking the password: why pairing? How to bypass this question?
7-     At the end, by the inserting the password, no data is transferred. What is the problem?

In addition, how can I solve these problems:
1-     When I want to install the application, the phone prompts this application is untrusted and can be harmful for your mobile phone and asks for the confirmation.
2-     Is there any specified SPP channel? And if there is, is it different in various phones? If yes, how the application can detect the number of the remote device SPP channel?
3-     How to use AT commands?

I would appreciate your help to solve the above questions.

  • 1. Re: Bluetooth using j2me....
    DarrylBurke Guru Moderator
    Currently Being Moderated
    Moderator advice: Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.

    I've branched this post to a new thread.