03-19-2009 11:49 AM
I am using JDE 4.7 and its default simulator. I have a few apps installed but when making a call from on app
CodeModuleGroupManager.loadAll()
it returns null. I also tried
String moduleName = ApplicationDescriptor.currentApplicationDescriptor
CodeModuleGroupManager.load(moduleName);
it also returns null.
Any thoughts on what could be wrong here? Thanks
03-19-2009 01:45 PM
CodeModuleGroupManager.loadAll() returns null if there is if no list of groups available, or list of available groups has no members. Please confirm is there aby group there or not?
Press the kudos button to thank the user who helped you.
If your problem was get solved then please mark the thread as "Accepted solution".
03-19-2009 01:57 PM
First make sure
CodeModuleGroupManager.getNumberOfGroups() method is not returning 0. if it is returning zero then there is no group avilable for the perticular application module or all application modules.
03-19-2009 02:28 PM
CodeModuleGroupManager.getNumberOfGroups() does return 0.
Here comes the dumb question - what is a group? I thought every app installed is a group..
I try to follow
to get a few attributes out of an app's JAD file. But so far it does not work...
03-19-2009 02:41 PM
No, Every app which is on device(installed) is not an group but group is a groupname for a type of applications. you can specify a group name for a app.
If you need to get info for a particular app then use CodeModuleManager class. Using this you can createNewModule(), getModuleName(), getModuleHandle(), module version, module url etc.
Press the kudos button to thank the user who helped you.
If your problem was get solved then please mark the thread as "Accepted solution".
03-19-2009 03:17 PM
I want to get a few properties I created in the JAD file following the "how to" guide in knowledge base (link provided above)
here is the codes they provided:
CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
CodeModuleGroup myGroup = null;
String moduleName = ApplicationDescriptor
.currentApplicationDescriptor().getModuleName()
for (int i = 0; i < allGroups.length; i++) {
if (allGroups[i].containsModule(moduleName)) {
myGroup = allGroups[i];
break;
}
}
// Get the property
String description = myGroup.getProperty("MIDlet-Description");
String custom = myGroup.getProperty("My-Custom-JAD-Property");
So I am puzzeled what extra step I need to do in order to make it work?
03-19-2009 03:43 PM
Hi,
if you want to get the value of ordinary properties supported in Jad. Then Use the fowllowing code :
CodeModuleGroup cmg = CodeModuleGroupManager.load(group_name);
for( Enumeration e = cmg.getPropertyNames(); e.hasMoreElements(); )
{
String name = (String)e.nextElement();
System.out.println( "Name: " + name );
System.out.println( "Value: " + cmg.getProperty(name) );
}
If you have made some custom entries in jad, and you want to access them , then
value = cmg.getProperty("custome property name");will give you the value of custom property.
03-19-2009 03:56 PM
Unfortunately in my case, CodeModuleGroupManager.load(moduleName) returns null.
where moduleName is obtained via
String moduleName = ApplicationDescriptor.currentApplicationDescriptor
Does this work only when one installs the app on phone over the air? Or should it work in JDE/simulator as well?
03-19-2009 04:00 PM
03-19-2009 04:06 PM