1

error: NameResolutionFailure

public class JsonConverter
{       
    public async Task<string> GetStringbyJson(string link)
    {
        HttpClient client = new HttpClient ();
        HttpResponseMessage message = await client.GetAsync (link);
        return await message.Content.ReadAsStringAsync ();

    }
}

public async override void OnActivityCreated (Bundle savedInstanceState)
{
    base.OnActivityCreated (savedInstanceState);

    lst = View.FindViewById<ListView> (Resource.Id.lstHome);

    var result = await json.GetStringbyJson ("https://api-v2.soundcloud.com/explore/Popular+Music?tag=out-of-experiment&limit=30&linked_partitioning=1&client_id=9ac2b330e1b3&offset="+offset);
}

App just run when I removed "var result". I test app on device

1
  • What I get to see is there are two issues, 1. Check for all the permissions(INTERNET_PERMISSION) 2. If on a device /// check if wifi or mobile data is up and running properly. Commented Jan 10, 2017 at 10:36

1 Answer 1

2

The error is exactly what it says - it is unable to resolve the domain name you've given it.

The most likely cause is neglecting to enable INTERNET_PERMISSION in the app's manifest. But it could also be a general networking issue on the device. Can you resolve the domain from the device's browser?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.