Giter Club home page Giter Club logo

Comments (6)

cassdeckard avatar cassdeckard commented on September 2, 2024

I'm not sure about the button appearing without access to Anki, but I can reproduce a crash by:

  1. Long press AnkiDroid app icon and select "App Info"
  2. Open "Permissions", disable "Storage"
  3. Open Wanicchou and hit the Anki "send" button

from wanicchou.

cassdeckard avatar cassdeckard commented on September 2, 2024

This actually happens in AnkiDroid's API sample app too so I opened a similar issue there: ankidroid/apisample#10

One workaround would be to catch the IllegalStateException and display an informative message to the user.

from wanicchou.

Limegrass avatar Limegrass commented on September 2, 2024

@mattdeckard
Thanks for the great investigative work. It looks like AnkiDroid itself is not functional without the storage permission since it defaults to a save location where it is required, but it would definitely be nice to have an API call available that returns whether the storage permission is granted to Anki and/or an api call that request storage permission on the behalf of AnkiDroid if it doesn't have it. I'd prefer that over adding error handling if possible.

If you have more time on your hands, you could submit an issue to the AnkiDroid project to add such an API call, or even add it yourself. Otherwise, I can add the API calls and submit a pull request when I finish up re-architecturing Wanicchou itself. Though there's room for debate on whether it should even exist if AnkiDroid is not functional without it, so who knows if it'll get accepted.

The button appearing issue was a result from an accidental commit when I was testing and rushing to get this out, since I was anticipated not having time to work on it soon when I released it. Luckily I have the time again, and it's resolved in the typical case (where the user grants AnkiDroid storage permission.) in a commit to the 1.0.2 branch, but it'll still be a just bit more until I'm ready to release that version due to rearchitecturing.

from wanicchou.

cassdeckard avatar cassdeckard commented on September 2, 2024

Sure thing! Thank you for making this app. I've found it so useful, it's become my main method of adding cards to my Japanese deck. I used to use Aedict3 to add them from JMDict entries and then manually replaced the English definitions with ones from Sanseido using AnkiDroid's card editor. So you can imagine how much time this app has saved me! 😄

I added an issue here

I'd be happy to work on the PR too but I'm going to try to wait until that issue gets some discussion cause I'm not sure which route the AnkiDroid maintainers will want to go.

from wanicchou.

Limegrass avatar Limegrass commented on September 2, 2024

Glad to hear it! That's definitely the right route in the API case.

But, really. You have no idea how happy knowing someone else actually gets use from the app. Despite the fact that a lot of my dev has been focused on self-satisfaction... Definitely more feature focused soon(tm) though. Probably additional sources and send-to Wanicchou (for direct searching of highlighted text) after things are cleaned up.

from wanicchou.

Limegrass avatar Limegrass commented on September 2, 2024

@mattdeckard
Once again, thank you for the research.
I added a check and message as suggested.
It completely slipped me to just check their permissions with Android's PackageManager, and they do conveniently provide their package name to check.

With that said, it would probably help a lot to have the apisample updated so other developers know how to handle the issue at least.
I personally would still appreciate an API method for checking API availability and Storage permission (or both as a combination and being encompassed by a method like isApiAvailable from the apisample), but we'll see how they feel about it (eventually). Feels a little silly to me to expose the app's package name in an API method and forcing every developer to write the code to perform the same two checks.

from wanicchou.

Related Issues (20)

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.