Wrox Programmer Forums
|
BOOK: Professional Android 4 Application Development
This is the forum to discuss the Wrox book Professional Android 4 Application Development Reto Meier; ISBN: 978-1-1181-0227-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 4 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 May 20th, 2013, 09:14 PM
Authorized User
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Problems Running Earthquake 1

The book does not specify the min required SDK, the target SDK, or the compile with.

I added all the code with min: API 8, Target: API 17.

I'm getting the following errors on EarthquakeListFragment - Errors in FONT RED

1. public class EarthquakeListFragment extends ListFragment {


2. super.onActivityCreated(savedInstanceState);

3. aa = new ArrayAdapter<Quake>(getActivity(), layoutID , earthquakes);

4. setListAdapter(aa);

5. String quakeFeed = getString(R.string.quake_feed);


PS. Number 5. quake_feed. The Strings.xml have the <string name="quake_feed">

Thanks for your help.
__________________
Marcelo Oliveira
MAOWebSolutions.com
 
Old May 21st, 2013, 04:34 AM
Authorized User
 
Join Date: Jan 2013
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problems Running Earthquake 1

Hi marfl99,

In eclipse when editing EarthquakeListFragment, try "ctrl-shift-o" and import android.app.ListFragment. If i omit this, i see the errors you noticed..
But this only works on min sdk = 11, for the majority of the examples in the book try 11, not less. Otherwise include a support library.

Hope it helps!
 
Old May 24th, 2013, 08:30 PM
Authorized User
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Hey Kees, that did help but not completely

Hey Kees,

That fixed almost everything. Threre is only one thing left. The line below in RED

String quakeFeed = getString(R.string.quake_feed);

And as you can see I have the quake_feed in the strings file.

<string name="quake_feed">
http://earthquake.usgs.gov/eqcenter/.../1day-M2.5.xml
</string>


Thanks so much for your help.
__________________
Marcelo Oliveira
MAOWebSolutions.com
 
Old June 21st, 2013, 12:14 PM
Registered User
 
Join Date: Jun 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Quake feed URL in the example string resource has been depreciated by the USGS.gov folks. So it does not work. You can rework using the new feeds URL (see their web site), which if you want you app to work you will have to do.

But for testing, use http://earthquake.usgs.gov/earthquak...y/2.5_day.atom

as the url string.
 
Old June 22nd, 2013, 09:56 AM
Authorized User
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Hi Kees

Will do! thanks
__________________
Marcelo Oliveira
MAOWebSolutions.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 Earthquake 2, Earthquake.java, error onActivityResult dbomberg BOOK: Professional Android 2 Application Development 2 November 30th, 2012 05:52 AM
Problem Running Chapter 6 Earthquake clombardo BOOK: Professional Android 2 Application Development 26 June 28th, 2012 01:33 PM
Chapter 9: Problems running published forms blade117runner BOOK: Professional SharePoint 2010 Development 0 July 25th, 2010 01:59 AM
Chapter 3 - p.71 - Building and running problems LuckyLuc BOOK: Beginning Mac OS X Programming 1 June 24th, 2010 05:36 AM
Problems installing and running IIS Ads Dreamweaver (all versions) 5 January 4th, 2006 11:04 AM





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