Implementing bluetooth communication on a single computer!!

I want to develope an application where lets say 2 comps having bluetooth hardware are involved in communication.
My idea is to enable both pcs to recieve and send files among each other by running some application on each of the computer.
But since at home,i dont hav a second pc,can i implement a second BT device (pls suggest me d bluetooth hardware details requiered to be installed on d pc) on the same single computer to test my application before implementing it actually on two different comps.
I would be highly obliged if anyone can help me out.
Thanking you
Shivam Sahai
([email protected])

You could have two blue tooth adapters where one talks to the other. They could be on the same computer and you need to configure one piece of software to talk to one device and the second to the other.

Similar Messages

  • Question about bluetooth communication between PC and mobile device

    I am a newbie of bluetooth communication. This time I need to have connumication between PC and mobile device (mainly mobile phone) by sending strings. PC is acted as server and mobile device act as client.
    For using bluetooth in PC, I use bluecove 2.0.1
    I have already connected them successfully.
    When I want to send strings between them, it is found that it can only do one cycle of communication (client -> server -> client).
    For my design, they can communicate multiple times.
    I simulate the core class of the system, the performance is fine.
    Cound anyone help me to watch the code and give me some advices?
    Server Side - ServerBox.java
    public class ServerBox implements Runnable {
       LocalDevice localDevice;
       StreamConnectionNotifier notifier;
       ServiceRecord record;
       boolean isClosed;
       ClientProcessor processor;
       CMDProcessor cmd;
       MainInterface midlet;
       private static final UUID ECHO_SERVER_UUID = new UUID(
               "F0E0D0C0B0A000908070605040302010", false);
       public ServerBox(MainInterface midlet) {
           this.midlet = midlet;
       public void run() {
           boolean isBTReady = false;
           try {
               localDevice = LocalDevice.getLocalDevice();
               if (!localDevice.setDiscoverable(DiscoveryAgent.GIAC)) {
                   midlet.showInfo("Cannot set to discoverable");
                   return;
               // prepare a URL to create a notifier
               StringBuffer url = new StringBuffer("btspp://");
               url.append("localhost").append(':');
               url.append(ECHO_SERVER_UUID.toString());
               url.append(";name=Echo Server");
               url.append(";authorize=false");
               // create notifier now
               notifier = (StreamConnectionNotifier) Connector.open(url.toString());
               record = localDevice.getRecord(notifier);
               isBTReady = true;
           } catch (Exception e) {
               e.printStackTrace();
           // nothing to do if no bluetooth available
           if (isBTReady) {
               midlet.showInfo("Initalization complete. Waiting for connection");
               midlet.completeInitalization();
           } else {
               midlet.showInfo("Initalization fail. Exit.");
               return;
           // produce client processor
           processor = new ClientProcessor();
           cmd = new CMDProcessor();
           // start accepting connections then
           while (!isClosed) {
               StreamConnection conn = null;
               try {
                   conn = notifier.acceptAndOpen();
               } catch (IOException e) {
                   // wrong client or interrupted - continue anyway
                   continue;
               processor.addConnection(conn);
       // activate the set up of process
       public void publish() {
           isClosed = false;
           new Thread(this).start();
       // stop the service
       public void cancelService() {
           isClosed = true;
           midlet.showInfo("Service Terminate.");
           midlet.completeTermination();
       // inner private class for handling connection and activate connection handling
       private class ClientProcessor implements Runnable {
           private Thread processorThread;
           private Vector queue = new Vector();
           private boolean isOk = true;
           ClientProcessor() {
               processorThread = new Thread(this);
               processorThread.start();
           public void run() {
               while (!isClosed) {
                   synchronized (this) {
                       if (queue.size() == 0) {
                           try {
                               // wait for new client
                               wait();
                           } catch (InterruptedException e) { }
                   StreamConnection conn;
                   synchronized (this) {
                       if (isClosed) {
                           return;
                       conn = (StreamConnection) queue.firstElement();
                       queue.removeElementAt(0);
                       processConnection(conn);
           // add stream connection and notify the thread
           void addConnection(StreamConnection conn) {
               synchronized (this) {
                   queue.addElement(conn);
                   midlet.showInfo("A connection is added.");
                   notify();    // for wait() command in run()
       // receive string
       private String readInputString(StreamConnection conn) {
           String inputString = null;
           try {
               DataInputStream dis = conn.openDataInputStream();
               inputString = dis.readUTF();
               dis.close();
           } catch (Exception e) {
               e.printStackTrace();
           return inputString;
       private void sendOutputData(String outputData, StreamConnection conn) {
           try {
               DataOutputStream dos = conn.openDataOutputStream();
               dos.writeUTF(outputData);
               dos.close();
           } catch (IOException e) {
       // process connecion
       private void processConnection(StreamConnection conn) {
           String inputString = readInputString(conn);
           String outputString = cmd.reactionToCMD(inputString);
           sendOutputData(outputString, conn);
    /*       try {
               conn.close();
           } catch (IOException e) {}*/
           midlet.showInfo("Client input: " + inputString + ", successfully received.");
    }For "CMDProcessor" , it is the class of message processing before feedback to client.
    Client side - ClientBox.java
    public class ClientBox implements Runnable, CommandListener{
        StringItem result = new StringItem("","");
        private DiscoveryAgent discoveryAgent;
        private String connString;
        private boolean isClosed = false;
        private boolean boxReady = false;
        StreamConnection conn;
        private static final UUID ECHO_SERVER_UUID = new UUID( "F0E0D0C0B0A000908070605040302010", false);
        Form process = new Form("Process");
        ClientInterface midlet;
        public ClientBox(ClientInterface mid){
            this.midlet = mid;
            process.append(result);
            process.addCommand(new Command("Cancel",Command.CANCEL,1));
            process.setCommandListener(this);
            new Thread(this).start();
        public void commandAction(Command arg0, Displayable arg1) {    
            if(arg0.getCommandType()==Command.CANCEL){
                isClosed = true;
                midlet.notifyDestroyed();
        public synchronized void run() {
            LocalDevice localDevice = null;
            boolean isBTReady = false;
            /* Process Gauge screen */
            midlet.displayPage(process);
            Gauge g=new Gauge(null,false,Gauge.INDEFINITE,Gauge.CONTINUOUS_RUNNING);
            process.append(g);
            showInfo("Initalization...");
            System.gc();
            try {
                localDevice = LocalDevice.getLocalDevice();
                discoveryAgent = localDevice.getDiscoveryAgent();
                isBTReady = true;
            } catch (Exception e) {
                e.printStackTrace();
            if (!isBTReady) {
                showInfo("Bluetooth is not avaliable. Please check the device.");
                return;
            if(!isClosed){
                try {
                    connString = discoveryAgent.selectService(ECHO_SERVER_UUID, ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                } catch (BluetoothStateException ex) {
                    ex.printStackTrace();
            else return;
            if (connString == null) {
                showInfo("Cannot Find Server. Please check the device.");
                return;
            else showInfo("Can Find Server, stand by for request.");
            boxReady = true;
        /* True if the clientbox is ready */
        public boolean getBoxReady(){
            return boxReady;
        /* True if the clientbox is closed in run() */
        public boolean getIsClosed(){
            return isClosed;
        public String accessService(String input) {
            String output = null;
            try {
                /* Connect to server */
                StreamConnection conn = (StreamConnection) Connector.open(connString);
                /* send string */
                DataOutputStream dos = conn.openDataOutputStream();
                dos.writeUTF(input);
                dos.close();
                /* receive string */
                DataInputStream dis = conn.openDataInputStream();
                output = dis.readUTF();
                dis.close();
            } catch (IOException ex){
                showInfo("Fail connect to connect to server.");
            return output;
        private void showInfo(String s){
            StringBuffer sb=new StringBuffer(result.getText());
            if(sb.length()>0){ sb.append("\n"); }
            sb.append(s);
            result.setText(sb.toString());
    }Client side - ClientInterface.java
    public class ClientInterface extends MIDlet implements Runnable, CommandListener{
        private ClientBox cb = new ClientBox(this);
        private Form temp = new Form("Temp");
        private Command select = new Command("Select", Command.OK, 1);
        private Command back = new Command("Back", Command.BACK, 1);
        Alert alert;
        String[] element;
        String out;
        List list;
        public void run(){
            /* Send message and get reply */
            out = cb.accessService("Proglist");
            element = split(out,",");
            /* Use the reply to make list */
            list = createList(element[0], List.IMPLICIT, out);
            list.addCommand(select);
            list.addCommand(back);
            list.setCommandListener(this);
            Display.getDisplay(this).setCurrent(list);
        public void startApp() {
            System.gc();
            waitForBoxSetUp(); /* Recursively check for clientbox status */
            new Thread(this).start();
        public void pauseApp() {
        public void destroyApp(boolean unconditional) {
            notifyDestroyed();
        public void displayPage(Displayable d){
            Display.getDisplay(this).setCurrent(d);
        private void waitForBoxSetUp(){
            while(!cb.getBoxReady()){
                if(cb.getIsClosed())
                    notifyDestroyed();
        public void commandAction(Command c, Displayable d){
            if (c.getCommandType() == Command.OK){
                if (d == list){
                    /* Send the choice to server */
                    out = cb.accessService(list.getString(list.getSelectedIndex()));
                    alert = new Alert("Output", "selected = "+out, null, AlertType.ALARM);
                    alert.setTimeout(2000);
                    Display.getDisplay(this).setCurrent(alert,list);
            if (c.getCommandType() == Command.BACK){
                notifyDestroyed();
        public void showWarning(String title, String content){
            alert = new Alert("Output", "selected = "+list.getString(list.getSelectedIndex()), null, AlertType.ALARM);
            alert.setTimeout(3000);
            Display.getDisplay(this).setCurrent(alert,list);
        private List createList(String name, int type, String message){
            List temp;
            String[] source = split(message,",") ;
            temp = new List(name, type, source, null);
            return temp;
        private static String[] split(String original,String regex)
            int startIndex = 0;
            Vector v = new Vector();
            String[] str = null;
            int index = 0;
            startIndex = original.indexOf(regex);
            while(startIndex < original.length() && startIndex != -1)
                String temp = original.substring(index,startIndex);
                v.addElement(temp);
                index = startIndex + regex.length();
                startIndex = original.indexOf(regex,startIndex + regex.length());
            v.addElement(original.substring(index + 1 - regex.length()));
            str = new String[v.size()];
            for(int i=0;i<v.size();i++)
                str[i] = (String)v.elementAt(i);
            return str;
    }

    i haven't worked with devices but only with the toolkit emulators;
    it definitely is possible...
    u have to send the image as a bytestream and receive the image at the jsp end...
    and then reconstruct the image.
    the Stream classes in J2ME AND J2SE are all u will require.
    also the Image class.
    i have not done this but i have successfully sent an image frm a jsp and displayed it on the emulator.

  • Remotely uncheck "Allow Bluetooth devices to find this computer"

    Due security concerns we need to disable an option "Allow Bluetooth devices to find this computer" on our laptops. Unfortunately we haven't found a way to do it. Is there any possibility to configure this with group policy, registry value or script?

    Hi,
    You can refer to the registry trick as mentioned in the link below
    https://social.msdn.microsoft.com/Forums/en-US/50322362-baca-485e-9c68-905092710c57/changing-bluetooth-settings-from-registry
    Add: if you want to widely control this, you can deploy the registry via GPO, push it to all clients.
    Regards
    Yolanda Zhu
    TechNet Community Support

  • Implementing bluetooth app

    Hi,
    I have a device that I want to be able to connect to my iPhone 4 using bluetooth. My device using the bluetooth profiles Dial-Up Network (DUN) and Serial Port Profile (SPP). And because of the bad support for bluetooth profiles in iPhone this ain't working. So I'm thinking of implementing an app that sets up those profiles and connects to my device.
    Anyone having experience of implementing bluetooth profiles in app:s for iPhone or just doing it with objective-c?
    Anyone knowing how hard this will be? I have implemented some small app:s for iPhone before and I have worked quite a lot with implementing bluetooth devices before, but never for iPhone or in objective-c.
    Any suggestion of material to read are also welcome!

    How do you know that most people want to just send a photo?
    I don't know it. But from what I have read on these forums, it seems to be the most commonly requested legitimate reason.
    Frequently someone posting here has taken a photo and wants to quickly send it to other people they're with and find they can't on their "advanced smartphone". I see far less requests for how to send music or videos.
    Obviously copyrighted material shouldn't be shared, so regardless of whether "teens and 20 somethings" want to do that, it's not a reason to allow it. But sending a photo you've taken should not be a problem, and I'm sure the iOS can tell the difference between a photo you've taken and a music, video or saved Safari file.
    Also since you can save images to your iPhone from Safari, those pictures you're trying to share could also be copyrighted.
    That's irrelevant. You can do the same on a computer just as easily, if not easier and there's no blocking of that activity.
    Since most phones have email or MMS, there really is no reason to use clunky bluetooth to share a picture.
    Both email & MMS cost money to use on many tariffs and use up network bandwidth. Bluetooth doesn't.
    To send via email costs the sender and the recipient. Bluetooth doesn't cost anyone.
    Some network providers impose limits on the size of pictures that can be sent/received by MMS or compress/scale them in transit, so the recipient may receive a poorer quality copy of what was sent. Bluetooth doesn't.
    Bluetooth is designed for short-range, small file transfers - sending photos is not clunky.
    Bluetooth doesn't require a network connection, so can be used anywhere (for instance, abroad when the user is avoiding roaming charges).

  • HT1203 iTunes: How to share music between different accounts on a single computer - I tried to use the instructions to configure 2 different windows users sharing the same iTunes library.  I could not get this to work per the instructions.

    I tried to configure 2 windows users accounts using a single library per the instructions in HT1203.  My iTunes library is on an external drive.  I cannot get this to work.  Any suggestions?

    To give other users read-only access to your iTunes library, use the Sharing features of iTunes. Sharing works over the local network as well as on the same computer. See the built-in help for details.
    If you want to give full read/write access to more than one user, see the support article linked below.
    iTunes: How to share music between different accounts on a single computer
    There is a way to share the library without moving it to a secondary volume. If you really need to do that, ask for instructions.

  • How do I allow all users on a single computer access to music without duplicating songs?

    There has got to be a way to allow all users on a single computer access to a single -shared- directory without DUPLICATING the songs, but I can't figure it out.  Tried Edit | Preferences | Advanced | Change, but the songs do not show up.  Tried Sharing the folders. Tried Public Folders.  Just want all my songs in one place to save space, prevent duplicates.  Please advise.

    Move the iTunes folder from its current location to, say, C:\iTunes.
    With each account in turn press and hold down shift and click the icon to start iTunes, keep holding until asked to Choose or create a library.
    Choose the library at C:\iTunes, or wherever you put it.
    Job done.
    tt2

  • Once again! Sharing Music on different accounts on a single computer ?

    Somewhere in this forum i got a hint on sharing playlists and music among different (family)users on a single computer.
    (How to share music... from "Buegie")
    But it didn't help!!!
    I have most of my music stored in folders and mp3-format long before i bought iPod and installed iTunes.
    Do I have to copy all THOUSANDS of files into iTunes Music folder, to make the sharing work ???
    Or how do I solve this BIG problem ?
    I can't accept that such a great program doesn't have that function!
    Thanx for any help!!!
    Custom   Windows XP   iTunes 6

    If you want to share the music between users using iTunes, then the song references must be IN iTunes. Somehow that makes sense, no?
    You can leave the MP3s in their current folder arrangement, or you can have iTunes copy them into its own folder organization. Sounds like you want the former....
    - Open iTunes
    - Edit=>Preferences=>'Advanced/General' tab
    --- ‘Copy files to iTunes Music folder when adding to library’: unchecked
    --- ‘Keep iTunes Music folder organized’: unchecked
    - Click OK to accept changes
    - File=>Add Folder
    - Browse to the main folder of your MP3s and select it
    - iTunes will add a reference for all your MP3s you have under that folder
    - Repeat for additional folders you may have
    This will only add a song reference within iTunes, not physically copy the song file to another folder of your PC. If you do not have a song reference within iTunes, you can't use/play/sync the song from iTunes.
    Any questions, post back.

  • How to share music between different accounts on a single computer

    I am trying to share music on my Mac between two different iTunes accounts.  Can this be done?

    iTunes: How to share music between different accounts on a single computer - http://support.apple.com/kb/HT1203 - relocating iTunes' media folder to a shared area but leaving separate library files - extra tip at https://discussions.apple.com/message/17331189

  • Sharing iTunes on a single computer with multiple users

    Greetings,
    I have been troubleshooting a problem sharing iTunes on a single computer with multiple users that cropped up a few weeks ago and have not had very good luck.
    Several months ago I successfully set up my wife’s G4 Laptop (PowerPC processor) so that we could share iTunes on that computer. I had just gotten her an “My Book” external hard drive (Western Digital). The iTunes Library will go on this new unit because the internal drive was running out of room. I successfully set the privileges, moved the entire library onto a “Share” directory and everything worked fine.
    In this way, when I got a new CD I could add it to iTunes (under my login, administrator privileges) and she could access it (under her login) to listen to while working on the computer or using her iPod. This arrangement went well for quite awhile.
    About a month and a half ago, when I tried to launch iTunes from my login I received this message:
    “The iTunes Library file is locked, on a locked disk, or you do not have write permission for this file.”
    I think the permissions must have changed when there was an update because my wife is pretty careful about what she does on her computer. Updates were the only thing I could think of that had changed since I had set her computer up. I also noticed that some of the iTunes defaults were different from the last time I had used it to add a CD.
    So, I did some reading and went back through the motions of trying to set it up again. I re-formatted the My Book hard drive to Mac OS Extended (Journaled) added the files back to the external, reset permissions on the external hard drive. (Owners: System, Access: read and write - Group: wheel, Access: read and write – Others: read and write).
    When I now launch iTunes under my login I get this message:
    “The operation cannot be completed because you do not have sufficient privileges for some of the items.”
    What gives? I am the original owner and have always had top-level privileges.
    Can someone point me to any articles or clues as to how I need to set-up iTunes on a single computer to be shared by more than one user? Also, I am considering upgrading to the newer system in a few weeks, so if a solution for OS X 10.5 is available, that would work too.
    Tim

    Was your wife logged into the libray at the time you tried to log in? I have had a similar problem and it was because another user was logged into the library when I attempted to. I got the permission denied banner.

  • Can you have multiple itunes accounts on a single computer?  want to open a separate one for our daughter (but we will manage it).

    just got our daughter a new iTouch, but want to try and keep hers separate from our iPhone stuff.  can you have multiple iTunes accounts on a single computer?

    This is all i know but all you can do is just creat a new one for them both and send all the stuff to the one think u can do that i hope it helps

  • HT2688 Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared librar

    Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared library?

    Was your wife logged into the libray at the time you tried to log in? I have had a similar problem and it was because another user was logged into the library when I attempted to. I got the permission denied banner.

  • Sharing Music Between Users Accounts on a Single Computer

    I know that you can listen to music belonging to another user account on the same computer (as long as that user remains logged in), however, is there a way to COPY (drag and drop) music from one user account to another user account (on the same computer) similar to how it is done between multiple computers with Home Sharing?

    iTunes: How to share music between different accounts on a single computer - http://support.apple.com/kb/HT1203 - relocating iTunes' media folder to a shared area but leaving separate library files - extra tip at https://discussions.apple.com/message/17331189

  • Multiple ipods on single computer?

    Can I manage 2 ipods on a single computer? My wife wants one now . . . Are there any gotchas? Things to know before I buy the 2nd one?
    wayne

    That delt with one iPod and multiple computers. Though there are some hints there that might be helpful.
    Anyone using multiple iPods with a single computer/music library?
    wayne
    HP Windows XP

  • Is it possible to set up multiple iTunes accounts on a single computer?

    is it possible to set up multiple iTunes accounts on a single computer?

    If you do it with a single user account, you will receive update notifications for purchase made on both IDs regardless of which one you're using at the time.  That's slightly frustrating as you get the notification BUT you can't actually update!  In any event, separate user accounts on the computer is the cleaner way to go.

  • How do I transfer songs from my daughters itunes library onto my ipod?  We both have itunes libraries on a single computer running Windows Vista

    How do I transfer songs from my daughters itunes library onto my ipod?  We both have itunes libraries on a single computer running Windows Vista

    Your question has probaby been answered already because it was posted a month ago but anyways what you do is you plug your phone into your computer. Next you want to open iTunes and click on File. Then you go down to "Transfer Purchases from *your name* iPhone". Then just wait for it to sync and you should be good.

Maybe you are looking for

  • Sharing FCP projects between user accounts problem

    Hello! I'm working on a project with several other colleagues. Each of us has his own User account on the computer (dual G5 / 10.4.7) because we have different preferecnes regarding keyboard layouts, desktop colour etc. We would like to have our FCP

  • Project management apps

    hi, what apps is there available to linux for Project management? I been using MS Project so far but thats for windows :S would be nice to start doing that part in linux too. /Thomas

  • MacBook Pro Core Duo 15" Random Shutdown worsening

    Have had my MBP for over 18 months now, and any glitches have been software so far. Two nights ago, I was working on my MBP and suddenly went into an unwakeable sleep. After resetting, I could start up intermittently up to 5 minutes, but it seems to

  • Where to collect sales tax?

    I'm setting up a new BC site, have the shopping cart, shipping, and payment gateways all configured. Now I'm trying to figure out the tax stuff. We will be selling physical products into all 50 states, so we need to collect sales tax for each state.

  • Adobe Premiere Pro CS6 HDV Capture error

    Since the latest update, i'm not able anymore to capture HDV with firewire link from my Canon XHA1. MAC OSX Intel 10.7.5 When it should start capturing I get an error and Premiere CS6 goes on 'freeze'. In CS5.5 (wich I kept installed), I don't have t