This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes get the device letter of usb as soon as it connected to the computer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "get the device letter of usb as soon as it connected to the computer" Watch "get the device letter of usb as soon as it connected to the computer" New topic
Author

get the device letter of usb as soon as it connected to the computer

manucng davangere
Greenhorn

Joined: Aug 10, 2009
Posts: 12
Hi all,

i am developing one software,in which i have to detect the usb arrrival and it has to get the drive letter of that device(like F,G,M).can you please help me to get code which gets the device letter of connected device .and it has to detect every time as soon as usb connects to the port and it has to get the device letter ,that means it has to work for more than one usb devices.


regards,
manu
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

I'm not sure if we can do this in Java without some JNI. You could try a third party library like jUSB and see if that supports what you want. If not, you will have to use JNI yourself.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
manucng davangere
Greenhorn

Joined: Aug 10, 2009
Posts: 12
Rob Prime wrote:I'm not sure if we can do this in Java without some JNI. You could try a third party library like jUSB and see if that supports what you want. If not, you will have to use JNI yourself.



i am not able to create dll also .i am not getting c/c++ code to detect device and get drive letter .do you have any source?.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Sorry, I haven't done any USB programming at all.
 
Consider Paul's rocket mass heater.
 
subject: get the device letter of usb as soon as it connected to the computer
 
Similar Threads
iPad
How to get logcat dump of the device..
XP Driver for IEEE 1394 SBP2 Device
communication between java and GSM device, connected to USB port
Controlling a serial device from an Android app using USB connection