Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android 4 Application Development
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 19th, 2013, 07:20 PM
Authorized User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Earthquake Min and targetSDK versions

What is the minSDKVersion and the targetSDKVersion I'm suppose to use on the Earthquake project?
__________________
Marcelo Oliveira
MAOWebSolutions.com
Reply With Quote
  #2 (permalink)  
Old July 21st, 2013, 04:17 AM
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
Default

The project.properties file in the project targets android level 15 thus Ice Cream Sandwich. Although I do not recommend using that one as the platform will throw a NetworkOnMainThreadException.
This webpage link: NetworkOnMainThreadException in Android will take you to a developer.android webpage where Google exhausts why that is or why Android is programmed to react in that specific manner.

EDIT:
If you do not have any experience with AsyncTask or didn't read Chapter 9, I'd advise to not declare a minSDKVersion or targetSDKVersion in AndroidManifest.xml which - if you read the Android documentation on <uses-sdk> - is equivalent to minSDKVersion="1". However, that is a bad development paradigm as network requests usually make the UI/ main thread unresponsive.

Last edited by Android23Geek; July 21st, 2013 at 05:07 AM..
Reply With Quote
  #3 (permalink)  
Old July 21st, 2013, 06:45 PM
Authorized User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Thank you

Thank you for the help. I will go over the chapter 9 and proceed.
__________________
Marcelo Oliveira
MAOWebSolutions.com
Reply With Quote
  #4 (permalink)  
Old July 22nd, 2013, 03:09 AM
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
Default

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:
Quote:
<uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="17"/>
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 developer.android.com. 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..
Reply With Quote
  #5 (permalink)  
Old July 25th, 2013, 08:13 PM
Authorized User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2013
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default Great ! Thank you for all the help.

Fantastic I really appreciate all your help. I will read the chapters to better understand how it works on chapter 9, and go back to finish this example.

Thanks once again.
Marcelo
__________________
Marcelo Oliveira
MAOWebSolutions.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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
MAX/MIN Value Help slbibs SQL Server 2005 4 November 6th, 2007 04:00 AM
Min Function deontae45 SQL Server 2000 13 September 23rd, 2006 05:45 AM
min-height in IE cgallagr98 CSS Cascading Style Sheets 5 April 8th, 2005 12:47 PM
MIN() function mohiddin52 Access 1 October 29th, 2004 07:09 AM



All times are GMT -4. The time now is 01:51 PM.


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