Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:40:24+00:00 2026-06-12T17:40:24+00:00

Im trying to make a request from last.fm where I will get similar artists

  • 0

Im trying to make a request from last.fm where I will get similar artists from the one I enter. I get this error: java.net.UnknownHostException: ws.audioscrabbler.com – why?
This is meant to be listed afterwards but somehow I dont think I get “into” their api. When I hit the button nothing happens, but in LogCat I get about 25 warnings. Maybe the reuest goes through but I dont display anything. When I tried this eample on a different site with different pi it worked.

// MAIN

    package com.example.eserviceapp;

import android.os.Bundle;
import android.app.Activity;
import java.net.URL;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

public class Eservice_main extends Activity {
    ArrayList<String> list = new ArrayList<String>();
    ArrayAdapter aa;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button enterButton = (Button) findViewById(R.id.enter);
        enterButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {

                list = new ArrayList<String>();
                EditText artistText = (EditText) findViewById(R.id.artisttext);
                String artistNWS = artistText.getText().toString().replace(' ', '+');
                String apiKey = "&api_key=b25b959554ed76058ac220b7b2e0a026";
                URL text;
                try {
                    text = new URL("http://ws.audioscrobbler.com/2.0/?method=artist.getSimilar&artist=cher&api_key=1e1f63e2c64fd7d8a7340cbbc3e365c3");

                    XmlPullParserFactory parserCreator = XmlPullParserFactory.newInstance();
                    XmlPullParser parser = parserCreator.newPullParser();
                    parser.setInput(text.openStream(), null);
                    int parserEvent = parser.getEventType();
                    String tagName;
                    int i = 0;
                    while (parserEvent != XmlPullParser.END_DOCUMENT) { 
                        switch (parserEvent) {
                        case XmlPullParser.START_TAG:

                            tagName = parser.getName();
                            System.out.println(tagName);
                            if (tagName.equals("name"))
                            {
                                list.add(parser.nextText());



                            }
                            break;
                        }
                        parserEvent = parser.next();

                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }

                aa = new ArrayAdapter(Eservice_main.this,
                        android.R.layout.simple_list_item_1, list);
                ListView lw = (ListView) findViewById(R.id.listView1);
                lw.setAdapter(aa);
            }

        });

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:40:26+00:00Added an answer on June 12, 2026 at 5:40 pm

    I get this error: java.net.UnknownHostException

    The above error occurs when you have not given the android.permission.INTERNET in your Manifest.xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a https get request from behind a squid proxy with
I'm trying to make this request to the RunKeeper API : GET /user HTTP/1.1
Am trying to make a get request from javascript, with a function called geturl.
I'm trying to make an SNMP v3 get request from a simply c program
Trying to make a cross protocol, same domain request from https to http. I
I am trying to make an ajax GET request to a WCF web service
I'm trying to make an HTTP Get request using JQuery, but I get an
I am trying to make a request to the yahoo wheather forcast like this
I'm trying to make a request using dojo.xhrGet to grab some XML data from
I'm trying to make a http request. The code looks like this: NSString *urlString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.