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
Sasi Reddy
NA
346
225.8k
How to call WebAPI from android app?
Feb 5 2015 12:23 AM
I have android app,here i am passing two parameters to webapi.I also have webapi which is taking that two parameters and it is running on localhost.
How to call that webapi from android app?..
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://localhost:23941/api/Default1/Create");
HttpHost proxy = new HttpHost("192.168.1.16", 8080);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
httpPost.setEntity(new UrlEncodedFormEntity(args));
httpPost.setHeader("Content-type", "application/json");
HttpResponse response = httpClient.execute(httpPost);
Like above i am calling webapi but it is not hitting the webapi(kept breakpoint in webapi).
Reply
Answers (
1
)
Invalid use of SingleClientConnManager:
android with sqlite