Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm trying to find a developer to write me a pretty basic program. I am also a developer, but don't have enough time to write it myself.

This program has a pretty basic function. It will notify users, via some dialog (or alert) that some program is about to access the built in desktop / laptop camera. It could be skype or facetime, or whatever it is, the program should be aware of when the OS's camera is going to be accessed and notify the user. Yes, even if the user is initiating the camera themselves via Skype, the notification would still appear.

My question is this. If I need this program written in Java, is it possible? Obviously I am trying to get it done in Java so it would run on Windows and Mac.

If it is not possible, then it seems as though I'd have to write 2 separate programs on Windows and Mac.

I've come here to get suggestions so that I can connect with the right developers. If you have any suggestions, I'd be happy to hear them. Thanks!

share|improve this question

1 Answer 1

No, it isn't possible to write an application that detects if the camera is being accessed in Java.

The reason for this is that the "is accessing a usb device that happens to be camera" is something that is part of the deep system calls of the operating system. To interrogate the system at this level, you need to be able to call methods against the system and hardware itself - something that java specifically abstracts away from you.

You might be able to write drivers for various cameras and access them in java, though each camera may require a different driver, and the driver for Windows is different than the driver for Mac.

You really need to abandon the requirement and idea that you will have a single application that works on both systems. You will need to write a native application that is able to talk to the operating system and ask it about what devices it has and what their status is. This isn't something Java was designed for.

share|improve this answer
    
hey man, thanks for the answer. would it make any difference if it was an embedded camera? –  kurtybot Aug 29 '13 at 23:27
    
@kurtybot if anything, embedded cameras are more difficult. Is that a usb camera? firewire (the iSight camera was firewire)? or a thunderbolt? or something else? –  MichaelT Aug 29 '13 at 23:43
    
unfortunately the project spec says "any camera" whether usb or embedded. the client isn't technical and not programmers either. i haven't developed OS level stuff either but my guess is it's a difficult task, if even possible. –  kurtybot Aug 29 '13 at 23:45
    
Even if you'd drop the "Java" requirement, it would be very hard. Is the "AcmeWidget" used by "AcmeViewer.EXE" (both from Acme, Inc.) a camera or not? –  MSalters Aug 30 '13 at 10:49
    
@kurtybot lets just limit it to usb for the time being - you're likely going to want to look into how to explore the usb devices on the system for their capabilities. See Mac USB Overview for an example of the devices and a starter for how to probe the usb chain for devices with certain capabilties. Thats a starting spot. –  MichaelT Aug 30 '13 at 15:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.