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

Can't create request on Android #3

Open
suicvne opened this issue Sep 10, 2015 · 3 comments
Open

Can't create request on Android #3

suicvne opened this issue Sep 10, 2015 · 3 comments

Comments

@suicvne
Copy link

suicvne commented Sep 10, 2015

For whatever reason, I'm unable to make any requests on Android. Logcat only shows that the request is being opened, but nothing else.

Upon importing the source into Android studio, I can trace it back as far as into the openPostConnection method. The part where the urlConnection's OutputStream is passed into the outputStream variable is never called, and stops after "urlConnection.setDoOutput(true);". However, if I set a System.out after urlConnection.setDoOutput(true), this is called. It just breaks off entirely after that, no exceptions seem to be thrown, and any of my code after my initial "User.getWeeklyAlbumChart" is not executed, completely broken off. I am unsure what is happening.

I came across this Stackoverflow question: http://stackoverflow.com/questions/8438415/last-fm-api-call-from-android-application
And tried setting cache to null as the answer suggested, but this had no effect on anything.

My code is simplistic enough code that doesn't require authentication of the user, just getting their top tracks for the week (Android port of my lastfm-collage-generator repository). Internet permission is declared in the manifest and my device is online.

Any idea as to what on earth could be going on? Any possible solutions?

Thanks

@jkovacs
Copy link
Owner

jkovacs commented Oct 9, 2015

Can you push your android port to github so I can take a look to troubleshoot this?

In any case, can you make sure this is not caused by the recent Last.fm site update (see here), e.g. by trying if some other API methods work or not?

@Riddim
Copy link

Riddim commented May 22, 2016

When I try to User.getWeeklyArtistChart(user, 10, key); on android this happens:

Caused by: de.umass.lastfm.CallException: Caching/Reloading failed
at de.umass.lastfm.Caller.call(Caller.java:246)
at de.umass.lastfm.Caller.call(Caller.java:189)
at de.umass.lastfm.Chart.getChart(Chart.java:103)
at de.umass.lastfm.Chart.getChart(Chart.java:80)
at de.umass.lastfm.User.getWeeklyArtistChart(User.java:244)
at de.umass.lastfm.User.getWeeklyArtistChart(User.java:240)

@nrmnrm
Copy link

nrmnrm commented Feb 11, 2017

Original issue is not an issue with this library. Problem is that Android does not allow network operations on UI thread. You have to move calls to the library into an asynctask.

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

4 participants