Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 22
Registered: ‎08-05-2008
My Device: Not Specified

Application Permissions

Hi,

 

I developed an application whose code has been signed. i loaded it to device and then gave permissions via settings->advanced->applications->myApplication->Permissions (all of them allowed). However, when i run the app., permission dialog screen is popped up. Why? Thanks!

Developer
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Application Permissions

Some functions such as access to phone logs or GPS will always require user intervention regardless of whether the app has been signed or app permissions have been set.

New Developer
Posts: 22
Registered: ‎08-05-2008
My Device: Not Specified

Re: Application Permissions

Hello Richard,

 

Thanks for your reply! The screen is popped up when i attemp to open a file or HttpConnection or a socket. Any idea?

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Application Permissions

Are you referring to the screen that prompts you to allow the connection?  This prompt is from the firewall, which can be enabled or disabled under Options, (Security Options), Firewall.  Note that this setting is locked as enabled by default for BlackBerry Enterprise Server users.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Application Permissions

Is there a way to programatically check to see if the firewall is enabled? 

 

I'm using the ApplicationPermissionsManager to ask for various permissions the first time my app launches.  It seems that on devices where the firewall is enabled, I need to ask for the PERMISSION_INTERNAL_CONNECTIONS in order to write files using the FileConnection API.  I've found that I cannot just blanket ask for this permission, as some devices will never save it.

 

Thanks.

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Application Permissions

[ Edited ]

Can you elaborate on this?


ryandevore wrote:

  I've found that I cannot just blanket ask for this permission, as some devices will never save it.

 

 


There are no APIs that allow you to directly query if the firewall is enabled.

Message Edited by MSohm on 09-26-2008 10:35 AM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Application Permissions

I use the FileConnection API to save some data and write some log files in our application.  On a device configured for a BES, I found that I have to request the PERMISSION_INTERNAL_CONNECTIONS in order to do this.  Otherwise the user gets a prompt, "The application has requested a file connection to ///store/home/user/appname/".  We use HTTPS web calls as well as bluetooth, so to make the user experience better, I added logic at startup to check the application permissions, and if we did not have what we need, to use the ApplicationPermissionsManager to ask for them.

 

My original implementation asked for PERMISSION_INTERNAL_CONNECTIONS, but on one specific device, and O2 8800 (4.2.1.101), this permission never gets saved, so our app would end up prompting the user every time the application was run.

 

To work around this one problem, I added logic that only asks for the PERMISSION_INTERNAL_CONNECTIONS if the Desktop IPPP service book is found.  Some other posts in the forums indicate that this is a way to determine if the device is capable of making and MDS connection.

 

Now we come to the firewall issue.  With the firewall turned on, my application needs to ask for internal connections in order to access the FileConnection API, so my thought was to check if the firewall is enabled.  Even if we could check for the firewall, I don't think this will work as I've found some devices that will still prompt for "The application has requested a file connection to ///store/home/user/appname/" when the firewall is enabled, even after I ask for and save the internal connections permission.  The device was a Verizon 8830 (4.2.2.196, 3.0.0.84).

  

At the end of the day, I don't want our users to have to deal with all of these prompts for accessing things.  Even with code signing and using the ApplicationPermissionsManager, we're still discovering situations where our users will still be presented with various kinds of RIM dialogs.  Most of the time these will generate a support call, which is not ideal for my company or the user.

 

When the firewall is enabled, I've encountered two other prompts:

1.  "The application has requested a file connection to listen to messages" -- I'm not sure what is prompting this.  I need to look into it more.  But it does not appear to go away even when asking for every available permission.

 

2.  "The application has attempted to open a connection to a location inside the firewall and outside the firewall which is not allowed by your IT policy".  With the firewall turned on, our app cannot make any HTTP/S or Bluetooth connection.  This prompt appears and then our action fails with a java.lang.SecurityException: Permission denied.

 

 

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Application Permissions

Are you creating a MIDlet or BlackBerry CLDC application?  Please see this post for information on prompts that apply to MIDlets.

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=320&query.id=7166...

 

This link explains your second prompt.

 

Support - The application has attempted to open a connection to a location inside the firewall and outside the firewall.
Article Number: DB-00104

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/Support...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Application Permissions

Our application is a Blackberry CLDC application.

 

We have worked around the firewall issue by having customers disable it.

 

I came across another situation today where a customer's phone had "Media Access" set to Deny (when checked under Settings-->Options-->Advanced Options-->Applications-->Modules-->Our App).  The phone was an 8130 (4.3.0.60, 3.1.0.32).  I use the Alert class to vibrate the device in a couple situations, and this was not working.

 

Our application is used by consumers who may or may not be part of a corporate network.  We build against the 4.2.1 RIM API's.  Our application uses HttpConnection to make some web service calls over the BIS network, it uses the JSR82 bluetooth API's, it uses the FileConnection API to write data to device memory and/or SDCard.  These seem to be the things that cause permissions prompts.  Today was the first time I've seen the Media Access one.

 

The ideal user experience would be that our users do not have to deal with any security prompts at all.  I don't think this is viable, so the second most ideal user experience is to have a single prompt the first time the application launches that will request all the permissions needed.  So far, this seems to work in most cases but not all.

 

Is there a way to accomplish this?

 

It seems that the ApplicationsPermissions API does not allow me to request all the permissions that may or may not be needed.  I don't see a constant that looks like it would grant the Media Access one (at least from the ApplicationPermissions.PERMISSION_*** constants).  And as answered above in this thread, there is no way to deal with the firewall.

 

 

 

 

 

 

 

 

 

 

 

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Application Permissions

ApplicationPermissions.PERMISSION_MEDIA is the one you are looking for to enable media access.

 

There is no way to programmatically change the firewall setting.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker