Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Upload (Android 7+) #358

Merged
merged 114 commits into from Nov 16, 2016
Merged

Auto Upload (Android 7+) #358

merged 114 commits into from Nov 16, 2016

Conversation

AndyScherzinger
Copy link
Member

@AndyScherzinger AndyScherzinger commented Oct 26, 2016

New instant upload implementation for any device running Android 5 or later - called Auto upload

This new implementation supports "V1" of the specified feature set, which focuses on

  • bringing the instant upload feature to Android 7+
  • supporting Android Doze
  • supporting instant upload for any kind of media folder (at the moment this means Images/Videos)

for any future increments, please see #285

This is a collaboration between @AndyScherzinger and @tobiasKaminsky coding-wise.

@nextcloud/designers please have a look at the actual screenshots (below), hereby requesting feedback/discussion. In short we mimic Google Photos to some extend.

display media folder in a sectioned grid (--> headers). Each folder shows its name, up to 8 thumbnails, remaining images of the folder for >8 files in the respective folder, on/off toggle icon, three dot for custom preferences (per folder, beware though that we have a defaulting so you don't need to configure anything).
device-2016-10-26-144206
The sorting is weighted and alphabetical, meaning they are sorted alphabetically (while a folder named "Camera" wins...) and weighted by active/inactive. Thus active one will be at the top and the Camera folder will always be at the top of the active or the inactive cluster.
The thumbnails shown per folder are always the latest ones (as in date taken, modification-date) and they get cached

Preferences are adopted from the actual/known instant upload capabilities as is choose the upload folder, wifi only, charging only, created sub-folders, upload behavior, enable/disable.
device-2016-10-26-144227

The new instant upload is so cool it got it's own main menu item 😋
device-2016-10-26-144449
Also due to the fact that this feature has at least for evolutionary increments to be possibly implemented see #285 and will transform into a general folder sync feature in the future


Tasks Tobi

  • Use DB for hardcoded DCIM folder to implement FolderObserver, JobScheduler
  • Use DB to start/stop/resume all DB entries for FolderObserver
  • Adapt UploadPane to new system
  • Fallback system for android versions that do to support JobScheduler (< 5)
  • "null bug" see Auto Upload (Android 7+) #358 (comment)
  • Using subfolders when uploading screenshots doesn't work. see Auto Upload (Android 7+) #358 (comment)
  • Depending on the upload behavior (like "just upload") the instant upload should not copy the uploaded files into the app (at least they should be removed after they have been uploaded, else instant upload is not respecting its own preferences)

Tasks Andy

  • Folder sync overview recycler view with header implementation
    • Performance tuning, async setting of the image
  • Folder sync custom settings UI
  • Media query implementation for standard options for media folders (sync deactivated by default)
  • Smart sorting for sync folder list (weighted, mostly alpha-numerical, active/disabled)
  • Show message if no (really no) media folder is available (e.g. fresh created emulator)
  • Fix state (enabled/disabled) persistence bug
  • Always display the latest media (add order by clause to media queries)
  • Hide menu item below Android 5
  • Hide (legacy) instant upload preferences on Android 5+
  • Feature pop-up with a hint to the new folder sync functionality and deactivation of the legacy instant upload
  • Remove legacy shared preferences for Android 5+
  • Further UI tweaking of the settings screen
  • Ability to disable a folder in its settings
  • Camera uploads lead to "new" Camera folder in the instant upload screen, hiding the original one (suspicion: wrong distinct in the media query + filter needed for Nc internal folders containing media)
    • Filter Nextcloud app folders from being displayed

tobiasKaminsky and others added 30 commits September 26, 2016 17:59
…aft implementation of a SyncFolderProvider for DB operations
…move the Observable to the Provider implementation)
@AndyScherzinger AndyScherzinger changed the title Auto Upload (Android 5+) Auto Upload (Android 7+) Nov 10, 2016
@AndyScherzinger
Copy link
Member Author

Small update as for the release schedule, discussed with Tobias. Instant Upload is currently broken on Android 7+. This implementation is now already available in the beta release for some time but we are still facing issues when it comes to, folders on external storage (as in USB mounted memory), uploads not seem to get triggered on all the devices out there, Auto upload screen showing image folders within Nextcloud (e.g. photos you downloaded - which should be hidden of course).

So to not postpone the release candidates much longer for the next stable release we discussed to:

  • fix as many of the issues mentioned
  • activate it only for Android7+ (in RC/stable)
  • move on from there fixing issues (via >= 1.4.x releases)

@tobiasKaminsky
Copy link
Member

👍
Stable enough 🎉

@tobiasKaminsky tobiasKaminsky merged commit 088ea9f into master Nov 16, 2016
@AndyScherzinger
Copy link
Member Author

Yeah! 🚀

@enoch85
Copy link
Member

enoch85 commented Nov 23, 2016

Just tested the 20161123 beta version and there are still some issues with Android 7.

  • When auto-uploading pictures it first say that it fails, and then it retries and it suceeds
  • When deleting a photo in the Instanupload folder it says it can't be deleted, but it's deleted anyway (haven't tested other folders or files, but it should be the same behaviour for other files as well)
  • When choosing Move to Nextcloud folder or delete in the Auto-upload menu it doesn't upload and this still happens

What's what I've found so far. Do you guys have a Android phone with 7 installed? You should see the same behaviour.

Stable enough

Naah... But close :)

@AndyScherzinger
Copy link
Member Author

Thanks for the tests @enoch85 we'll look into it! :) The stable enough is meant as-in "stable enough for a release candidate" :D - I do have a Nexus5X running the latest (today's) Android 7.1.1 beta so I should be able to reproduce your findings.

as for the first fails, yeah that doesn't look nice. The initial fail happens every now and then since Android might just kill the process at the initial upload and later Tanks to Doze the retry sets in.

cc @tobiasKaminsky

@AndyScherzinger AndyScherzinger deleted the syncedFolders branch November 24, 2016 12:07
@enoch85
Copy link
Member

enoch85 commented Dec 5, 2016

Ok, just want to confirm that Auto upload now works as expected on Android 7 Nexus 5x with the latest beta 20161129

@jancborchardt
Copy link
Member

You rock @tobiasKaminsky @AndyScherzinger 🤘 :)

@sunny7773

This comment has been minimized.

@nextcloud nextcloud locked as resolved and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants