TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak Verma
1.1k
682
42.3k
Web API Connection Failure In Xamarin Android
Apr 20 2018 6:34 AM
I have published my Web API on IIS and when I am consuming it in my Xamarin Android App, it is throwing error i.e., Connection Failure. I have written this code:-
public HotDogRepository()
{
Task.Run(() => this.LoadDataAsync(url)).Wait();
}
private async Task LoadDataAsync(string uri)
{
try
{
if (hotDogGroups != null)
{
string responseJsonString = null;
using (var httpClient = new HttpClient())
{
Task getResponse = httpClient.GetAsync(uri);
HttpResponseMessage response = await getResponse;
responseJsonString = response.Content.ReadAsStringAsync().Result;
hotDogGroups = JsonConvert.DeserializeObject >(responseJsonString);
}
}
}
catch (Exception ex)
{
throw;
}
}
Reply
Answers (
2
)
google map in android
How to set navigation title in other fragement in android.