Skip to content

Instantly share code, notes, and snippets.

@foota
Created May 14, 2012 18:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foota/2695386 to your computer and use it in GitHub Desktop.
Save foota/2695386 to your computer and use it in GitHub Desktop.
Remote camera using Android devices (SL4A)
import android
from wsgiref.simple_server import make_server
droid=android.Android()
pic='/sdcard/snapshot.jpg'
def camera(env,res):
if env['PATH_INFO']=='/':
droid.cameraCapturePicture(pic)
res('200 OK',[('Content-type','image/jpeg')])
return [file(pic).read()]
httpd=make_server('',9998,camera)
httpd.serve_forever()
@foota
Copy link
Author

foota commented May 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment