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: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel
Accepted Solution

get properties of the project ..

hi ..

 

I want to add some phone number to my project in properties  ..

 

i have to retrieve that phone no from the home screen  ..

 

is it possible to do that..

 

 

if we can .. can u please tell me how to add and how to retrieve

 

?

 

 

 

 

Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: get properties of the project ..

 

Hi I have used the following code but it is giving my the null pointr exception where i am running it in the simulator..

 

I have edited the jad file..

 

 

CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();
    CodeModuleGroup myGroup = null;
        String moduleName = ApplicationDescriptor.currentApplicationDescriptor

().getModuleName();
           System.out.println("Reading moduleName" +moduleName);  // output is coming "blackberry_test"
            for (int i = 0; i < allGroups.length; i++) {
            if (allGroups[i].containsModule(moduleName)) {
                myGroup = allGroups[i];  // i am getting nothing here ..its  null
                break;
                }
            }

        String description = myGroup.getProperty("phoneNumber"); // it is giving null value..
    }

Developer
Posts: 147
Registered: ‎08-27-2010
My Device: 9800
My Carrier: airtel

Re: get properties of the project ..

It will work only if your application installed via OTA(through JAD file).

 

for testing: place jad and cod in you sdcard of simulator, in simulator browse to go the jad file and click on jad file to install your application.

Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: get properties of the project ..

thank you very much..