Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 10th, 2012, 05:20 AM
Authorized User
Points: 208, Level: 4
Points: 208, Level: 4 Points: 208, Level: 4 Points: 208, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default Unable to Access web

String https_url = "http://www.google.com/";
URL url;

try {

url = new URL(https_url);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
int responsecode = con.getResponseCode();

} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
in getresponsecode line gives error.

How can Solve this?
Reply With Quote
  #2 (permalink)  
Old May 17th, 2012, 12:54 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to Access web Reply to Thread

Try these lines before int responsecode = con.getResponseCode();

Code:
con.setRequestMethod("GET");
con.connect();
Also check if you have added the following line to your Manifest file
Code:
<uses-permission android:name="android.permission.INTERNET"> 
    </uses-permission>
Best of luck!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to connect web server arnab-jit ASP.NET 3.5 Professionals 0 January 24th, 2011 10:38 AM
UNABLE TO PUBLISH WEB SITE JORGEMAL Visual Studio 2005 0 April 2nd, 2008 06:09 PM
Unable to get project file from web server hits_2006 BOOK: ASP.NET Website Programming Problem-Design-Solution 4 May 29th, 2007 09:39 PM
Unable to complete web request. Web Exception erro shazza Biztalk 0 October 27th, 2006 06:43 PM
Unable to use the DLL in C# in Web application. rsaluja C# 0 September 27th, 2003 11:56 PM



All times are GMT -4. The time now is 04:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.