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
New Developer
Posts: 7
Registered: ‎08-24-2010
My Device: Bold 9700
My Carrier: Cable & Wireless

Making a hashed key license check - checking against App World inserted data

Using publicly supplied code I'm trying to get a 'hold-of' on the license key that should be inserted by App World at the time my app has been bought by a customer.

 

String myAppName = ApplicationDescriptor.currentApplicationDescriptor().getName();
CodeModuleGroup group = CodeModuleGroupManager.load( myAppName );

final String key = group == null ? "unknown" : group.getProperty( RIM_APP_WORLD_LICENSE_KEY );


 

The problem is that the group always returns null

 

If I check to see which groups exist using:


int num = CodeModuleGroupManager.getNumberOfGroups(); 
..
CodeModuleGroup gp[] = CodeModuleGroupManager.loadAll();

 

and then running through the array, I still cannot access the 'group' data for my app compiled and linked in Eclipse.

 

Any ideas??

thx






CodeModuleGroup group = CodeModuleGroupManager.load("Visit Manager");


// Get hold of the ASCII, Base64-encoded key, if not available use the string "unknown"
final String key = group == null ? "unknown" : group.getProperty( RIM_APP_WORLD_LICENSE_KEY );

Developer
Posts: 246
Registered: ‎09-30-2010
My Device: Z10, Onyx2
My Carrier: IND XL

Re: Making a hashed key license check - checking against App World inserted data

[ Edited ]

String myAppName = ApplicationDescriptor.currentApplicationDescriptor().getName();

this is the wrong part

 

CodeModuleGroup group = CodeModuleGroupManager.load( myAppName );

 

myAppName only get the name of the application.

you should input  application + ":" developer

 

exp:

CodeModuleGroup group = CodeModuleGroupManager.load( myApplication:developer);


 

this works for me