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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Custom Properties in JAD file

installing a software using desktop manager does not take the jad file into account, it uses alx+cod.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 19
Registered: ‎05-13-2009
My Device: Not Specified

Re: Custom Properties in JAD file

I have not used the Desktop Manager to install my application as I have said many times in my posts.  I have used the Blackberry Manager (server administration utility for BES) to wirelessly deploy the application.  The Desktop Manager (although I may be mistaken) refers to the package the users can install on their own PC to deploy applications and files to their personal Blackberry.

 

So back to my question,

 

So how do I add resource files (custom properties like _whats the ip of the server_) that can be updated at deployment time? 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Custom Properties in JAD file

Well when it comes to technology constaint you have to look for some other options.. I dn't knw waether it will suite your requirement but you can do one thing like you can store the configuration details in a file and save it on device and when the user lanuches the application and finds there is some change in server IP your application has to replace the new server address and use it further in application.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 19
Registered: ‎05-13-2009
My Device: Not Specified

Re: Custom Properties in JAD file

This is not a viable solution (have the user update the server ip.......)   

 

I am new to Blackberry development (circa 5 months) and fairly new to these forums so, just to establish context, are the people replying actually working for RIM?

 

The reason I ask, I just cannot believe that RIM would create a BB software framework that did not allow for deployment time updateable resource files.  This is a basic necessity for any application (internationalisation, program specific variables).  Are you BB developers recompiling/resigning every time you need to change "Debug" to "True"? 

 

What does RIM recommend we do for resource files that dont need recompile/resign? 

Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Custom Properties in JAD file

the BES does not use the jad file, it uses alx+cod.
if you have users on a BES you can as well use custom it policies to provide properties.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 19
Registered: ‎05-13-2009
My Device: Not Specified

Re: Custom Properties in JAD file

"You can as well use custom it policies to do this"

 

Can you tell me or direct me to the right place on how to do this?   

Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Custom Properties in JAD file

ask a BES admin (or the corresponding forum) for custom it policy items.
on BB side it is very easy, the ITPolicy class allows to read these values with static methods.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 19
Registered: ‎05-13-2009
My Device: Not Specified

Re: Custom Properties in JAD file

I found it.  Thanks for taking the time to offer me some help.

 

Highlighted
New Developer
Posts: 19
Registered: ‎05-13-2009
My Device: Not Specified

Re: Custom Properties in JAD file

And for those who stumbled in here searching for an answer:

 

1)  Goto your BES Manager (admin console)

2)  Click the Blackberry Domain node in your treeview

3)  Click "EditProperties in the main pane

4)  Click IT Policy in your left pane

5)  Find the It policy your users of the application is using and click Properties

6)  Click User Defined Items

7)  Click IT Policy template "..."

8)  Click New

9)  Add your variable based on its type (mine was a String type)

10)  Click Ok Ok Ok

 

Add this code, and it will retrieve your value.  Remember you have to sign your code using the RIM SignatureTool.jar.

 

package TestJADFileProject;

 

import net.rim.device.api.ui.*;

import net.rim.device.api.ui.component.*;

import net.rim.device.api.ui.container.*;

import net.rim.device.api.itpolicy.ITPolicy;

 

public class TestScreen extends MainScreen

{

    public TestScreen() 

    {    

        super();

        LabelField applicationTitle = new LabelField("Test Custom IT Policy Property");

        setTitle(applicationTitle);

        RichTextField textField = new RichTextField(GetApplicationProperty());

        add(textField);   

    }

   

    public String GetApplicationProperty()

    {

        String ip = ITPolicy.getString("ServerIp");

        return ip;

    }   

}