p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Android 4 Application Development (http://p2p.wrox.com/forumdisplay.php?f=674)
-   -   Chapter 1 Question Hello World (http://p2p.wrox.com/showthread.php?t=87998)

A725859 July 15th, 2012 04:44 AM

Chapter 1 Question Hello World
 
Since the release of the book eclipse version changed a lot
i can't even run the hello world program when i create a new project i asks me all the details i do it as it is
In the res/layout The .xml file has <RelativeLayout> Instead of <LinearLayout>
So The Code Given Generates Error Saying That "xml Document is not formatted correctly"
Kindly SOLVE My Problem

xcopy July 16th, 2012 06:22 PM

Agreed, lots of changes
 
Quote:

Originally Posted by A725859 (Post 285431)
Since the release of the book eclipse version changed a lot
i can't even run the hello world program when i create a new project i asks me all the details i do it as it is
In the res/layout The .xml file has <RelativeLayout> Instead of <LinearLayout>
So The Code Given Generates Error Saying That "xml Document is not formatted correctly"
Kindly SOLVE My Problem

I found the same thing and it's pretty frustrating when you can't even get the most basic things to work in a new book.

Regardless of the author's attempt to distance himself from any responsibility to his readers with questionable comments such as "just follow the instructions on the screen", I too would expect the author to provide some guidelines here as it is a beginning book.

You can, however, help solve a few of the problems by insuring that you:

a) Make sure you have the right SDKs installed in Eclipse. Go to Window -> Android SKD manager, and choose the levels you need/want (current is 4.1, but 4.0 and 4.03 are good for starters).

b) create AVDs that match the API level you want, and matching what you installed above.

c) create a new project (Android app project) and when the dialog box come up, make sure you target the Build SDK and minimum SDK for what you have installed. It's fine to uncheck the "custom launcher icon".

d) On the next screen (Create Activity), choose "BlankActivity".

e) On the next screen (New Blank Activity), leave everything at the default.

f) Click Finish

If you've done everything right, select the project and choose Run As --> Android application and it should work.

Don't worry about the relative (the new default layout) vs. linear layout for this example. Just see if you can get it to work first.

I created a linear layout too, but it's not necessary to get it to work. You can also download the author's code, and as long as you have the right AVD/SDK combinations installed, it should work (note, for me it's working on 4.03.

The application certainly doesn't do much so don't expect a lot. Also, be extremely patient with the AVD; it can take minutes for it to actually show up (at least on this i5 machine I'm using it can take that long).

Good luck!

idkau August 4th, 2012 03:40 AM

Also google training will show you to use LinearLayout. Just change the tag.

stormchaserJohn August 20th, 2012 07:44 PM

Disappointing
 
Even in the context of the fast-changing environment that is mobile development, the first chapter of what is considered to be an introductory book should not be so riddled with errors/omissions.

It is really bad form - even from a beginning Android developer's perspective - to drop text into the code without an accompanying string resource. It is irresponsible to encourage newcomers to the operating system to take such sloppy "short cuts".

Beginning Android has a long way to go before it becomes a book that I would recommend to anybody else.

xcopy August 21st, 2012 08:37 AM

Quote:

Originally Posted by stormchaserJohn (Post 286364)
Even in the context of the fast-changing environment that is mobile development, the first chapter of what is considered to be an introductory book should not be so riddled with errors/omissions.

It is really bad form - even from a beginning Android developer's perspective - to drop text into the code without an accompanying string resource. It is irresponsible to encourage newcomers to the operating system to take such sloppy "short cuts".

Beginning Android has a long way to go before it becomes a book that I would recommend to anybody else.


The author addresses the lack of proper string resources later in the book when he says he uses a fix-it-later-approach, meaning he cuts corners during development, and cleans up the warnings later in refactoring.

While cleaning up later is a valid approach, one or two sentences early on as to what he's doing and why he's doing it could go a long way to alleviating beginners concerns about the warnings they'll receive.

The gotchas in this book are not insignificant, and they will literally pop up every few pages.

Dawood nowrozi September 24th, 2012 09:15 AM

Installation problem
 
Hello
I'm facing problem with downloading software's of android development apps.At this stage I'm using the book reference for developing android apps is (Beginning Android 4 Application Development). I can not access the appropriate website which are mentioned in this book to download the relevant software's like:
1: Android SDK
2: Eclipse
3: Android Develpment tools

Can you please help me to find the new appropriate website to download these software's[:confused:]
Thank you
Dawood

xcopy September 24th, 2012 10:24 AM

http://www.oracle.com/technetwork/ja...ads/index.html

http://developer.android.com/sdk/index.html

http://www.eclipse.org/downloads/

http://developer.android.com/sdk/ins...lling-adt.html

Much of the basic information in this book is incorrect or not up to date so remember, Bing/Google is your friend.

sn0wman September 25th, 2012 01:47 PM

Start program from the Java activity?
 
Quote:

Originally Posted by A725859 (Post 285431)
Since the release of the book eclipse version changed a lot
i can't even run the hello world program when i create a new project i asks me all the details i do it as it is
In the res/layout The .xml file has <RelativeLayout> Instead of <LinearLayout>
So The Code Given Generates Error Saying That "xml Document is not formatted correctly"
Kindly SOLVE My Problem

I think I ran across a similar issue playing with the Android Developer's site tutorial when trying to 'Run As' from the layout XML file; I think it had to do with an Eclipse bug? Instead of running from the layout file, try clicking on HelloWorldActivity.java file (you should find it beneath "src" in Package Explorer) and then click 'Run As'. The author does something similar by running the application from the project name (see step #11 on page 25 of Chapter 1 (hard copy of book)).

weimenglee October 3rd, 2012 03:04 AM

Download the preconfigured Eclipse installation
 
Hi:
Due to the recent changes in the ADT and the Android SDK, a lot of images and project structure in Eclipse have changed. To help cope with the changes, I have prepared an Eclipse installation configured with the new ADT as well as the latest Android 4.1 SDK so that readers do not have to grapple with the details of the installation themselves.

Please follow the detailed instructions shown in this document: http://goo.gl/sbH2R.

Thank you.
Wei-Meng Lee

xcopy October 3rd, 2012 05:12 PM

I posted a reply to this update here.


http://p2p.wrox.com/book-beginning-a...tml#post287128



The update is missing several important things for beginners.


All times are GMT -4. The time now is 02:18 AM.

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