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
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Invoke Profiles

Hello, Is it possible to invoke the Profiles-Application using the API? If so, how do I get the currently selected Profile (loud, silent, vibrate...)? Cheers,javec
If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Invoke Profiles

No, this is not supported in the BlackBerry API set.
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
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Invoke Profiles

Will it be possible in future API-sets?

Why is it actually not possible? 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Invoke Profiles

Well, here's how I do it:

 

 

try {

int moduleHandle = CodeModuleManager.getModuleHandle("net_rim_bb_profiles_app"); ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(moduleHandle); ApplicationManager.getApplicationManager().runApplication(apDes[0]); } catch (ApplicationManagerException e) { // Handle exception here }

 

 

 

Developer
javec
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Invoke Profiles

yes, but that "only" launches the app, it does not return a selected profile?
If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Invoke Profiles

Right.  It only launches the app; it doesn't return any info, unfortunately.
New Developer
rosskevin
Posts: 9
Registered: ‎07-16-2008
My Device: Not Specified

Re: Invoke Profiles

Ok, so you can do this with the Event Injector API, which by default, is set to deny (and seems that it always will).  For a small amount of users, or niche customers where this is very important, you may convince them to go through the necessary steps to manually allow this for your application.

 

So, yes, it is possible, but other than injecting key events (somewhat blindly), you cannot do any more.

Kevin Ross | President | Metova
www.metova.com
New Developer
Neil
Posts: 11
Registered: ‎07-14-2008
My Device: Not Specified

Re: Invoke Profiles


rosskevin wrote:

Ok, so you can do this with the Event Injector API, which by default, is set to deny (and seems that it always will).  For a small amount of users, or niche customers where this is very important, you may convince them to go through the necessary steps to manually allow this for your application.

 

So, yes, it is possible, but other than injecting key events (somewhat blindly), you cannot do any more.


 

That's definitely true, however I wouldn't recommend going down that route. Firstly, you're going to have to make some assumptions about the way the Profiles applications visually looks in order to inject the right set of key presses. If the profiles application changes in appearance in a future OS upgrade, you're going to have to modify your application too.

 

Secondly, this approach will not work when the keyboard is locked, so if you're trying to write, say, an automatic profiler switcher, it's just not going to work all the time.

 

Since many users are on a BES, even if that particular user wants to make the change to enable the permission set for Event Injection it's likely the BES admin still won't do it (Believe me, we've tried!).

 

I realize you probably know all this information already rosskevin, just clarifying for the OP why he shouldn't try to go down this route.

 

javec, in short, what you want to do is practically not possible right now and you're going to have to wait for RIM to add appropriate APIs.

New Developer
gagansnt
Posts: 8
Registered: ‎01-06-2009
My Device: Not Specified

Re: Invoke Profiles

But there are some application available which changes the profile based on time and your location. How they are able to do it if there are no API's available.

 

 

Gagan