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

Port to Android #356

Open
nicolas-raoul opened this issue Apr 24, 2018 · 9 comments
Open

Port to Android #356

nicolas-raoul opened this issue Apr 24, 2018 · 9 comments

Comments

@nicolas-raoul
Copy link

nicolas-raoul commented Apr 24, 2018

As a developer of the Commons Android app, I would like to use a Java library to add P18 (image) statements from the app (the app directs the user to nearby points of interest missing a P18 to take pictures of them).

It would be great if there were an Android-compatible small library that allowed that.
If there is already one that I have missed, please let me know, thanks :-)

@Tpt
Copy link
Collaborator

Tpt commented Apr 24, 2018

It would be great indeed to make WikidataToolkit work with Android. I am not much familiar with it. It would be amazing if you could do a pull request for this.

@Tpt
Copy link
Collaborator

Tpt commented Aug 2, 2018

The new 0.9.0 release should work with Android. @nicolas-raoul If you have some time may you test?

@maskaravivek
Copy link

@Tpt Is there any documentation to easily get started on it :)

@Tpt
Copy link
Collaborator

Tpt commented Aug 3, 2018

@maskaravivek The documentation is here with links to example: https://www.mediawiki.org/wiki/Wikidata_Toolkit

Feel free to ask anything you need :-)

@Tpt
Copy link
Collaborator

Tpt commented Aug 3, 2018

About the WikidataToolkit dependencies: we could definitely consider to move from one JSON deserialization library or HTTP client to an other if it makes the Android use case much more appealing.

@mikeklein
Copy link

mikeklein commented Jun 10, 2020

A little late to the party here...but I am seeing failure on Android whereas toolkit works fine under Spring.

Am receiving null for a well known QID (any qid actually) with following code:

    WikibaseDataFetcher wbdf = getWikibaseDataFetcher("en");
    EntityDocument edoc = wbdf.getEntityDocument(qid);

The QID is 26303...Thales a pre-socratic philosopher. Any ideas of why it is failing?

@Tpt
Copy link
Collaborator

Tpt commented Jun 10, 2020

@mikeklein Hi! Sorry for the problem. It's strange. If the API call where failing (no network, invalid host...), the code would have returned an exception instead. Are you sure that your qid is valid and you are reaching Wikidata (and not test Wikidata, Commons...)? It's hard to get a good understanding of what your code is doing from just two lines of code.

@wetneb
Copy link
Member

wetneb commented Jun 10, 2020

Just to be sure we are on the same page, the qid should be a string containing "Q36303", not "36303".

@mikeklein
Copy link

mikeklein commented Jun 10, 2020

Hello and thanks for quick response. I just found that the problem "magickally" went away an hour ago.

I did debug earlier and it was throwing following error btw:

Error when reading JSON for entity Q80612: com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of org.wikidata.wdtk.datamodel.implementation.TermImpl, problem: Exception from call site #30 bootstrap method
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: org.wikidata.wdtk.datamodel.implementation.ItemDocumentImpl["labels"]→java.util.LinkedHashMap["en"])

And yes the Q was part of string param value...thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants