BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-18-2007, 04:39 PM   #1 (permalink)
New Member
 
Join Date: Jun 2006
Location: Waterloo, Ontario
Model: 8700r
Carrier: Rogers
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Controlled APIs BB dialog - How to handle

Please Login to Remove!

So, I'm writing an application that uses the phone API. When a user uses my app for the first time, I'd like to deal with the inevitable request to allow my app to use the phone API (the first time a dialog comes up asking teh user if it's okay for my app to use the phone API). I saw an app handle this by basically including text on the splash screen that says something like "The following dialog is requesting access to <insert API name>. Click to allow for this app to function properly".

So, I guess the code actually tries to invoke the API, which pops up the dialog, which prompts the user to allow, which sets things up all nicely for future use.

So, does anyone have any pointers on the best way to handle this situation? Are there any demo apps that do this type of thing?

Thanks in advance.

Stu
Offline  
Old 02-20-2007, 03:48 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Posts: 181
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure I quite understand your question. If your app tries to access controlled API then the phone automatically displays this dialog. The only thing you need to do in your code is catch a ControlledAccessException, which is thrown if the user denies you access.
Offline  
Old 02-20-2007, 06:02 AM   #3 (permalink)
New Member
 
Join Date: Jun 2006
Location: Waterloo, Ontario
Model: 8700r
Carrier: Rogers
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, thanks for replying. You sort of answered my question partially by mentioning the exception I need to catch if they don't allow my app access. I guess the rest I was looking for is more along the lines of best practices/conventions for this type of thing. I don't have data on my BB, and as a result haven't seen enough apps to get a feel for how other developers gracefully get users to authorize the use of controlled APIs (in a sort of user interface design sense). Don't need any code or anything... just tips/suggestions if you have them.

Thanks.
Offline  
Closed Thread


Thread Tools

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

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





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.