Tuesday, August 4, 2009

Bluetooth Mobile Webcam - A Java & J2me based Project

This project is designed to broadcast live JPEG still images from Java 2 Micro Edition MIDP 2.0 enabled mobile device with camera like Nokia Series 60 v2.0 and Series 60 v3.0 phones over Bluetooth as a transmission medium onto the PC or Laptop. This project is developed in Java and Java 2 Micro Edition, which makes this software platform independent.

All the questions like:
  • How to connect mobile to PC through bluetooth by java ?
  • How to transmit pictures or data from mobile to PC using java/j2me through bluetooth ?
  • How to access mobile information from PC using java/j2me through bluetooth ?
  • What drivers are required to use bluetooth services in java ?
You will get all the answers here. So don't panic friends just wait and watch.






Prerequisites:
  • Bluetooth Enabled PC/Laptop or Bluetooth USB Device
  • One Java Enabled Bluetooth Mobile Phone like Nokia Series 60 v2.0 and Series 60 v3.0 phones
  • Java Development Kit 6 or above - Download it.
  • Java MicroEdition 2.5.2 or above - Download it.
  • BlueCove (bluecove-2.x.x.jar or above) is a JSR-82 J2SE implementation: is used to make our project applicable on any platform. BlueCove is used for the server part i.e. PC to receives images over Bluetooth and J2ME (JSR-82) is used for the client part i.e. the mobile phone. BlueCove currently interfaces with the Mac OS X, WIDCOMM, BlueSoleil and Microsoft Bluetooth stack found in Windows XP SP2 and newer. - Download it.
  • Mac OS X, WIDCOMM, BlueSoleil ,Microsoft Bluetooth stack ( Windows XP SP2 ) or BlueZ which is the Bluetooth stack for Linux. Any one of this must be installed.
  • Netbeans or Eclipse IDE (for advance user who want to add feature to this project)
It consists of two software components:
  • Mobile component that resides on phone and streams still images to PC. (Client part).
  • PC component that receives images over Bluetooth. (Server part)

This project is now in its beta version. So all of you can modify and optimize the code. Some bugs are also their I am working on them. As now a days I am not getting time to enhance the code.
I am not a genius in java that's why you will find little bugs in my code and in the application. So you all are invited to make this project a good one.


Steps:
  1. First ensure that you have java development kit and j2me installed in you PC, otherwise install it.
  2. Second ensure that any bluetooth stack is installed in your PC like WIDCOMM, BlueSoleil ,Microsoft Bluetooth stack or BlueZ.
  3. Place bluecove-2.x.x.jar in both the runtime library extension folder of jre and jdk C:\Program Files\Java\jre1.6.0\lib\ext and C:\Program Files\Java\jdk1.6.0\jre\lib\ext .
  4. Now extract the BlueServer.rar(Server Part).
  5. Server jar file is in dist folder which directly can be executed and the source files are in source folder.
  6. Extract pic_transmit_client.rar(Client Part).
  7. pic_transmit.jar and transmit.jad are there in deployed folder and the source files are in source folder.
  8. Send this pic_transmit.jar and transmit.jad files to you java enabled bluetooth mobile phone and install it.
  9. Start the Server part BlueServer.jar and click the start button.It will wait for the client to connect and transmit Jpeg files.
  10. Now start the bluetransmit application (client part) from the mobile.
  11. Select search from the bluetransmit application (client part) and wait, it will find the server and will connect to the server.It will display server name along with all the bluetooth devices in the surrounding and bluetooth address of the devices respectively in screen.

  12. Connection status in the server application will change to connected.
  13. After that select transmit from the bluetransmit application (client part).
  14. It will start sending the Jpeg image from the mobile to the PC and the images will be stored in c:\ServerBishwajeet folder.
  15. Images will be displayed in the a new window in PC.
  16. Select Stop from mobile when you want to stop. Don't stop it from the server part there is some bug. Which I am trying to remove.
It is a nice application for college projects. So keep developing the code and keep adding new features.



54 comments:

  1. hey nice post and code too thanks.... i have allready written something similar but works on WI-FI... but i am not having any WI-FI device to check it.... i just wanted to know if u can tell me what is the FPS u get over bluetooth... that will be great help thanks...
    u can mail me at wakaley@gmail.com
    Nikhil S wakaley

    ReplyDelete
  2. some what 50kb/sec in bluetooth 2.0

    ReplyDelete
  3. Hello Sir,
    Thanks for concerned reply... What u are saying is bitfate ... (correct me i am wrong )
    What my study tells me is in my project case i.e. i am not using bluetooth i am using WI-FI network will not be problem or u can say its not in consideration ... when i see the behaviours of software i mark that might be the capability of device to take pictures rapidly will effect the stream.
    so i wanted to ask what FPS ( Frames Per Second ) u get in ur project i also tried to test ur program on my Sony Ericsson Phone but seems have some issues .. i think resolution needs to be recoded in it... So please take note on this and i will appritiate if u can help in this problem ..
    Thank u,
    Wakaley Nikhil

    ReplyDelete
  4. Hi Wakaley,
    Thanks for testing my project. Frames per second is very less. The device is not capable of taking pictures rapidly and at the same time sending it in bluetooth sream that's why I am not getting a nice fps. The fps decrease as resolution increase.
    Actually it works fine in Nokia. Try it. I haven't try it in Sony Ericsson, soon I will try and let you inform.

    ReplyDelete
  5. hiiii Wakaley and Biti,i would like to implement this as my final year project can i finish it studying J2me after this.I am familiar with java but not j2me.Can i implement it using wifi and not bluetooth...

    ReplyDelete
  6. can u mail me to specialyspecial@gmail.com

    ReplyDelete
  7. Hello Karunya, You can implement it in wifi but for that you have to study how to use wifi in j2me

    ReplyDelete
  8. hey nice post i want to enhance the code for usb also so plz mail me the existing code in my mail id raaj.18.58@gmail.com

    ReplyDelete
  9. Thanks for your kind Response Biti.. Please Can you Mail me the code to specialyspecial@gmail.com as i could develop the project using wifi ans develop it with further feautures...

    ReplyDelete
  10. hi biti
    you have made a nice project. can you mail me the client part and server part because it is not downloading from rapidshare.
    my mail id is mac_jpr@yahoo.co.in
    thanks

    ReplyDelete
  11. Hi, nice post. But i wanna ask you, can we do it with sony ericsson (K660 is my cellphone) which is not symbian OS?
    Thanks

    ReplyDelete
  12. Hi, i am hafizh. I already try all the step but when i start to transmit there is mediaexception snap1:Invalid Encoding. What is that mean? Thanks

    ReplyDelete
  13. Hello,if get sameone error on phone:" Media exception snap1:Only capture://image locator supports getSnapshot()" then just replace p= Manager.createPlayer("capture://video"); with this p= Manager.createPlayer("capture://image");
    my phone: Nokia 5310 ExpressMusic

    ReplyDelete
  14. Was very interest in such a project when i did it last year. But mine was from my PC webcam to my mobile phone using the http protocol. I didn't find much info on bluetooth that's why i switched to http. Anyway, I've just downloaded your source code and am gonna try it. Thanks for posting. I'll post mine soon.

    ReplyDelete
  15. Hello
    It seems that your project is very interesting, currently I'm doing a somehow similar one, I would like to look at your source code, it would be a great help for me, but unfortunately I can't download from rapidshare, if you can send me the source code by e-mail, or if there is another download link this would be great. Thank you for the effort and good luck in future projects. My E-mail: hashimotos88@hotmail.com

    ReplyDelete
  16. Hi Biti. Great project. Can you help me please ?
    I receive on my phone an error: "thread:javax.bluetooth.BluetoothStateException: cannot search" and i don't know what to do. I have an LG KU990i phone.
    Please help me
    cristy_eu17@yahoo.com

    ReplyDelete
  17. hey brilliant work dude, exactly the thing that i needed. I just have one lil problem, i'm nt able to run blueclove on my pc, any ideas?

    ReplyDelete
  18. ^^^ correction, its blue server that has problem. it does not show anything, when i click start, i've waited for atleast 10 mins and nothing changes in the window

    ReplyDelete
  19. yes, the server just shows its address n name, bt nothin hapens..!! plz help..
    :(

    ReplyDelete
  20. @Dipen and @smartsweetsachin : mail me what is your problem , i will try to solve your problems

    ReplyDelete
  21. After starting the server in PC.
    #Start bluetransmit application (client part) from the mobile.
    # Select search from the bluetransmit application (client part) and wait, it will find the server and will connect to the server.It will display server name along with all the bluetooth devices in the surrounding and bluetooth address of the devices respectively in screen.
    # After that select transmit from the bluetransmit application (client part).
    Steps 10 to 15 try.. it will work. otherwise contact me.

    ReplyDelete
  22. When I bought my computer and I didn´t know how to use java graphics, so I decided looking for information in a webside and I found an useful information that helped me a lot.. Now I am interested in to do the best investment and I found a webside very useful and interesting called costa rica investment opportunities , I think it´s a very wonderful site.

    ReplyDelete
  23. Starting device inquiry...[client:]
    Inquiry completed
    Bluetooth Devices:
    1. (my laptop)
    Service Search in Progress(1)[client:]
    Service not available
    Unable to locate service

    :(
    I have IVT BlueSoleil.
    Pls help :(.

    ReplyDelete
  24. hey dude...m not able to find the bluecove.jar file in the folder. what i have got is the bluecove.dll...i dont kno if it works...will try soon but please reply as soon as possible...thanks...and great work by the way...

    ReplyDelete
  25. hey again...m not able to install the client part on my phone. its saying invalid application.
    my phone: nokia xpressmusic 5310. someone above has used the app on this phone and is able to do so...what might have gine wrong ...also i cant fnd your email address...what is it ?

    ReplyDelete
  26. hey..
    Ur Project is really ver gud...
    i m building a similar project can you plz tell me how to get a response from the user by a midlet..
    Like in the form of ye or no..
    Ok or cancel..
    Plz Suggest.....:)

    ReplyDelete
  27. your work from this blog was very awesome. i have similar project with yours but while trying your project, i encountered problem. i used samsung gt-s5233(mobile phone) as client and windows xp(operating system of my comp.) as server. i receive message that says:

    0Message sent correctly
    Mediaexception
    snap1:encoding=jpeg&width=320&height=240 format is not supported

    can you pls. help me with this error.pls.. pls..pls..
    thanks and hope for your answers asap.

    ReplyDelete
  28. We want to create hotspot in mobile know? How to create? From where i can get the codings?

    ReplyDelete
  29. sir i tried your application but i have received a error message "Other peripheral device not successfully installed"...thanks for the post i hope you can help me in my problem

    ReplyDelete
  30. i tried your project i found a problem..

    after switching on both the server part and the client part respectively,

    The client part(mob) finds the server(PC) and says it is connected

    But the server part app keeps on searching and is unable to find the client part...

    any idea what's the problem??

    ReplyDelete
  31. hey it doesnot work as gives media exception.

    ReplyDelete
  32. Thanks for sharing this topic! I came across this site the other day. The officially released images of this are available at our site. A lot of people think this would be cool if it was robotic.

    ReplyDelete
  33. Links to Application are dead, pls mail me both server and client parts at rajeevx_rsd@yahoo.co.in

    ReplyDelete
  34. CARA VC POD ME AJUDAR EU FIZ TUDO CERTINHO, QUANDO EU APERTO EM TRANSMIT, UMA JANELINHA PEQUENA SE ABRE MAS NÃO CONSIGO VER A IMAGEM DA CAMERA.

    ABRAÇO A TODOS!

    ReplyDelete
  35. The Server part is showing cconnecting to client, when i press transmit in client part i.e., on mobile, can you help me to get rid from this problem
    Email id: athiesh.t@gmail.com

    ReplyDelete
  36. when i run the client in my Huawei U1280 It gives a error message "Exception The application has unexpectedly quit. javax/bluetooth/DiscoveryListener"
    Is this because my device not supporting bluetooth in java apps?
    Sorry I know nothing about java.:(

    ReplyDelete
  37. i have tried it on many nokia phones but it did,nt works so which nokia mobile r u saying abut plz mention nokia model no. ...............Urgent

    ReplyDelete
  38. how can we increase frame per second in this project

    ReplyDelete
  39. Can you please send it to my email, i have been looking for something like this.

    ematlas@hotmail.com

    ReplyDelete
  40. thanx bt can u plz tell me how 2 start .jar file in system

    ReplyDelete
  41. can i get project REMOTE ADMINISTRATION USING MOBILE with source code ???

    ReplyDelete
  42. hello sir,
    i am kunal i am working on my final year project based on j2me so this project can help me on my project ...
    can you please send me all source code on my mail id -- bkunal20@gmail.com
    please sir as early as possible.........

    ReplyDelete
  43. hey nice project !!!! can it work on symbian mania mail me at nick49lan@gmail.com

    ReplyDelete
  44. can u plezz send me complete code and documents .. sarde.tushar@hotmail.com

    ReplyDelete
  45. hello sir ..i am Pritam.
    I would like to work on this project for final year..can u send me complete code at..
    pritamvkh007@gmail.com

    ReplyDelete
  46. hello sir,the server and client part is not available,so can u plzz mail me...
    my email id is gupta.ganeshnit@gmail.com

    ReplyDelete

Type here your comments