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
Developer
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

edit permissions

i want to use httpregisteryfilter class. but it is not working . i think for my device in edit permission "borwser filter" is set

to deny. can i change it to  allow through my code.I need to start my application as soon as we click on the url through borwser.

Developer
Posts: 60
Registered: ‎05-04-2011
My Device: Torch 9800, Bold 9700, Curve 9380
My Carrier: None

Re: edit permissions

Hi,

 

Try to use this code snippet.

call it before pushing the first screen.

 

private static boolean checkPermissions()
    {
        // Capture the current state of permissions and check against the requirements
        ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
        ApplicationPermissions original = apm.getApplicationPermissions();

        // Set up and attach a reason provider
        PermissionReasonProvider drp = new PermissionReasonProvider();
        apm.addReasonProvider(ApplicationDescriptor.curren​tApplicationDescriptor(), drp);
        

        if(
           original.getPermission(ApplicationPermissions.PERM​ISSION_ORGANIZER_DATA) == ApplicationPermissions.VALUE_ALLOW &&
           original.getPermission(ApplicationPermissions.PERM​ISSION_PHONE) == ApplicationPermissions.VALUE_ALLOW &&
           original.getPermission(ApplicationPermissions.PERM​ISSION_INPUT_SIMULATION) == ApplicationPermissions.VALUE_ALLOW &&
           original.getPermission(ApplicationPermissions.PERM​ISSION_EMAIL) == ApplicationPermissions.VALUE_ALLOW)
        {
            // All of the necessary permissions are currently available
            return;
        }

        // Create a permission request for each of the permissions your application
        // needs. Note that you do not want to list all of the possible permission
        // values since that provides little value for the application or the user.  
        // Please only request the permissions needed for your application.
        
        ApplicationPermissions permRequest = new ApplicationPermissions();
        permRequest.addPermission(ApplicationPermissions.P​ERMISSION_EMAIL);
        permRequest.addPermission(ApplicationPermissions.P​ERMISSION_INPUT_SIMULATION);
        permRequest.addPermission(ApplicationPermissions.P​ERMISSION_PHONE);
        permRequest.addPermission(ApplicationPermissions.P​ERMISSION_ORGANIZER_DATA);

        boolean acceptance = ApplicationPermissionsManager.getInstance().invoke​PermissionsRequest(permRequest);

        if(acceptance)
        {
            // User has accepted all of the permissions
            return true;
        }
        else
        {
        	   return fals;
        }
    }

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: edit permissions

This code appears to be from the ApplicationPermissionsDemo that comes supplied with your tooling.  I would check that sample code out for further information and to understand how you can integrate it with your application. 

 

There may be complications because of the way your application is initiated - you might have to do some sort of 'start-up' application to get your code authorized before the user attempts to drive it from a URL.  I have not used this facility so I am not sure.  But have a look at this code and see if it works for you.  Come back if it does not. 

Developer
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

lunching application through url

i am trying to start my application through url in device browser once the application is installed. i used the

httpregistryfilter for this as bellow:

 

HttpFilterRegistry.registerFilter("www.browserfilter.com","com.rim.samples.device.push");

here when i try www.browserfilter.com in my device browser,it gives "unable to fine the specified post server".

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: lunching application through url

Does it work on the Simulator?

Developer
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: lunching application through url

no it is not working in simulator. when i am trying in  my device their also it shows "requested url not found"

can anybody tell me how to start the application throught "httpregistryfilter". I want to know how to register our application through my code so that when i use the domainname in device browser ,it should start my application

Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: lunching application through url

and did you check the httpfilterdemo sample?
is your application really "com.rim.samples.device.push" ?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: lunching application through url

[ Edited ]

I have never used this code myself, but I believe the theory is there are two steps:

 

a) You have an application that registers your Protocol class to the HttpFilterRegistry.  This application is usually not a standard UiApplication, but just an Application and is set to run at start-up.

b) The Browser invokes your Protocol class to supply the web pages.

 

But there is a sample for this as well, called HTTPFilterDemo, and it should run in the Simulator (you will probably need t have MDS running to get the Browser pages).

 

So try out the sample, and then I think you should be able to get it working on the Simulator.  Moving to the device is a little more complicated, but we can cross that bridge when you have it working on the Simulator. 

 

OK?

 

Edit: Once again beaten to the punch by "quick draw" Simon! 

Highlighted
Developer
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: lunching application through url

ok. i will try