Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 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 December 16th, 2008, 09:20 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 8 example 4

Hi,

I have problems running the fourth example from chapter 8. Basically, I have created a new project from the provided source, however, upon running it throws out the following message:

12-16 13:16:58.102: ERROR/AndroidRuntime(15341): java.lang.SecurityException: Requires VIBRATE permission
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at android.os.Parcel.readException(Parcel.java:1234)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at android.os.Parcel.readException(Parcel.java:1222)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at android.app.INotificationManager$Stub$Proxy.enqueu eNotification(INotificationManager.java:152)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at android.app.NotificationManager.notify(Notificatio nManager.java:96)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at com.paad.earthquake.EarthquakeService.announceNewQ uake(EarthquakeService.java:167)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at com.paad.earthquake.EarthquakeService.addNewQuake( EarthquakeService.java:124)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at com.paad.earthquake.EarthquakeService.doRefreshEar thquakes(EarthquakeService.java:251)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at com.paad.earthquake.EarthquakeService.access$0(Ear thquakeService.java:190)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at com.paad.earthquake.EarthquakeService$1.run(Earthq uakeService.java:186)
12-16 13:17:58.580: ERROR/AndroidRuntime(15353): at java.lang.Thread.run(Thread.java:935)

Could you please suggest how to fix that? Thank you.

Last edited by mobilekid; December 16th, 2008 at 10:01 AM..
Reply With Quote
  #2 (permalink)  
Old December 16th, 2008, 09:41 AM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Looks like it's missing the permission required for an application to vibrate the device.

Add the following line at the end of your application manifest, before the closing </manifest> tag:
Code:
<uses-permission android:name="android.permission.VIBRATE"/>
Let me know if this solves the problem for you!

For my own benefit, when you say you created a new project from the provided source, are you referring to the source code download? If so I'll update it to make sure it's got the right permissions so others don't have the same problem.

----
Reto Meier
Author, Professional Android Application Development
Reply With Quote
  #3 (permalink)  
Old December 16th, 2008, 09:57 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Reto View Post
Looks like it's missing the permission required for an application to vibrate the device.
Yes, that was it. The declaration in the manifest fixed it.

And, yes, I built it from the source code I downloaded from the book's website, it really should be updated the way you suggested.

Thanks for the help!

PS: Great book! The best Android book I've seen so far!

Last edited by mobilekid; December 16th, 2008 at 10:00 AM..
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 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM



All times are GMT -4. The time now is 08:25 AM.


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