• Source code

    Last.fm for Android's source code is available under the terms of the GNU General Public License version 3. The source code can be downloaded from our Github repository.

    Building the source requires a Last.fm API key, and streaming radio using your key will require a paid Last.fm subscription.

    For more information / help with building the source, see the github wiki or join us on IRC in #android on irc.last.fm.

    • rfruth11 sa...
    • Användare
    • 10 mar 2010, 04:12
    Thanks !

  • hi
    i want to compile the last.fm source code.I have downloaded this tar c99koder-lastfm-android-3b165f0.tar.gz
    But this application is not getting compiled on android emulator.
    It is giving erros like "R cannot be resolved" .
    The gen folder is empty.
    Can you please help me compiling this applcation.
    I will be really gratefu to you.

    • Monban sa...
    • Användare
    • 21 jun 2010, 15:23
    I notice you require a paid account to stream music using a client you've built from source code, does a paid last.fm subscription give one any kind of priority in streaming? I am looking for a workaround to the "playback stops after a few songs" bug.

  • That's correct, third party API keys require a paid subscription to stream. Our streamers don't prioritize subscribers over non-subscribers, we have enough capacity to stream to all users equally.

  • android 1.6

    Hey c99koder,
    is a tutorial existing for coding for android 1.6? if i see this right, its for 2.2 only?

  • Our app runs on Android 1.5 and up, however it requires the Android 2.2 SDK to build.

  • thanks (=
    sam helped me already yesterday in your android irc channel

  • Problem with building code

    I downloded c99koder-lastfm-android-RELEASE_1.6.5-0-g36d35ea.zip file. I tried to build in android sdk but i am getting below errors and i am not able to solve . Please help me.

    org.eclipse.core.runtime.CoreException: Must specify a URI scheme:_android_LastFmAPI/src
    at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
    at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:50)
    at org.eclipse.core.internal.filesystem.InternalFileSystemCore.getStore(InternalFileSystemCore.java:106)
    at org.eclipse.core.filesystem.EFS.getStore(EFS.java:350)
    at org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils.getFileStore(IDEResourceInfoUtils.java:204)
    at org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils.getFileInfo(IDEResourceInfoUtils.java:177)
    at org.eclipse.ui.internal.ide.LinkedResourceDecorator.decorate(LinkedResourceDecorator.java:94)
    at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
    at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
    at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
    at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
    at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

  • An error occurred while trying to play this track

    I used the latest version c99koder-lastfm-android-RELEASE_1.7.1-0-g73d8031.

    when i click the Top artists in last fm "An error occurred while trying to play this track. please try again shortly" this error will displayed. how can i listen to music?

    when i click the Radio tab in last fm "communication error:There was a problem communicating with the last fm servers.please try again shortly" this error will displayed. how can i listen to radio? pls help me. it's very urgent and important for me. thanks.........

  • The error message from the server should be displayed in the logcat output, but the most likely reason is that you're not a subscriber, and the radio API requires a subscription for 3rd party API keys. Also be aware that our radio API cannot be used in 3rd party mobile apps due to licensing agreements with the record labels.

  • Thanks for your reply. This is the logcat output errors. what can i do?

    12-21 10:51:23.131: ERROR/ActivityManager(58): ANR in fm.last.android (fm.last.android/.activity.Profile)
    12-21 10:51:23.131: ERROR/ActivityManager(58): Reason: keyDispatchingTimedOut
    12-21 10:51:23.131: ERROR/ActivityManager(58): Load: 1.35 / 0.52 / 0.46
    12-21 10:51:23.131: ERROR/ActivityManager(58): CPU usage from 19408ms to 396ms ago:
    12-21 10:51:23.131: ERROR/ActivityManager(58): system_server: 29% = 18% user + 10% kernel / faults: 245 minor 12 major
    12-21 10:51:23.131: ERROR/ActivityManager(58): fm.last.android: 20% = 11% user + 9% kernel / faults: 121 minor 5 major
    12-21 10:51:23.131: ERROR/ActivityManager(58): kswapd0: 19% = 0% user + 19% kernel
    12-21 10:51:23.131: ERROR/ActivityManager(58): ronsoft.openwnn: 11% = 9% user + 1% kernel / faults: 129 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): adbd: 5% = 0% user + 4% kernel / faults: 34 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): m.android.phone: 2% = 1% user + 0% kernel / faults: 122 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): qemud: 0% = 0% user + 0% kernel
    12-21 10:51:23.131: ERROR/ActivityManager(58): events/0: 0% = 0% user + 0% kernel
    12-21 10:51:23.131: ERROR/ActivityManager(58): p.protectpronew: 0% = 0% user + 0% kernel / faults: 156 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): logcat: 0% = 0% user + 0% kernel
    12-21 10:51:23.131: ERROR/ActivityManager(58): com.svox.pico: 0% = 0% user + 0% kernel / faults: 1 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): logcat: 0% = 0% user + 0% kernel / faults: 1 minor
    12-21 10:51:23.131: ERROR/ActivityManager(58): +sh: 0% = 0% user + 0% kernel
    12-21 10:51:23.131: ERROR/ActivityManager(58): TOTAL: 93% = 41% user + 51% kernel + 0% irq + 0% softirq

    In error log shown this error:

    java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper$NonLibraryProjectOnlyFilter.accept(Unknown Source)
    at com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.getAndroidProjects(Unknown Source)
    at com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.getAndroidProjects(Unknown Source)
    at com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper.getAndroidProjects(Unknown Source)
    at com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab.checkParameters(Unknown Source)
    at com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab.access$0(Unknown Source)
    at com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab$WidgetListener.modifyText(Unknown Source)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:173)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
    at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2526)
    at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4297)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4163)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362)
    at org.eclipse.swt.widgets.Text.callWindowProc(Text.java:255)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251)
    at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
    at org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native Method)
    at org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3318)
    at org.eclipse.swt.widgets.Text.setText(Text.java:1961)
    at com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab.initializeFrom(Unknown Source)
    at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(AbstractLaunchConfigurationTabGroup.java:86)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.initializeFrom(LaunchConfigurationTabGroupWrapper.java:194)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(LaunchConfigurationTabGroupViewer.java:751)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$8.run(LaunchConfigurationTabGroupViewer.java:623)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:640)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput0(LaunchConfigurationTabGroupViewer.java:602)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:578)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:940)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$3.selectionChanged(LaunchConfigurationsDialog.java:559)
    at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:867)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:865)
    at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1700)
    at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1139)
    at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:392)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.doInitialTreeSelection(LaunchConfigurationsDialog.java:599)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.initializeContent(LaunchConfigurationsDialog.java:1077)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.createContents(LaunchConfigurationsDialog.java:440)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.create(LaunchConfigurationsDialog.java:371)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1133)
    at org.eclipse.debug.ui.DebugUITools$1.run(DebugUITools.java:398)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:406)
    at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:340)
    at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:81)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

  • None of that is relevant. Watch logcat when you get the error message after starting a station, it will output the error message sent by our servers.

  • This error is when i click the radio station it will appear in the logcat output:

    12-22 10:52:38.769: ERROR/fm.last.android.player(405): Tuning error: code 403 'Forbidden'

    These errors are when i click the profile->top artists->some tunes

    12-22 10:53:27.239: ERROR/fm.last.android.player(405): Tuning error: code 403 'Forbidden'
    12-22 10:53:38.477: ERROR/ImageDownloader(355): Failed to cache http://userserve-ak.last.fm/serve/64/7307649.jpg
    12-22 10:53:40.810: ERROR/ImageDownloader(355): Failed to cache http://userserve-ak.last.fm/serve/64/44009057.jpg

    pls help me sir..

  • As I stated previously, the radio API requires a paid subscription with 3rd party API keys. As your account does not have a paid subscription, you cannot tune a station with your API key.

  • OK i understand.
    thanks for your help and replies.
    thank you so much.

  • I'd also like to thank you because you have been a great help.

    • Pankaj11 sa...
    • Användare
    • 22 jan 2012, 06:13
    Thanks for the information regarding the android source . I am also using android and wants last.fm in my android operating system.

  • Really very helpful codes for Android users. I have still using Apple.

  • That is simply great work...I need this type of soource code ..Thanks for sharing..very helpful to me.

  • source code is the code which is scope to convert again in other code.

  • spam

    spam

    Redigerad av Babs_05 den 21 mar 2013, 16:45
  • This source code really helps and also bit difficult find these days. As an android user I’m pretty happy to find this area. Nice sharing though!

  • self-promo

    self-promo

    Xplicit
    Redigerad av Babs_05 den 17 apr 2013, 15:54
  • Reg: A cool idea

    Is there a way to populate songs from my Last.fm playlist to my android application? Thanks

Anonyma användare kan inte skriva inlägg. Vänligen logga in eller skapa ett konto för att göra inlägg i forumen.