-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add stats provider #5057
Add stats provider #5057
Conversation
a087052
to
cb0a64a
Compare
Also self-reviewed and polished this one. Best to review it commit-by-commit otherwise my extraction of ProviderUtils makes things terrible to review, but if I didn't extract that I would have duplicated a lot of security logic in StatsProvider. This affects the API so I will not merge this without review, but I think it's ready to go. |
342fee6
to
5f39c7b
Compare
Because Stats is in libanki it mostly got special dispensation vs adaptation
Perhaps you're not understanding the purpose of this contract file, since you're not using it in the sample project you made... The idea is that users copy the contract file and use that instead of hardcoding paths. Ideally it should be part of a higher level API like I mentioned in that PR. |
Okay, so something like AddContentApi.java, how do you manage development across api and apisample? By which I mean how do you do a local "api build" such that apisample can consume it with gradle dependencies and everything? Just a gradle target and a mavenLocal() repo add in apisasmple? I only see a jar dumped into a sub-directory in the api build.gradle so I'm not sure how to iterate over on the apisample side For google-analytics-java I have a local deploy (provided by maven as That would make working on the contract file and API a lot more friendly. As for the UI, yeah it's tacked on :-). Here I figured I'd get extra credit for at least exercising the API (and finding a bug! and realizing permissions were unhandled in StatsProvider) and I get dinged on bad UX. I mean, you're right, but my inner child is going "do I have to..." |
apisample is a totally different project from the main AnkiDroid project, so I release a new version of the API to bintray before doing work there.
If you just want to test that your code is working in the content provider, then your approach here is fine, in which case no need to open a PR. If you want to make a fully featured stats API and for developers to be able to easily use it correctly by giving them sample code, then yes, you need to think about UX as well. |
OK - I think can go for full-featured. Let me add some tooling across the projects to do what I mentioned (local maven install available on one side, dep resolution consuming local on the other) so the iteration isn't painful because no, I have no experience in contract files, and little experience in APIs - so I iterate a lot. I'll ping you again if I have questions or when they're in shape |
This one doesn't necessarily hold up 2.9 because it doesn't involve strings - we can get betas out prior to completing it but I'm still worried about 2.9 timing - I'd rather see it happen sooner than later so I'm moving milestones |
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
Pull Request template
Purpose / Description
Implement a stats provider for AnkiDroid, based on work by @MarcinMoskala
Fixes
Approach
Original PR has info: #4881
Contract and Provider were done with re-use of logic from card provider
I added a read-only permission so people didn't have to grant full access
How Has This Been Tested?
I added a demonstration to the apisample, and it's a good thing - the query didn't work without a quick fix - ankidroid/apisample#9
Checklist
Please, go through these checks before submitting the PR.
if
statements)