It seems that with these Wifi APIs the app could find out if the device is connected to a wifi or not:
https://developer.mozilla.org/en-US/docs/Web/API/WifiManager
https://developer.mozilla.org/en-US/docs/Web/API/WiFi_Information_API
So there could be a checkbox in the app (much like for the ownCloud Android app) to »Upload only on Wifi«.

As for uploading: Does the camera also have an API which might fire off events when a new photo is taken? You could hook into that, and for the first iteration just upload pictures directly.

David, do you have any pointers here – how does the ownCloud Android app handle it?



On 12.08.2014 00:45, Lyndsey Jane Moulds wrote:
Hello oC developers,

I'm currently building a Firefox OS mobile app that automatically backs up photo and video media from the device to ownCloud. Since this is my first time developing for mobile, I'm unsure of the best way to handle automatic photo uploads.

My initial idea was to check device storage every few hours and upload any new media to ownCloud. I'm not sure if this is the most effective manner of handling this. I know that the Google Plus backup on my phone, for example, uploads my pictures in batches. However, I'm not sure how it decides when to check for new photos and when to upload. (Should the app also, for example, wait until the user connects to wifi to upload the media? I am not sure how I would access this information on Firefox OS.)

If anyone could offer general advice regarding syncing from mobile devices, that would be great. I'd love to hear from other developers who have experience implementing similar functionality.

Thanks,
Lyndsey


_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel

_______________________________________________
Devel mailing list
[email protected]
http://mailman.owncloud.org/mailman/listinfo/devel

Reply via email to