×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    8

    Unhappy send a string from mobile to pc and also resieve another string from pc to mobile

    Dear Friends
    I'm new to bluetooth!
    i want to have a bluetooth connection between my 6680 mobile and PC with Java!
    I have download my mobile SDK for java! but i couldnt not find out any suitable bluetooth package implementation for PC(J2SE)!
    First, where can i find suitable bluetooth Package for J2SE?
    Second, I can discover bluetooth enabled device around with my mobile and java code, is there anyone help me send a string from mobile to pc and also resieve another string from pc to mobile?
    I need a sample to do that!

    i would be really thanksfull helping me

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Hi sarvestan, Welcome to bluetooth,
    You need the Netbeans and J2SE from Sun Website
    http://java.sun.com/j2se/1.5.0/download-netbeans.html

    and then install Netbeans Mobility Pack for wireless

    http://www.netbeans.org/kb/50/mobility.html
    and
    then install Nokia Developer's Suite 3.0 for J2ME™

    During install select Netbeans integration
    http://www.forum.nokia.com/info/sw.n...3_0_1.zip.html

    This thread gives source code to work with obex file transfer client server
    http://discussion.forum.nokia.com/fo...highlight=obex

    and another thread were someone had success with my netbeans code.
    http://discussion.forum.nokia.com/fo...ad.php?t=85226



    and a good website to look at
    http://www.benhui.net/modules.php?name=Bluetooth

    Jim
    Last edited by jimgilmour1; 2006-07-25 at 20:39.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    8

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    tx
    but some Miss understanding!
    in sun J2SE there is no implementation for Bluetooth(JSR82)!
    so how could i have a bluetooth enable program in J2SE?
    as i said i want a connection for mobile and PC but i could not have a bluetooth package in J2SE!
    one more Q! i may have a miss understanding! can i develop a program for PC using J2ME?

  4. #4
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Hi Sarvestan,
    in sun J2SE there is no implementation for Bluetooth(JSR82)!
    Yes Sun does not provide an implemenation of JSR82 for J2SE only J2ME.

    so how could i have a bluetooth enable program in J2SE?
    as i said i want a connection for mobile and PC but i could not have a bluetooth package in J2SE!
    J2SE comes with NB when you dowload the link I have given on previous posting.


    My fault I forget to tell you that you need to look at Bluecove XP on the Benhui website and J2SE see
    http://www.benhui.net/modules.php?na...ne_Part_2.html

    download
    http://www.benhui.net/modules.php?na...op=getit&lid=9

    or download the source from
    http://sourceforge.net/projects/bluecove/
    This is loaded into J2SE and compiled as J2SE library which is then linked into the application by pointing to the resulting .jar file.


    You will need a Windows XP SP2 compatable BT USB
    http://support.microsoft.com/default.aspx?kbid=841803

    or see my hack of bt.inf for non XP BT usb
    http://discussion.forum.nokia.com/fo...ad.php?t=69637

    Bluecove has a driver intelbth.dll which you copy into the XP system32 directory.

    one more Q! i may have a miss understanding! can i develop a program for PC using J2ME?
    No, The programs will not run as the J2ME and J2SE runtime calls are no the same.


    Jim

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    8

    Unhappy Re: send a string from mobile to pc and also resieve another string from pc to mobile

    well so thanks for ur help but i could not find suitable code 4 the client of this server
    [server code u have sent in the thread above
    http://discussion.forum.nokia.com/fo...ad.php?t=85226 ]
    i have the SDK of my mobile installed with netbeans IDE!
    i just make a discovery and find the Device only but could not make the application connect to the pc or get string from PC!
    is there anythind special I should do?
    is there any code for dummeis?(client part of the server http://discussion.forum.nokia.com/fo...ad.php?t=85226 )

  6. #6
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Hi sarvestan,

    The thead called "OBEX Messaging" at http://discussion.forum.nokia.com/fo...highlight=OBEX
    Gives the FTClient source for J2SE. you will need the de.avetna source from the binary kit.

    Jim

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    8

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Dear Jim
    I think I could not explain my problem very well
    I have the server run on the PC as u mentioned in thread here => http://discussion.forum.nokia.com/fo...ad.php?t=85226
    I have a SDK of my 6680 nokia phone ( SDK 2nd Ed, FP 2 )!
    in the site it mentioned that this phone(6680) does not support OBEX
    so now I need a Client for the Server Up there(Blue Cove implemetation)

    what should I do to have the Client side of this Server on the Phone(J2ME)?
    Again thanks for your kindly help

  8. #8
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Quote Originally Posted by sarvestan
    Dear Jim
    I think I could not explain my problem very well
    I have the server run on the PC as u mentioned in thread here => http://discussion.forum.nokia.com/fo...ad.php?t=85226
    I have a SDK of my 6680 nokia phone ( SDK 2nd Ed, FP 2 )!
    in the site it mentioned that this phone(6680) does not support OBEX
    so now I need a Client for the Server Up there(Blue Cove implemetation)

    what should I do to have the Client side of this Server on the Phone(J2ME)?
    Again thanks for your kindly help
    Hi sarvestan,
    I think you will find the following OBEX from Symbian S60 2nd ed FP1 and is in S60 2nd Ed FP2

    C:\Symbian\7.0s\Series60_v21\Series60Ex\btobjectexchange\src\btobjectexchange.cpp

    or _PRODUCT_HOME_\Series60Ex\btobjectexchange\src\btobjectexchange.cpp

    showing OBEX being supported on s60 very useful:-

    PHP Code:
    void CObjectExchangeClient::ConnectToServerL()
        {
        
    TObexBluetoothProtocolInfo protocolInfo;

        
    protocolInfo.iTransport.Copy(KServerTransportName);
        
    protocolInfo.iAddr.SetBTAddr(iServiceSearcher->BTDevAddr());
        
    protocolInfo.iAddr.SetPort(iServiceSearcher->Port());

        if (
    iClient)
            {
            
    delete iClient;
            
    iClient NULL;
            }
        
    iClient CObexClient::NewL(protocolInfo);
        
        
    iClient->Connect(iStatus);
        
    SetActive();
        } 
    This is the S60 2nd ed FP1 code to support bluetooth client using CObexClient:: api call.

    If you dont want to use obex you can use
    C:\Symbian\7.0s\Series60_v21\Series60Ex\btpointtopoint\src\messageclient.cpp
    Which uses RFCOMM to send and receive.

    These programs will compile successfully under Carbide c++. If need be you can import under any version and compile.
    when you load the sis directory and file btobjectexchange.prg into the project top level the Carbide automatically generates a signed btobjectexchange.sis file.

    Download carbide.c++
    http://www.forum.nokia.com/info/sw.n...p_Express.html

    Java
    -----

    You are right Java jsr82 does not support obex, but I just add de.avetna source to my java programs as include from source.
    My original was converted from OBEX to RFCOMM by replacing the btgoep:: to btspp::

    Thats BT Generic Object ExchangeProtocol (Ob Ex) to Serial Port Protocol.

    Uncomment the "import de.avetana" lines and use the de.avetana built earlier in netbeans to use OBEX.

    In netbeans use the wizard use the MIDP wizard which creates a new mobile app and
    add an item button in the item builder.

    Build it and test on the phone by using the deployment, which will call pc suite to install the .jar and test on phone

    add the FTClient.java to project.
    add the code to the item button to call the FTClient after renaming main() to FTCmain() and making the item button call FTCmain() .

    Recompile run under emulator to see that the call of FTClient is working ok.
    Build it and test on the phone by using the deployment, which will call pc suite to install the .jar and test on phone.



    FTClient from here http://discussion.forum.nokia.com/fo...light=ftclient


    Hope this make things clearer,
    Jim
    Last edited by jimgilmour1; 2006-07-29 at 11:58.

  9. #9
    Registered User
    Join Date
    May 2006
    Posts
    8

    Question Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Dear Friend
    I have the code down here
    when do the red line code, an exception(NullPointerException) is thrown!
    i checked all the values i have passed to the searchServices and all of them were correct!
    do you know what should i do?
    Code:
     
            UUID[] uuids = new UUID[1];
            uuids[0] = new UUID("9106",true); // OBEX Filetransfer UUID value is hexadecimal 0x1106 
            stringItem2.setText(uuids[0].toString());
            int[] attributes = {0x100,0x101,0x102};
            for(int i=0;i<10;i++){
                if(remote_devList[i] != null){
                    try{
                        agent.searchServices(attributes, uuids, remote_devList[i] , this);
                        break;
                    }catch(Exception e){
                        stringItem2.setText(stringItem2.getText()+"\n"+"Error on device :"+i+"-->"+e.toString());
                    }
                }
            }

  10. #10
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Hi I think your attributes should be
    public static int[] attribSet = {0x0100, 0x0001, 0x0002, 0x0003, 0x0004};
    These are standard 0x0001 being the most important. you can add yours if you feel the will be seen. If they are not THIS WILL BLOCK causing the error.

    This has taken nearly three weeks to prove. ITS "AND" function.
    Jim

  11. #11
    Registered User
    Join Date
    Mar 2010
    Posts
    3

    Re: send a string from mobile to pc and also resieve another string from pc to mobile

    Hi all,
    I am working on a project about bluetooth and I have one problem which I am trying to find out and hopefully I can get some help from here.
    I have go through bluetooth client-server communication and both j2me and C++. However, I just wonder that if it is possible to build an application for symbian s60 r3 so that it can search for available bluetooth devices around and send file to any arbitrary device which does not necessary have server running and listening to incoming obex package. In target device we just have bluetooth enabled and service from MS stack or windcomm stack.
    I think it should be possible as it is what a normal phone is doing right now but i did not find anything like that after one week walking around in this forum.
    Other solution is to use existing 'Send' command on the phone and integrate it to my app ( CSendUI ) but i dont think this is the only solution.
    THanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×