Wrox Programmer Forums
|
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 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 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..
 
Old December 16th, 2008, 09:41 AM
Reto's Avatar
Wrox Author
 
Join Date: Oct 2008
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
 
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..





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





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