 |
BOOK: Professional Android 2 Application Development  | This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional Android 2 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
|
|
|
|

March 4th, 2010, 02:25 AM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Needed imports for Chapter 2 To-Do List Example
Not sure why the book failed to mention the proper imports needed for the chapter 2 to-do list example to compile correctly. If you're entering the code manually (this chpt. 2 to-do list example code is not available for download), add the following import statements or simply apply the control+shift+o import shortcut in eclipse.
import java.util.ArrayList;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
Programming Android doesn't have to be like a raging hemorrhoid...
Last edited by alex_harding; March 4th, 2010 at 12:15 PM..
|
|

March 6th, 2010, 12:20 PM
|
 |
Wrox Author
|
|
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
|
|
Hi Alex,
Thanks for contributing the required imports for the Chapter 2 Todo List example. You may have posted this before I posted the code samples online, but the full code for this example (and all the others) should be available from here: http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html
If that's not the case, please let me know!
The reason I didn't include all the import statements for each example is to try and keep the code as concise as possible. As a 'Professional' title it assumes a certain level of knowledge and experience - in particular I'm hoping that most people using the book know how to use the shortcut you specified to add any required imports.
You make a fair point though - for the next revision I'll explicitly mention the shortcut to try and make peoples lives a little easier.
Thanks for the feedback!
|
|

March 7th, 2010, 09:36 AM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by alex_harding
Not sure why the book failed to mention the proper imports needed for the chapter 2 to-do list example to compile correctly. If you're entering the code manually (this chpt. 2 to-do list example code is not available for download), add the following import statements or simply apply the control+shift+o import shortcut in eclipse.
import java.util.ArrayList;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
Programming Android doesn't have to be like a raging hemorrhoid...
|
If you are doing this by hand, you will also need:
import android.os.Bundle;
This is used in your public void onCreate(Bundle savedInstanceState) method. Like the author mentioned, Eclipse will do this for you.
|
|

March 9th, 2010, 02:35 PM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Reto!
Wow, I do appreciate an author that supports the book's user base by being an active and timely participant in these forums. Kudos to you Reto.
Given that the content of this "Professional" book focuses primarily on exploring android-specific functionality available within the packages of the Android SDK, I guess I fail to understand how readers of different development backgrounds would know or "hope" to know what packages to import for the android-specific View objects introduced the Chapter 2 example code. Why have Eclipse bark at you so early on when in later chapters it appears you do a good job in the text to introduce the packages you need to support the added functionality of the To-Do example?
|
|

March 21st, 2010, 02:48 AM
|
|
Registered User
|
|
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Regarding: "As a 'Professional' title it assumes a certain level of knowledge and experience - in particular I'm hoping that most people using the book know how to use the shortcut you specified to add any required imports."
I am a long term Windows C++ programmer, but new to Android, and therefore Java/Eclipse. So, I agree with other comments; a quick into to Java/Android/Eclipse (or reference section in the back?) would save a lot of grief for those of us coming from different dev systems. Great book, thanks!
P.S. Do you have a recomendation for a book to help C++ developers get started in this environment?
|
|

March 21st, 2010, 07:18 AM
|
 |
Wrox Author
|
|
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
|
|
It's a good point, and something I definitely intend to rectify in the next edition. It seems a couple of pages introducing Eclipse would be extremely useful. Thanks for the feedback!
|
|

June 12th, 2010, 08:49 PM
|
|
Registered User
|
|
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Reto,
Take a look at Jeff LaMarche/Dave Mark iPhone 3 Development book. They always provided the necessary imports in the text code (they had a couple of mistakes along the way)
If your book is targeting beginners then its important to provide the necessary detail so the program will run correctly as entered from the text without relying on the source code.
I have some experience with iPhone development and Java and Eclipse helped me determine what was wrong right away. A less experienced programmer could waste alot of time, which would increase the chances of your book ending up in the trash!
Thanks,
|
|

September 19th, 2010, 07:57 PM
|
|
Registered User
|
|
Join Date: Sep 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I needed this one
Thanks to everyone for jumping in here. I tried the code twice, but did not know to import these functions.
Also a professional, use Ruby quite a bit, but am relatively new to Java. This was a big help.
|
|

March 11th, 2011, 04:10 PM
|
|
Registered User
|
|
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Version Depenant ?
I have all the right imports showing but have errors on every line of my todo list project from chapter 2. I am running Android 2.1 update. Is this incompatible wit hthe instructions in the book which qare for 2.0 ?
|
|

March 12th, 2011, 08:29 AM
|
|
Registered User
|
|
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Android API
Hi, [email protected].
Yes some android api's are version dependent, the best solution is to develop the android application for basic version, if you are looking for wide use of your app on any android phone, since there is a upward compatibility. If you get stuck in - what import statements to use, then you can write the entire code first and then make use of eclipse feature(if your using it) of auto-importing the packages by pressing Ctrl+O.
If you still find any problems in todo program, then use Android API 2.2 - the one i used for running my programs. And one more thing the variable names used in main.xml and in your java program has to be same. I hope this helps.
|
|
 |