View Single Post
  #4 (permalink)  
Old July 22nd, 2013, 03:09 AM
Android23Geek Android23Geek is offline
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2013
Location: Netherlands
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post

Let me follow up on my post, I wanted to elaborate on your question since I didn't feel like I answered the question. I have changed some settings in the Chapter 6 full-worked out project sample. The changes I made were for experimentation and the rest were instructions from the project in Chapter 6. The book instructs you to use the android.os.Handler class and Threads in the sample project and like I previously wrote, Chapter 9 explains how a developer should/ must work in the 'background'.

Before you define the <uses-sdk> attribute, you need to take into account, the classes you are going to use and the classes already present in your code. In this sample, Reto Meier used ListFragments which were introduced in android api level 11 thus minSDKVersion cannot be lower than 11. Well that is unless your app is backwards-compatible with pre-Android 3.0 devices, but that's not the point. The book and in general, Google suggest to target the latest android version as it contains updates for bug and important additions in comparison to older versions.

So I added the following in the androidmanifest.xml file:
<uses-sdk android:minSdkVersion="10"
I have development experience with code execution in different Threads, so it was not difficult for me to comprehend the documentation of those two classes on However, remember that NetworkOnMainThreadException was also introduced in android api level 11 thus you're obligated into running network requests on a background thread if you're to explicitly define <uses-sdk> permissions. You can follow the instructions of the book without knowledge of Threads or you could stop reading Chapter 6 and read revelant paragraphs in Chapter 9. Also, there is a button with a thumbs up icon, it's a 'thank you' button... xD

Last edited by Android23Geek; July 25th, 2013 at 11:35 PM..