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

New Member
Posts: 1
Registered: ‎09-16-2012
My Device: torch
My Carrier: du

Accessing Profile Class

I am trying to access profiles class and its objects and methods.


here is a snippet of code i am using.


            Profile allDeviceProfiles[];
            allDeviceProfiles = Profiles.getDeviceProfiles();
            for(int i = 0; i < allDeviceProfiles.length; i++) {
                int currentId = allDeviceProfiles[i].getId();
                if(currentId == Profiles.QUIET_PROFILE_ID) {
                    SilentProfile = allDeviceProfiles[i];
                    if(allDeviceProfiles[i].isActive()) {
                        CurrentProfile = SilentProfile;


This code works perfectly in simulator. But when i try to run app on physical device it does not work.

I get error that app attempts to access a secure api.


I have my signing keys and COD is successfully signed.