Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2011, 08:55 PM
Registered User
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 286, downloading s/binary/images

Hello, I cannot get this code to run from page 287, I've all the necessary coding, went over it three times, each section is correct. Logcat is showing a nullpoint exception.....
 
Old December 20th, 2011, 09:05 PM
Registered User
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So I believe I already found an issue with this code... int response is -1, and we're testing to see if this response == HttpURLConnection.HTTP_OK.

HttpURLConnection.HTTP_OK , from the android reference guide is:

Numeric status code, 200: OK
Constant Value: 200 (0x000000c8)


I removed this if/else entirely, still getting issues
 
Old December 20th, 2011, 09:10 PM
Registered User
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Getting this error: could not disable core file generation for pid 24563: operation not permitted, been getting that the entire time..

with the HTTP_OK check removed, doesn;t look like get a null pointer in the logs anymore, getting a black screen with no image showing now..
 
Old December 23rd, 2011, 10:08 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default me too

Hi eoswins
First, about the response code. The -1 is a default (bad) value. It should be
set to a new value by the statement above it.
response = httpConn.getResponseCode();
If all is well, it should get the 'HttpURLConnection.HTTP_OK' value.

I am not sure what is causing the 'pid 24563' error. It sounds like there is something wrong in build.(?) Can you tell where in your program the error occurs?
Are you getting the screen with 'Networking' as a label?
Try setting some brakepoints an see how far it gets?

If it helps some my code is also not working. It tells me "Error connecting.".
And the exception says 'Unknown host' for 'www.mayoff.com' .
But I can enter the URL in the browser and it works.

Hope this helps
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
 
Old December 24th, 2011, 08:59 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default

Hi eoswins
If it helps some my code is also not working. It tells me "Error connecting.".
And the exception says 'Unknown host' for 'www.mayoff.com' .
But I can enter the URL in the browser and it works.


I fixed my problem. It seems that I messed up the "android.permission.INTERNET" statement in the manifest file. So if you see the "Error connecting." message and your are sure that the URL is correct, check the <uses-permission> statement in the manifest file.

Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
 
Old December 27th, 2011, 10:52 PM
Registered User
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cliff, so you are confirming the code in the book actually works?
 
Old December 28th, 2011, 07:53 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default

Hi All
Yup, it works.
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8 User Controls: Try It Out Pages 283-286 epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 October 11th, 2009 11:53 AM
Converting JPEG images into binary Bassaam .NET Framework 2.0 5 August 1st, 2006 02:38 PM
Downloading Images priti Classic ASP Components 10 October 27th, 2005 10:18 PM
Downloading Images priti VBScript 3 June 21st, 2005 02:08 AM
Downloading Binary file with web method syedjavid .NET Web Services 2 August 16th, 2004 08:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.