ZotDroid - A Zotero Client for Android

1679111214
  • Hello everyone

    1.1.6 is released. This is a minor fix that improves on the speed issue and fixes a minor webdav bug I found. Hopefully this makes browsing collections a little faster for folks.

    I think it's safe to say that ZotDroid has changed *a lot* since I first envisioned it and I need to take some time to iron out the bugs, add a bit of polish and speed things up before I add new features. I had never considered groups at all, nor had I noticed the problems with the OAUTH. Both of these were major changes that caused a lot of problems. I'm hoping most of these are gone.

    Abstracts, paths and download-all-the-things are easy to conceive in code, but will need significant testing, and a lot of code to make them robust. I can very well imagine lots of partial or failed syncs due to network errors and all the rest. I'll need to add a lot of support for that.

    I had an awful lot of problems with the directory setting. So often Android would complain, or just not save once it had downloaded. I think I might take these checks out and leave it to the user. Regardless, I need to think a bit more about the approach.

    All of these things are do-able but I need a better approach going ahead. I think I'll start a 'closed beta' for these who want a say in the new features, before I put the actual releases out. In the meantime, I need to refactor the code base and add more tests to cover what we have.

    As to an iOS version - that's possibly even harder to do as Apple is even more walled off than Android! There's very little, if any, money in app development sadly. As a programmer and wannabie scientist with a thesis to finish, I can't devote as much time per week on ZotDroid as some folks might want. Which is a shame really, as I'm a huge Zotero fan.
  • Hi Ben,
    first of all: thank you for addressing the problem of using Zotero on a mobile device! I just bought my copy of ZotDroid (1.1.6) and I am happy to give feedback.

    Here is one: On my LG g5 phone with Android 7.0, I can sync my library, but when I try to download a *.pdf there is still the "Could not find file to write to..." error (same as a few posts back). Any ideas?

    best
    Peter
  • Thanks Piom

    It's becoming clear this is a major problem for a few folks. I've attempted to fix it with no success thus far. I *believe* it's a permissions error which I assumed I'd fixed (as it passes on all my simulations and devices).

    A few folks have asked for the downloads to replicate the directory structure of Zotero proper and I think that might be possible. I'm going to put out another update in the meantime, hopefully fixing this issue onces and for all.

    In the meantime, are you using personal webdav or zotero storage? Do you have a way of checking that the directory that Zotdroid writes to exists?

    Cheers
    B
  • Hi Ben,
    yes, I am using a private webdav storage. It is trying to save to (what I assume to be the default directory) /storage/emulated/0/Documents/ZotDroid which I checked exists.

    best
    peter
  • @OniDaito
    Hi Ben, just wanted to say that I think the latest ZotDroid 1.1.6 is an enormous improvement. The interface is amazingly responsive, and as asomebody who has been here since the beginning, I just wanted to say thank you, your hard work is really appreciated.
    I'd held off trying to set up webdav because of the problems I'd had with earlier versions, but I'm tempted to give it a go now.
    Regards, J
  • @OniDaito I am another galaxy phone user (galaxy S9) waiting for the problem with WebDav storage to be resolved. I appreciate what you are doing and I hope you can resolve this issue.
  • edited April 6, 2018
    Hello everyone

    1.1.7 is out now. There are two major changes.

    The first is that the download directory issue *should* be fixed. I've tested here on several emulators and real devices and it seems ok. It turns out some of the checks I make in order to see if a directory is world readable failed, even though they should have passed. I actually think this is a bug in the API, but for now I've removed it.

    The second change might cause some upset as well as cheers. For these of you who do the double sync with dropbox or whatever, I've changed *personal* webdav downloads to mirror the structure of the webdav server.

    So, if you are downloading to /storage/emulated/0/Documents/ZotDroid/attachments/ (which is the default) you'll see a load of files like FG1455A.zip etc When you click on an attachment it will unzip it to a temp directory called: /storage/emulated/0/Documents/ZotDroid/temp

    This needs to exist. If you only have internal storage then you might have a problem. The issue with internal storage is that it can't be shared with other applications like adobe reader and the like. This shouldn't affect folks I hope. I think these changes will make things better for folks.

    For these of you who have downloaded loads of pdf attachments already, I'm really sorry, but you'll need to download them again. It's annoying but theres no way around it. I think this is probably a better solution in the longer term - not one I had originally considered (I never saved the zips originally).

    If you like ZotDroid, do please leave a rating on the Google Play Store. It seems to help! :)
  • @OniDaito Got the update. I still get an error when I try to download "Error: /storage/emulated/0/Documents/ZotDroid/temp/filename.pdf". I uninstalled and reinstalled to make sure there is no issue with settings. Still get the same error. I also tried using my LG G4 and I get the same error message.

    On a side note I noticed if I try to set downloads to a bogus location there is a new error message "The download directory specified cannot be us... 213162404: test." This is better than before when there was no message if the directory was not chosen properly.
  • edited April 7, 2018
    @rowland.208 thanks for the update. This error is intensely annoying because saving a file is not hard, or rather, it shouldn't be.

    So its 1.1.7 you are using. Can you confirm that your username and userid (towards the bottom) is filled in correctly in the general settings box?

    Do you have way of viewing files on your device? Can you confirm that the 'temp' directory exists?

    Cheers
    B
  • @OniDaito Yup I can confirm most of that. The temp directory exists and the attachments directory exists. My library syncs. The webdav connection is successful. The error message reports the correct filename. Not sure what you mean by "confirm that userid is filled correctly." The username is correct. The userid field is filled out but I don't have anything to cross reference it with. I am guessing it is correct since the library syncs.


    Extra info:
    Phone: Galaxy S9
    Android version: 8.0.0
    Samsung experience version: 9.0
    ZotDroid version: 1.1.7
    PDF reader: EBookDroid
  • @rowland.208 Thanks for getting back. When you click the attachment, does it attempt to download it, i.e do you get a synchronizing message with a percentage that increases?

    In the attachment directory, do you see a number of zip files with an alphanumeric filename?

    Finally, the bit about the userid - it's usually just a number. So long as it isnt blank or says "this will be filled in upon login" then it should be fine.

    Cheers
    Ben
  • @OniDaito I get "synchronizing" and a spinning loading icon but no progress bar. The error message pops up within a second or two. The attachments folder is empty. I have tried downloading pdf and html attachments. Userid is not empty.
  • @rowland.208 thanks, that's some more to go on. Were you asked, upon reinstall and running for the first time, to give read /write permissions to ZotDroid? I've noticed that for some Android versions, one needs to ask permission before writing to areas such as "Documents".

    Actually, theres a thought. Just out of curioisty, if its not too much trouble, try specifying another directory, like downloads or similar? I'm wondering if Zotdroid has been sandboxed in some way, or if permissions to write to exerternal storage havent been granted.
  • edited April 8, 2018
    @OniDaito I changed the downloads directory from .../Documents/... to .../Downloads/.... Still get the error but the file path in the error message is .../Documents/ZotDroid/temp/filename.pdf not .../Downloads/.... I checked and the downloads directory setting is still set to .../Downloads/...
  • @rowland.208 this sounds very much like version 1.1.6, not 1.1.7. I noticed the lack of change in preferences but also it sounds like the failing checks are still in place. Does the about box say 1.1.7?
  • @OniDaito Yup. The about box says I have 1.1.7.
  • edited April 9, 2018
    @OniDaito thanks for the update. The changes to use zip files makes sense.

    But i have the problem now that ZotDroid downloads the same attachment again and again and doesn't recognise that it already has them. When i want to open a file that i downloaded earlier (and checked that the zip file is in the download folder), it downloads it again, and overwrites the old zip file. When I don't have a connection, it gives an error and doesn't try to access the existing file.

    I'm definitely on 1.1.7 and I set the download folder to /sdcard/ZotDroid/storage - does it perhaps only check the default directory?

    I also reset and synced the database, to make sure.
  • still can't download attachments from my webdav. Same error as rowland.208...
  • @piom @smatthie @rowland.208 thanks for the updates there.

    The double-download is very odd - certainly doesn't happen on the test rigs I have here. A few users have reported that the temp directory doesn't seem to work but the normal directory does (very odd). This is required as temporary 'unzipping' place for the attachments.

    I suspect this will require more testing, though it follows the official Google / Android guidelines for external directories. Once I've gotten some more thesis writing out of the way this week, I can take another look at it. It would be nice to get the basic downloads stable for all. It's quite frustrating as all my tests and simulations seem to pass, so I do wonder if there are hidden permissions that just aren't set.
  • edited April 10, 2018
    @OniDaito File handling in Android seems very tricky, some other apps are struggling too...

    Perhaps you can make a version that logs in more details which directories or files it is trying to access and if they exist? The error message is very vague.

    I tried setting the download directory to /storage/emulated/0/Download and /storage/emulated/0/Documents/ZotDroid but get the same result (download works fine but it downloads again every time), so I don't think it's a matter of any specific directory permission. The temp directory also exists and actually has the unzipped PDF in it from previous downloads.

    I also noticed that the little circle next to the filename remains grey after download - I think in an earlier version it turned green when the file was available. So perhaps it doesn't check properly if the zip file exists.

    When I turn off the Wifi connection, the error is "Error: /storage/emulated/0/Documents/ZotDroid/temp/filename.pdf". But this is clearly not where the problem is (the file exists and everything works with wifi). I would have expected an error about not being able to download the zip file.
  • Hello all
    1.1.8 should be out now, or very soon once the store catches up.

    @smatthie @rowland.208 @piom this update addresses the issues you've been having. The directories are now handled in a simpler manner.

    There should be a base directory. Within that, there is an attachments and temp dir. Temp is used to hold unzipped files. If you are using your own webdav, zip files appear in the attachments dir, and are unzipped into temp.

    If you use the basic zotero storage, pdf files are downloaded straight to your attachment directory. This will cause problems with files with the same name but how Zotero actually deals with that internally I don't know yet. Its on the list as a thing to add.

    Permissions were a thing - I believe it asks just once now, for permission to write/read to the Documents directory. By default we are going to external storage so if that isn't mounted for some reason, you'll get an error.

    I'm hoping this fix will make it work with the dropbox sync folks. I'd like to hear back from anybody who uses dropbox as their storage medium.

    Finally, I'll start looking into beta releases. Unless I can find a way to write many more tests that work with zotero credentials and what not, I can't really test everything. It really helps when users with different devices and versions can look at my app but it's no fun for these who really need it to work. I'm aware of that and I'll get to sorting my testing process out.

    Now, back to thesis writing! :)

    Cheers
  • edited April 10, 2018
    @OniDaito Thanks, that works now as expected! Good Work!
  • @smatthie thanks! I want ZotDroid to be genuinely useful for folks. I use it also, in research, but it's great to know what other folks might need. It's a professional product now, so it's important I get it right.

    I'm keen to hear about more suggestions for features and fixes, but what I suspect I'll do is work on the UX, testing procedures and code quality, whilst looking at the beta program. I'd prefer to put out new releases and features as beta releases for people to try, before I alter the main branch.

    I know a few folk have asked for a total download-all-attachments-sync option and that will be next, once I've ironed out these other points.
  • edited April 11, 2018
    Hi, just downloaded 1.18, still cannot download attachment from personal webdav.

    webdav connection pass!
    rest and sync 100% finished.
    The entire file list can be viewed, only the button next to attachments still is grey.
    After the button is pressed, showing error mesg as follows:
    Error: Could not fine file to write to. Consider changing your Downloads directory to a publicly accessible folder.:/storage/emulated/0/Documents/ZotDroid/attachments/xxxxx.pdf

    I tried to change the Download directory to the sd card, instead of the internal storage, but a green warning winodow saying "The download directory specified cannot be us... 2121624040:/storage/OAB2-1EEB/Download/ZotDroid".

    I am sure I have granted full writing permissions to ZotDroid...

    Good luck debugging. Thanks.

    --More inputs:
    I suspect the green window could due to the ZotDroid directory is not created. So I change the download directory to "/storage/OAB2-1EEB/Download", and reset. The green warning window is gone. But same error msg pops out.

    Error: Could not fine file to write to. Consider changing your Downloads directory to a publicly accessible folder.
    :/storage/0AB21EE8/Download/attachments/xxxxx.pdf

  • Hi,
    same here:
    "Error: Could not fine file to write to. Consider changing your Downloads directory to a publicly accessible folder.:/storage/emulated/0/Documents/ZotDroid/attachments/[filename].pdf". I don't have an SD card, so can't test this.
  • @piom @zhanguan05 thanks for the feedback. Are you using personal webdav or zotero storage?
  • personal webdav.
  • @piom - thanks for that. Is the selector in the webdav settings set to 'on'?
  • @piom @zhanghuan05 I think I've found an issue.

    Yet again, it is related to Android Versions. Later releases deal with external storage directories differently. I dont think the current advice from Google seems to apply to older Androids. Im currently trying to get 5.1.1 to work and I've hit your problem.

    External storage doesnt necessarily mean an SD card, oddly enough. It's a holdover from the old days when it used to be. Nowadays it could be held internally but is still classed as 'public' space.

    I'll keep on investigating. I'll get a beta release out today.
Sign In or Register to comment.