4

I'm trying to make last.fm API call from android application using this package: http://www.u-mass.de/lastfm

From simple java command line program, it works, but not in android application. Using windows and Eclipse

Code itself is very easy:

 Artist artist = Artist.getInfo("Depeche Mode", "my_key");

I have set internet permission in android manifest

 <uses-permission android:name="android.permission.INTERNET"></uses-permission> 

After call I end up here, where it prints "caching failed." http://code.google.com/p/lastfm-java/source/browse/trunk/src/de/umass/lastfm/Caller.java?spec=svn173&r=173

response code there is -1

int responseCode = urlConnection.getResponseCode();

Any ideas what I'm doing wrong?

marko
  • 61
  • 2
  • 9
  • It's open-source. Link the source code in Eclipse and go in debug mode. – rds Dec 08 '11 at 22:45
  • Well that's your problem trying to get info on Depeche Mode, no wonder why its crashing...lol – JPM Dec 09 '11 at 16:46

1 Answers1

3

I was facing the same problem. Its a reported bug.

Solution I found was this : Just add this line somewhere in your code that will get run prior to calling any of the api methods: Caller.getInstance().setCache(null);

Note: this will disable Caching..

for more info check this link

Gaurav
  • 1,534
  • 2
  • 14
  • 23