Webcam on Unrooted Nexus

Everyone with an unrooted Nexus can now use the latest version of the modified simplewebcam app here. Version 5 does not require ‘su’ anymore to access the webcam. Thanks to Dan from xda developers who pointed out that this worked.

13 responses to “Webcam on Unrooted Nexus

  1. Hello again,
    I tried the latest code on my un-rooted devices. No luck. I did add a for loop to surfaceCreated in the old non su code and this will make it work on my new N7 and S3. I also notice that the thread does stop after exit. I played with it for a while, but did not get anywhere.

    For loop:
    for(int i=6; i>=0; i–){
    if(new File(“/dev/video” + Integer.toString(i) ).exists()){
    cameraBase = i;

    • Hey Dan,

      yeah I merely changed the permissions as a quick fix. The device node selection is still not working for some devices.
      I am currently finishing up a completely rewritten app that makes the whole code much more object oriented and moves a lot of
      things into java which makes adding features a lot easier. Video recording, automatic probing for webcams
      and different resolutions are actually working already but this still needs to be cleaned up.
      I hope I can publish a beta on the blog within this week before getting it out on the app store.

    • Hello Dan,
      I was wondering if you changed anything else to get it to work on your new N7 other than adding the for loop. I added the loop but still couldn’t get the stream. The program would usually just show and all blank screen and then the Nexus would reboot. I added to select video3 as default which is what it is on this N7 but still no luck. I did see a still image for a second before it crashed and the device rebooted. Is your new N7 rooted? any advice would be greatly appreciated!
      Thank you!

  2. The code can be modified to get a more full-screen video by setting a 16:9 aspect ratio in the video scaling code in class and holding the tablet in landscape orientation. In the VideoHandler class change the current code to following:

    //obtaining display area to draw a large image

    scale_x = ((float)(dw+winWidth-1)/(float)CameraPreview.IMG_WIDTH);
    scale_y = ((float)(dh+winWidth*9/16-1)/(float)CameraPreview.IMG_HEIGHT);
    scale_x = ((float)(dw+winHeight*16/9 -1)/(float)CameraPreview.IMG_WIDTH);
    scale_y = ((float)(dh+winHeight-1)/(float)CameraPreview.IMG_HEIGHT);
    canvas_pos_scale.setScale(scale_x, scale_y);

  3. If using version 5 of the apk, setting permissions via a terminal shell every time the rooted nexus7 4.3 (2012) is turned on, or the camera is re-inserted, is not needed, correct?
    ( i.e.
    cd dev
    ls (Verify ‘video0′ is present after plugging in camera)
    chmod 666 video0

    Is there a specific type of usb webcams that this will work on? I can’t get mine to show up.

  4. Great app. To bad no one makes a webcam with a OTG cable. Ideal would be a camera in thumb drive. I bet hundreds of Nexus 7 (2012) owners would want this.

  5. I have a Samy GS2 would love an OTG usb cam for car eg: on radiator/ rear and to be able to record. Will it be an option? I use mycar recorder which is great just want to move the cam to a usb on outside of vehicle.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s