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
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
New Developer
aaronsevivas
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? 

Please use plain text.
Developer
BBDeveloper
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.
Please use plain text.
New Developer
aaronsevivas
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? 

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
New Developer
aaronsevivas
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?   

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
New Developer
aaronsevivas
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.

 

Please use plain text.
New Developer
aaronsevivas
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;

    }   

}  

 

 

 

Please use plain text.