Device Driver access via native functions called via JNI

880 views
Skip to first unread message

Sambhav

unread,
May 11, 2010, 2:38:19 AM5/11/10
to andro...@googlegroups.com

Hi All,
 
I have a JavaClass which calls native C function via JNI.
Can these C function access the device drivers directly ?
 
Ex. I want to access /dev/video1 from the C function called via JNI. (This failed)
However in native C application I was able to access /dev/video1
 
Regards,
sambhav

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Kelly

unread,
May 11, 2010, 1:26:46 PM5/11/10
to android-ndk
"However in native C application I was able to access /dev/video1"

I think you meant 'wasn't'. You can check permissions by using the adb
shell and ls. I wouldn't hold much hope of having app level read
access to drivers on many or any devices.

Cheers

Sambhav

unread,
May 12, 2010, 12:40:52 AM5/12/10
to andro...@googlegroups.com
Thanks everyone. It worked after making #chmod 0777 /dev/video1 :)

rajesh

unread,
Sep 5, 2012, 6:33:38 AM9/5/12
to andro...@googlegroups.com
Hi sambav ,
I am trying to access chmod 0777 /dev/video1 . but i am uable to do it . so can you please suggest me how to use this and also whether can we get the video file from this ?

Thanks ,
Rajesh K

Philippe Simons

unread,
Sep 5, 2012, 7:43:06 AM9/5/12
to andro...@googlegroups.com
chmod 777 /dev/video1, is high security flaw.
It would allow any application to grab what's going on my display
(including password).

you need root permissions to read this file. of course that means you
need to root your device.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/9RNhtITFPTkJ.

Sangamanath Kalashetty

unread,
Sep 5, 2012, 12:08:32 PM9/5/12
to andro...@googlegroups.com
hi simons,

Even I also faced the same problem when I was using the ALSA to
capture the audio on android device, but was able to access the device
when I rooted device, and was working fine. Do any one know how to
get the permission of the devices without rooting it.
It will be very helpful.

Thanking you in advance,
ksam
Reply all
Reply to author
Forward
0 new messages