GithubHelp home page GithubHelp logo

photobackup / client-android Goto Github PK

View Code? Open in Web Editor NEW
46.0 46.0 15.0 453 KB

The Android PhotoBackup client, made to free your pictures from your device

Home Page: https://photobackup.github.io/

License: GNU General Public License v2.0

Java 100.00%

client-android's People

Contributors

bitdeli-chef avatar devfozgul avatar gitter-badger avatar luiscruz avatar naofum avatar stephanepechard avatar svetlemodry avatar zealot128 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

client-android's Issues

Tcp Port

You are using the default tcp port 8080 on the photobackup server instance.
Although the use must have the ability to change it to something else through the settings menu.

8080 is the default tcp port for a lot of projects as it is the HTTP Alternate by IANA

Thanks in advance

Limit to a specific Wifi SSID?

Hi,

I was wondering if there a way for the app to only try backing up when it's connected to a specific SSID.

My usage scenario is "only backup when at home". Since I connect to other Wifi networks during the day It keeps generating "failed" notifications on the phone.

Thank you for this app (and server)

Delete when backed up

An option that would delete image after it's been backed up. Otherwise great product, thank you.

Upload only photos from specified folders

I have few web pages and an icon set with few hundred small icons stored on my SD card. I guess you have a good idea what happend during initial backup. Yes, all these irrelevant pictures got copied along with my photos...

The client should backup only selected folders. There is no need to backup everything else. There should be list of the folders in the settings, however, defaults should be easy to detect (the DCIM folders). Also USB-OTG storages should be ignored.

Update App structure and add tests

The app is quite old and was created with Eclipse.
It is not structured as a modern one created through Android Studio and does not contain tests.
Add this would ease adoption of new developers and help us be confident in our code.

"Upload All" not working?

Version: 0.11.0 (33)
Server: PhotoBackup/server-go
App settings: Background data enabled; battery use is "unoptimized"
Android: Samsung One UI 4.1 (Android 12)

Selecting an individual image from the journal and doing a "Manual backup" works -- the file is received by the server. However, the "Upload All" function from the hamburger menu does nothing beyond showing the "Started to upload all pictures" message; there's no indication from the server reverse proxy that any request is sent to the server from the client.

Similarly, the app apparently never auto-uploads files, either with "Over Wi-Fi only" or "... or mobile network". Does the app start a service? Android shows an icon for every persistent (service) app, and I don't see one in my bar for PhotoBackup.

Folder selection should be a tree

When selecting directories to upload the list is not very practical, because there is a lot of stuff on the list and it is hard to find what should be synced. The selection works fine, but the list should preserve directory hierarchy and allow to collapse the subtrees.

resume mode, do not re-upload everything...

When I stopped the service, and the re-enabled it, it start to repush all pictures.... BUt the auditlogs are correct. Would it be possible to skip this re-upload, as sometimes I am on really slow and limited wifi.

let's imagine a "force/check" box, which when enable, act as now. If not enabled, just retry what is not success in the audit-log.

Might also want a full re-checked button.

does that make sense?

Thanks for the Android client, by the way.

Remove 'Stop the service' action in the notification

From gitter:

@zealot128
I have another question/propasal: From the notification one can stop the service. Is this useful? Maybe then I will forget to renenable the upload later on.

@stephanepechard
I don't know if it's useful, it's true I don't use it, but some people may forget they have the service running in background so I thought they could easily stop it from here
it's just an option, you can open the activity without stopping the service
but I agree it may be misunderstood

@zealot128
the notification is ok - If the user wants to stop, he can click the service and stop then. Stopping is not a very often used action, in my opinion, and only bloats the notification. I think, I even stopped the service accidently
maybe it is misunderstood in the way "Stop the current upload (Because I am not in a good wifi...)"

@stephanepechard
yeah you're right

@zealot128
because the user does not know what a "Service" means in this context

@stephanepechard
true
I open an issue for it

Should handle 301 redirection

When configured with a path not ending with a slash , eg: example.com/photobackup , my server response is a redirection to example.com/photobackup/
The expected response from the client should be to resend the request to the redirected url, but it does not.

Show notification only when something is wrong

When everything works there is no need to bother a user with notifications. Show notifications only when something is really wrong.

Examples:

  • Photos successfully uploaded -> no notification.
  • Phone has no connectivity, photos are enqueued for upload -> no notification.
  • Connectivity is available, but server is not responding -> try again silently and notify when it fails few times in a row.
  • There was errors, but now it looks ok -> remove old notification, no need to disturb the user.
  • Connection to server is ok, but server returns garbage -> warn user about bad setup.
  • Connectivity available, but upload failed due to lost connection -> no notification, just try again later.

Chunked upload

There are two reasons for uploading a file in chunks:

  1. File upload may get interrupted so it is nice to continue when it ended
  2. File upload size is often limited to few megabytes so this would avoid this limitation and would work for any file size (videos).

Idea is to send file in chunks of some reasonable size, one chunk per http request. Once all chunks are transfered, the completed file is renamed to original name.

Basically the one thing to add is offset and length of the chunk and seek before writing. A hash of the whole file would be nice to check to be sure no chunk is missing.

Handling of already uploaded images (status code 409)

According to the API spec, the server should respond with a 409 conflict status code, if an image is already uploaded.
Unfortunately, there is no handling code for that case at the moment, so that images will always stay as "error"

Maybe it is possible to change in https://github.com/PhotoBackup/client-android/blob/master/src/fr/s13d/photobackup/PBMediaSender.java#L168 and check for that error code? In that case, maybe handling the upload as "success" would be a good option.
What do you think?

Filter the Upload journal

This is a feature request.

It would be cool, if its possible to use the legend"(green) Backed up (orange) Waiting (rad) Error" to filter the list by pressing those categories. This way it would be easier to inspect, which uploads failed and similarly.

Not functioning properly on Android 6

On Android 6 (Marshmallow), the service starts and the test to the server is ok, but the upload journal is not accessible after launch and taking a picture does not trigger the service.

Add a state to handle properly "newly taken" and "all" pictures

The "newly taken" option only sends pictures that have been taken in the last 60 seconds.
This is nice but clumsy, as it does not retry a bit later, as it was before. In case of poor connectivity or any condition that limit pictures sending, this is probably not what the user wants.

The proposal would be to introduce a new state, say "Archived", which would be set on all pictures when "newly taken" option is selected, but newly taken pictures would get the classical "Waiting" state, hence they would be sent again at retry.

The "Pictures to upload" option would toggle pictures between "Archived" and "Waiting" states.

Not backing up video

Checking out the project and looking for something to upload videos and pictures as I take them. Any reason video backup isn't supported? I consider my videos as important as my photos :)

Manual backup does not honor journal picture

When I do a manual backup of a picture in the upload journal, the sent picture seems to be another than the selected one. At least, the thumbnail in the notification area is not the right one and the log indicates the wrong image path.
It seems that the index of the picture taken is not refreshed after a state selection...

Support self-signed certificates

I put an nginx in front of the server with a self signed certificate. I'm getting the following message in the android client:

Server test failed, please verify your configuration. - (java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)

I'm running a local server on an internal IP, not exposed to the internet, so can't get a LetsEncrypt cert.

Upload fails when device screen black out

Strangely, when the screen of my phone fade to black, the current upload fails.
It just requires to manually force the upload of the failed attempt to resume the upload queue, until the next fade to black.
The server does not spit any specific insult, just the usual 200

Handle 409 properly

As of version 0.8, PB shows an error for any 409 status received. This status code indicates that the picture has already been uploaded on the server, and therefore the server will not save it again.
It should then not be considered as an error in the client, but as a retry of picture successfully uploaded already.

Android Client V0.8.0 refuses to upload image

Finally got time to give this a go. I have setup both the go and python version of the sever and having issues communicating with the client.

I have a setup like so:
Client -> LAN -> Nginx -> Python or Go Server

Since I have a background in python I decided to starting debugging it. I decided to use Werkzeug debugging middleware and start following the different calls to the server. So far the only calls that the Android client is sending is just the POST to /test. Which the app says "Server configuration is valid, great!".

From there I can confirm the client attempts to upload an image but fails giving no error. I do not see any traffic on the server. I can manually post to the server with success

$ http -f post http://starbuck/ password='REDACTED' filesize=18709 upfile@/tmp/blah.png

This results in a 200 and image being written to disk. When I try again with the client I get this this

127.0.0.1 - - [31/Dec/2015 00:32:25] "POST / HTTP/1.0" 200 0  <--- My manual post via httpie
127.0.0.1 - - [31/Dec/2015 00:38:23] "POST /test HTTP/1.0" 200 0  <--- Turning on the client service

And no more requests when I take another image via the client.

I have also tried the python-client and it works great:

$ ./photobackup.py upload http://starbuck/ /tmp/blah.png
The server password: 
Request was successful!

On the Android client I have the server set to http://starbuck/, entered my server password and do not have HTTP Auth enabled. Is there something I am missing?

Adding UserAgent to http-client

Right now, the http request does not use a UserAgent.

Maybe we can add a UserAgent header like "PhotoBackup Android VERSION" to the HTTP request? That would make it easier to distinguish the requests from stuff like bots/crawler or (in my case) manual uploads with the browser.

Async-http seems to have a Method on AsyncHttpClient:

https://github.com/loopj/android-async-http/blob/9c7b6d41e3b84a5d62dfc914c29536708fc7dcdb/library/src/main/java/com/loopj/android/http/AsyncHttpClient.java#L640

So somewhere in the PBMediaSender constructor a client.setUserAgent().

other backends?

Maybe photos (and videos in the future?) could be uploaded to an owncloud host or an sftp server?

HTTP auth fails

While it was fixed in 0.8, http auth fails again since 0.9 as reported in #15
Without http auth, everything runs fine.

Maybe unrelated, but I noticed in the logcat that a method can not be found:

I/ActivityManager( 1783): Start proc fr.s13d.photobackup.debug for activity fr.s13d.photobackup.debug/fr.s13d.photobackup.PBActivity: pid=25942 uid=10073 gids={50073, 3003, 1028}
W/XPrivacy(25942): Hooking package=fr.s13d.photobackup.debug
D/PBApplication(25942): PREF_SERVER_URL<String> = https://example.com/photobackup/index.php
I/dalvikvm(25942): Could not find method android.app.Activity.onRequestPermissionsResult, referenced from method fr.s13d.photobackup.PBActivity.onRequestPermissionsResult
I/dalvikvm(25942): Could not find method fr.s13d.photobackup.preferences.PBPreferenceFragment.getContext, referenced from method fr.s13d.photobackup.preferences.PBPreferenceFragment.checkPermissions
W/dalvikvm(25942): VFY: unable to resolve virtual method 18070: Lfr/s13d/photobackup/preferences/PBPreferenceFragment;.getContext ()Landroid/content/Context;
I/ActivityManager( 1783): Displayed fr.s13d.photobackup.debug/fr.s13d.photobackup.PBActivity: +1s886ms
I/PBMediaSender(25942): Initiating test call to https://example.com/photobackup/index.php/test

Thanks for looking into this issue

The network choosing UI is not self explanatory.

“Used network” doesn’t make sense as a checkbox label, I feel. I had to toggle it a view times to actually understand what it was meant to do. Maybe calling it “Back-up on Wi-Fi only” would make more sense and instantly describes what the checkbox does?

I took a look at some other apps on my phone and saw that most of them handle this is different ways. But never with a checkbox, as a checkbox represents an on/off state and not a choice. WhatsApp lets me configure what it downloads per connection (separate settings for mobile, Wi-Fi, and roaming), Flickr’s Auto-Uploadr (not a typo) displays radio buttons to make it clear my choice is between “Wi-Fi only” and “Mobile/Wi-Fi”.

Would love to see this part of the interface become more self explanatory!

Screenshots showing WhatsApp’s and Flickr’s network settings UI.

Cannot select folders for sync before enabling the service

If I enable the service before limiting the folders to sync, all images get enqueued and uploaded anyway. The list must be accessible before enabling the sync and once the list is changed, the queue should be repopulated and filtered using the new rules.

Support for HTTP auth

I always protect my self hosted services behind an HTTP auth.
While the server does not support HTTP authentication for now, that would be nice if the android client could add support for HTTP auth.
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.