[APP] MobileWebCam (2G/3G/WIFI, no PC or UMTS router required!) v3.13

Search This thread

_miha_

Senior Member
May 5, 2010
278
161
Hamburg
There are a lot of fine webcam (with video!) apps in the Market. But I found none which can be used with just a phone without any computer or wifi connection and placed in your car, weekend home, garage, ... to upload pictures to a server in defined refresh times. So I built this app. It is not finished but good enough for a lot of things.

For easy setup with a nice user interface have a look at sensr.net - they offer camera webspace and the ftp setup with MobileWebCam is very easy. For even more possibilities like gallery-hosting, hardware motion detection and housing have a look at opensmartcam.com ... they even sell or rent complete cameras based on MobileWebCam.

Edit: The app can now also automaticilly email the pics, upload to ftp or simply store them on sdcard. Also a manual mode is new for when you are running around taking pictures to be uploaded to your website/email account on the go with one simple tap.
Dropbox usage also possible now!
Invisible Background mode available now to save power or hide the cam. Autofocus can now be used in and the camera can be remote-controlled by sending SMS commands to your phone.


I will use this with an old phone with broken touch input (but luckily a dpad) and a simple free sim card wich has 30MB data traffic free/month (don't know if providers in other countries offer something like that). So I can have about 20 picture refreshes a day at a location with no WIFI or 3G (and of course no cable/dsl/...). FOR FREE! In the App activity times can be set so no black night views. No WIFI needed, just power to keep the phone running (I wonder how long it will last ;).

Also I use this with my main phone to quickly show my wife the kids playing on the playground, watch the garden when I am working inside and stuff like that. For this use case an email notification can be sent containing a link for her to view on her phone or pc at work.

Should run on Android 1.5 up (what causes the camera options to be very few and landscape mode only). So you can buy a somewhat broken phone on ebay (speakers not needed, display doesn't have to work well, ...) and have one of the easiest and cheapest webcam setups possible (I think ;) ...

For your personal website webcam you need a php capable server somewhere where the picture can be refreshed. There you have to place the two files (mobilewebcam.php and index.html) attached to this post. Since version 1.3 you can also sent the pictures to an email account or simply store them on sdcard. From version 1.6 on ftp upload is also possible.

This also can be combined with my WebLiveWallpaper App easily and your webcam is then visible on your homescreen background all day.

I have uploaded my webserver files for a simple gallery and timelapse video on a google code project: please let me know if you can improve it!

Most of the sourcecode can now be found at http://code.google.com/p/mobilewebcam-android/ ... so if you need special stuff simply add it yourself and publish your changes! Please help me fix all the bugs and send me a notice if you repaired or improved something. There is so much crappy hacked code in there ...

MobileWebCam
https://market.android.com/details?id=com.dngames.mobilewebcam

How to build a housing for your phone with MobileWebCam:
http://www.instructables.com/id/GSM-Android-phone-as-HD-outdoor-webcam/

Edit: version 3.09: Log from inside the app for logs from Android 4.3 on ... (new log permission required for older devices)

Edit: version 3.01-04: Focus mode selection, changed some internals, several crash fixes, zoom autofocus

Edit: version 2.9983: ftp upload for low bandwith/large pictures improved (set filename only after upload finished, skip upload if still busy with last), night time camera settings can be configured in camera screen by toggling to night configuration and then changing camera parameters, show last error in preview screen

Edit: version 2.996: Added some support for Samsung Galaxy Camera (1, 2, NX)

Edit: version 2.990: I restructured a lot internally - now multiple threads for work and upload - hopefully not totally broken! Also waits for gps now, shows more motion detection info, some repairs from reports (config.txt, crash on devices without wifi?, higher default cam delay, ...)

Edit: version 2.98: imprint picture scaling, all transparent colors can be set, sdcard delete old pictures, a little work on gps stuff

Edit: version 2.97: night auto stuff again, sdcard file broadcast to mediascanner, transparent colors can be set, camera deadlock for event trigger photo burst fix

Edit: version 2.96: night auto disable fix, sdcard path, imprint stamp picture downloadable from URL

Edit: version 2.95: night setup, camera open wait time for phone that otherwise produce overexposed pictures in the background modes

Edit: version 2.93: default exposure back to 50 (fix for darker pictures), front cam flip/rotate, possibility for trigger pause time, dropbox batch upload

Edit: version 2.92: fixed crash, made camera effect setting (zoom, exposure, white balance, color effect, scene mode) more interactive, fixed mirrored pictures

Edit: version 2.87: picture burst mode after trigger, moved broadcast receiver mode to event triggers, added event notification to email, added more camera settings (scene modes, color effects), timestamped httppost filename for opensmartcam

Edit: version 2.86: color stuff, alignment, ftp ending fix, background mode switch fix

Edit: version 2.85: shutdown, imprints, galaxy S camera error 0 fix, email trigger

Edit: version 2.82: ftp batch mode, small fixes

Edit: version 2.81: some new config crash fixes fixed, log, backup/restore, keep ftp connection + log frequency

Edit: version 2.76: more webinterface, config help, fullscreen preview option, fix for crash on large screen devices (sorry, I do not own one)

Edit: version 2.73: custom font and typeface added to imprint settings, crash fix for opensmartcam reg error

Edit: version 2.7: Welcome screen, remote control website (see config.zip), 2.71 fixes the original size picture upload if not enough memory

Edit: version 2.64: Nexus 7 frontcam only devices work now

Edit: version 2.63: dropbox authentication method changed to web

Edit: version 2.61: flashlight toggle 2.62 Actionbar for Android > 3.0

Edit: version 2.52: custom picture sizes (+fix from 2.51)

Edit: version 2.37: started to experiment with photo effects like instagram

Edit: version 2.36: webserver (wifi only) now also streams mjpeg, ...

Edit: version 2.3: integrated simple webserver (wifi only), added gps location to make interesting moving cameras, ...

Edit: version 2.2: two different background modes (depends on device, no advanced features working in hidden mode but less power)
 

Attachments

  • serverfiles.zip
    653 bytes · Views: 5,163
  • menu.png
    menu.png
    20.3 KB · Views: 16,342
  • screenshot1.png
    screenshot1.png
    57.2 KB · Views: 11,127
  • screenshot2.jpg
    screenshot2.jpg
    37.9 KB · Views: 11,120
  • config.zip
    822 bytes · Views: 2,323
  • 20130213101156.jpg
    20130213101156.jpg
    5.5 KB · Views: 8,782
Last edited:

Captainkrtek

Retired Recognized Developer / Retired Forum Mod
Feb 16, 2010
2,436
560
Seattle
Awesome! Thanks for sharing this, check the XDA portal some time this weekend, wrote up this app for the front page :)
 
  • Like
Reactions: _miha_

d0ugie

Senior Member
Jan 30, 2007
563
44
New York
batteryboss.org
Hey miha:

Though you'd need to tweak this to create random directories or accounts or whatever, I've got a pretty heavy duty Linux server with a fat pipe I'd be willing to let you tie your program into so people don't have to have their own server. Think it over, let me know.
 

_miha_

Senior Member
May 5, 2010
278
161
Hamburg
Hey miha:

Though you'd need to tweak this to create random directories or accounts or whatever, I've got a pretty heavy duty Linux server with a fat pipe I'd be willing to let you tie your program into so people don't have to have their own server. Think it over, let me know.

Sounds great! Thank you! I already thought about using my little webspace and allow only one refresh a day or so to enable people to try the app but that will be so much better! I will think about the identification/account - may be best the server creates them and my app just asks for a new user - and come back to you when I have got a little more time to put that into the app.
 
  • Like
Reactions: [email protected]

white-energy

Senior Member
Apr 9, 2010
646
223
Kyiv
Is there a how to.. i can't get this to work correctly.. i always got "something went wrong"
EDIT: Works.. just my firewall was disabling the connection.
 
Last edited:

orthonovum

Senior Member
Jul 11, 2010
353
79
Status Error Copying every time..


am I missing something? permissions?

I am running latest apache and PHP and firewall is allowing connections to port 80

testing on local network

whats wrong?
 

rh387

Member
May 3, 2009
9
2
For those who are having issues, make sure that the web server (Apache) has write permissions to the folder that this is in.
 
  • Like
Reactions: _miha_

MuF123

Senior Member
Jul 18, 2009
1,003
109
works great, both the android part and the server part.

What might be great:
-resolution selection - when Im no wifi it could potentially upload higher resolution
-it should be possible to turn off those popus regarding uploaded picture
 

sceada

Member
Jan 1, 2008
7
1
Very nice App, just a small thought:
Your php script does not check for any attribute other than if there is a filename on the uploaded file.
So everyone who knows the URL to your "mobilewebcam.php" can upload anything to your server which is a major security flaw.
Just think about those nifty little php-shells to get complete control of it and steal stuff like databases, not to mention illegal stuff fileshared via your server...
All you need for this is a (really) simple html-file with a file-upload form in it which targets your "mobilewebcam.php" file.
Your script should have some filesize-limit and allow no other file formats than *.jpg (also not something like x.jpg.php).

Regards, sceada

PS: Please excuse my mistakes, english isn't my native language ;)
 
Last edited:

actapon

New member
Jan 29, 2011
2
0
some design thoughts

I had an idea similar to this, just haven't had time to start developing anything... here were some of my design thoughts:

--motion detection to webcam device
--audio detection to webcam device
--accessible via android app (not just a php webpage)
--add notifications to android app for motion/audio detection events
--support for multiple webcam devices

The server requirement seems ok - it allows for a single point of integration for both clients and webcam devices. It could also provide a way around firewalls if the server could be deployed to a public ip.
 

_miha_

Senior Member
May 5, 2010
278
161
Hamburg
Thank you for your comments! Will try to answer all in one post:

-resolution selection - when Im no wifi it could potentially upload higher resolution
-it should be possible to turn off those popus regarding uploaded picture

Resolution selection will be added next, yes. May be at first only a checkbox for small/large because I can do that quickly (my time for this app is soo limited - I want to make the other one fine first).
The popups already do not show up when refreshing very fast but yes, a checkbox for that is done faster than typing this so I will add it :)

Your php script does not check for any attribute other than if there is a filename on the uploaded file.
So everyone who knows the URL to your "mobilewebcam.php" can upload anything to your server which is a major security flaw.
PS: Please excuse my mistakes, english isn't my native language ;)

Yes I know! You are totally right! That is why I put these "please understand first" texts in the market description. But supplying a more complicated php file will only make understanding of it more difficult. I added a comment to the market desciption now. My php file is only the very basic needed code to get it running. Do you want to make me a better/safer one? I can then link to it in the description! English isn't for me also :)

--motion detection to webcam device
--audio detection to webcam device
--accessible via android app (not just a php webpage)
--add notifications to android app for motion/audio detection events
--support for multiple webcam devices

The server requirement seems ok - it allows for a single point of integration for both clients and webcam devices. It could also provide a way around firewalls if the server could be deployed to a public ip.

Motion and audio detection would be possible (not too difficulty I think) from preview picture and mic but at the moment I really do not have enough time for that - I would love to!
Remote control also is a feature I would like (I would personally use it for my weekend home cam!) but I didn't come up with an easy way to communicate with the phone.
An Android app to access the webcam IS there: it's my other app (ignoring the old games) WebLiveWallpaper which also contains an App to view stuff like a picture frame and may even get a widget for this later.

The php server posted picture is the only way to make it work on many mobile providers because as far as I know there is no way for the phone to get an easily public accessible ip. Also it is the easiest way to make you webcam visible for more than a mobile bandwidth limited number of viewers.

Thank you for reading,
Michael

Edit: updated apk with larger image size and no messages is in first post
 
Last edited:
  • Like
Reactions: MuF123

tarekkkkk

Senior Member
Mar 27, 2010
489
54
can i use it as streaming ?? please say yes awesome work :D
Edi: if not streaming then some software that will refresh the jpg every 5 sec or so
Edit2: it tunrs out the script is hanging on the loading part i dont know whats wrong but it isnt reloading as its supposed to be maybe a server issue ?
 
Last edited:

_miha_

Senior Member
May 5, 2010
278
161
Hamburg
can i use it as streaming ?? please say yes awesome work :D

Unfortunately I have to say no. Only very fast refresh if you set the refresh time to 0 and your device and server are fast enough to handle all the picture uploads.
I am not sure real streaming could be done with simple php. Maybe MJPG? But then a "constant" connection between server and app would be required which is somehow against the whole idea of this APP to be a lowcost/lowbandwidth mobile solution.
For real streaming I recommend IP Webcam and others from the market (but they will not work with most mobile providers as far as I know).

Edit: Future ideas ... It would be possible with to generate an mjpg with the server php and make it available to the watchers with a time delay - so then you have some kind of from time to time (switch to next mjpg) broken streaming (and require a lot of server power/bandwidth) with the image uploads of a camera like my app. Just an idea I will not implement - at least not now - but someone else could. One part is already done here!
 
Last edited:
  • Like
Reactions: tarekkkkk

tarekkkkk

Senior Member
Mar 27, 2010
489
54
thanks man i hope you add a streaming app that would be epic awesomeness :D
i tried to set it to 0 but lol its taking pictures but not uploading because the app is meant to take pic and then it will be uploaded it because its 0 sec it cant handle the capture and upload at the same time it needs sync :)
 

defcon.666

Member
Jan 21, 2011
35
0
everything works fine. I have the ownership of the folder too. it did uploaded the picture
BUT I cant view the picture from both index.html or when I double clicked the pic file. it says I dont have the permission to view this pic but when I check the owner it was me. that is so strange.
 

_miha_

Senior Member
May 5, 2010
278
161
Hamburg
it says I dont have the permission to view this pic but when I check the owner it was me. that is so strange.

Is it possible that you also have to give it everyone view rights to be able to view it in the browser not just yours which the browser doesn't use/know? Or did I get the problem wrong?

What is the exact error message/code?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    There are a lot of fine webcam (with video!) apps in the Market. But I found none which can be used with just a phone without any computer or wifi connection and placed in your car, weekend home, garage, ... to upload pictures to a server in defined refresh times. So I built this app. It is not finished but good enough for a lot of things.

    For easy setup with a nice user interface have a look at sensr.net - they offer camera webspace and the ftp setup with MobileWebCam is very easy. For even more possibilities like gallery-hosting, hardware motion detection and housing have a look at opensmartcam.com ... they even sell or rent complete cameras based on MobileWebCam.

    Edit: The app can now also automaticilly email the pics, upload to ftp or simply store them on sdcard. Also a manual mode is new for when you are running around taking pictures to be uploaded to your website/email account on the go with one simple tap.
    Dropbox usage also possible now!
    Invisible Background mode available now to save power or hide the cam. Autofocus can now be used in and the camera can be remote-controlled by sending SMS commands to your phone.


    I will use this with an old phone with broken touch input (but luckily a dpad) and a simple free sim card wich has 30MB data traffic free/month (don't know if providers in other countries offer something like that). So I can have about 20 picture refreshes a day at a location with no WIFI or 3G (and of course no cable/dsl/...). FOR FREE! In the App activity times can be set so no black night views. No WIFI needed, just power to keep the phone running (I wonder how long it will last ;).

    Also I use this with my main phone to quickly show my wife the kids playing on the playground, watch the garden when I am working inside and stuff like that. For this use case an email notification can be sent containing a link for her to view on her phone or pc at work.

    Should run on Android 1.5 up (what causes the camera options to be very few and landscape mode only). So you can buy a somewhat broken phone on ebay (speakers not needed, display doesn't have to work well, ...) and have one of the easiest and cheapest webcam setups possible (I think ;) ...

    For your personal website webcam you need a php capable server somewhere where the picture can be refreshed. There you have to place the two files (mobilewebcam.php and index.html) attached to this post. Since version 1.3 you can also sent the pictures to an email account or simply store them on sdcard. From version 1.6 on ftp upload is also possible.

    This also can be combined with my WebLiveWallpaper App easily and your webcam is then visible on your homescreen background all day.

    I have uploaded my webserver files for a simple gallery and timelapse video on a google code project: please let me know if you can improve it!

    Most of the sourcecode can now be found at http://code.google.com/p/mobilewebcam-android/ ... so if you need special stuff simply add it yourself and publish your changes! Please help me fix all the bugs and send me a notice if you repaired or improved something. There is so much crappy hacked code in there ...

    MobileWebCam
    https://market.android.com/details?id=com.dngames.mobilewebcam

    How to build a housing for your phone with MobileWebCam:
    http://www.instructables.com/id/GSM-Android-phone-as-HD-outdoor-webcam/

    Edit: version 3.09: Log from inside the app for logs from Android 4.3 on ... (new log permission required for older devices)

    Edit: version 3.01-04: Focus mode selection, changed some internals, several crash fixes, zoom autofocus

    Edit: version 2.9983: ftp upload for low bandwith/large pictures improved (set filename only after upload finished, skip upload if still busy with last), night time camera settings can be configured in camera screen by toggling to night configuration and then changing camera parameters, show last error in preview screen

    Edit: version 2.996: Added some support for Samsung Galaxy Camera (1, 2, NX)

    Edit: version 2.990: I restructured a lot internally - now multiple threads for work and upload - hopefully not totally broken! Also waits for gps now, shows more motion detection info, some repairs from reports (config.txt, crash on devices without wifi?, higher default cam delay, ...)

    Edit: version 2.98: imprint picture scaling, all transparent colors can be set, sdcard delete old pictures, a little work on gps stuff

    Edit: version 2.97: night auto stuff again, sdcard file broadcast to mediascanner, transparent colors can be set, camera deadlock for event trigger photo burst fix

    Edit: version 2.96: night auto disable fix, sdcard path, imprint stamp picture downloadable from URL

    Edit: version 2.95: night setup, camera open wait time for phone that otherwise produce overexposed pictures in the background modes

    Edit: version 2.93: default exposure back to 50 (fix for darker pictures), front cam flip/rotate, possibility for trigger pause time, dropbox batch upload

    Edit: version 2.92: fixed crash, made camera effect setting (zoom, exposure, white balance, color effect, scene mode) more interactive, fixed mirrored pictures

    Edit: version 2.87: picture burst mode after trigger, moved broadcast receiver mode to event triggers, added event notification to email, added more camera settings (scene modes, color effects), timestamped httppost filename for opensmartcam

    Edit: version 2.86: color stuff, alignment, ftp ending fix, background mode switch fix

    Edit: version 2.85: shutdown, imprints, galaxy S camera error 0 fix, email trigger

    Edit: version 2.82: ftp batch mode, small fixes

    Edit: version 2.81: some new config crash fixes fixed, log, backup/restore, keep ftp connection + log frequency

    Edit: version 2.76: more webinterface, config help, fullscreen preview option, fix for crash on large screen devices (sorry, I do not own one)

    Edit: version 2.73: custom font and typeface added to imprint settings, crash fix for opensmartcam reg error

    Edit: version 2.7: Welcome screen, remote control website (see config.zip), 2.71 fixes the original size picture upload if not enough memory

    Edit: version 2.64: Nexus 7 frontcam only devices work now

    Edit: version 2.63: dropbox authentication method changed to web

    Edit: version 2.61: flashlight toggle 2.62 Actionbar for Android > 3.0

    Edit: version 2.52: custom picture sizes (+fix from 2.51)

    Edit: version 2.37: started to experiment with photo effects like instagram

    Edit: version 2.36: webserver (wifi only) now also streams mjpeg, ...

    Edit: version 2.3: integrated simple webserver (wifi only), added gps location to make interesting moving cameras, ...

    Edit: version 2.2: two different background modes (depends on device, no advanced features working in hidden mode but less power)
    3
    sorry for the flood of updates ... I broke it for devices without flash and then for all ... 3.03 is in store
    2
    mobilewebcam instructions for new users (german language)

    Hi,

    after 3 weeks testing, wasting time and now using a new phone, after receive some help in this forum and by phone, i just wrote a simple instruction manual for new users to give something back to the community.

    I write it in german language, because my english language is not the best. Maybe anyone can translate it?

    I think it's usefull for some new users.

    Best regards and thanks again especially to MIHA and ME-SYSTEME! :good:

    Elton100
    2
    Hey miha:

    Though you'd need to tweak this to create random directories or accounts or whatever, I've got a pretty heavy duty Linux server with a fat pipe I'd be willing to let you tie your program into so people don't have to have their own server. Think it over, let me know.
    2
    test version 2.57

    Sorry for the incomplete fix. I hope this is ok now!
    Another crash in 2.56 removed. Also the "still alive" is moved to override every possible inactivity.