Wrox Programmer Forums
|
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 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 30th, 2008, 03:23 PM
Registered User
 
Join Date: Dec 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 2 -- To Do List -- import java.util.ArrayList?

Seems like I had to add import java.util.ArrayList; at the top of the ToDoList.java file because when I tried to run this it gave me an error, and Eclipse suggested importing this because of the use of new ArrayList<String>().

I checked the sample code from this site and it uses this import.

My question is, was that supposed to have been added automatically by Eclipse? If so, when the project was created, or when I typed in that line?

or, should this have been included in as a step in building out this example?

thanks
 
Old December 31st, 2008, 03:49 AM
Reto's Avatar
Wrox Author
 
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Quote:
Originally Posted by SteveOliverC View Post
My question is, was that supposed to have been added automatically by Eclipse? If so, when the project was created, or when I typed in that line?

or, should this have been included in as a step in building out this example?
To keep the code samples in the book as concise as possible I decided not to include the import statements as a step in most of the examples. Including steps to add each import as needed cluttered up the snippets and samples in a way that seemed to detract from what I was trying to show.

The 'suggestion' feature in Eclipse makes pulling in the required imports really quick and simple, so it felt like a good compromise.

So the behaviour you're seeing is as expected -- for most examples you'll probably want to use Eclipse's mechanism for adding the import statements as you go through each step.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
 
Old April 3rd, 2009, 02:50 PM
Registered User
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In training books & materials there always seems to be a gap bewteen the initial configuration of an environment and the daily coding ritual. I definitely find it frustrating when you do "exactly" what the text describes and you encounter unexpected red flags all over the IDE; it makes you feel like you're so off base that you have no idea what you're doing.

A little blurb somewhere would be nice, for sure. I'm glad I went ahead to compare the sample code as well, but it leaves you scratching your head saying "why does his look like that?" At any rate, enjoying the book so far, on to the next chapter!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
Chapter 2 - Import and Export Wizard example LaurieCSI BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 3 May 13th, 2008 05:17 AM
stsadm util restore exception 0x80070005 Raz Muhammad SharePoint Admin 0 July 10th, 2007 08:52 AM
problem with java.util.Date kanoorani Java Basics 1 April 20th, 2007 01:48 AM
Populating a drop down list from an ArrayList snejsnej ASP.NET 1.0 and 1.1 Basics 1 April 20th, 2006 11:14 AM





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