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: 21
Registered: ‎10-09-2008
My Device: Not Specified
Accepted Solution

Add custom information to an application ? (Resource, JAD,...)

Hi,

I have an application that is deploy over the air.

I am searching a way to add custom informations in my BB application depending on the user that download the application (for example, get his name, or company ID). Tha aim is to have custom informations on the user that is displayed when the user launch the application (for example, "Hi Mr Smith").

First, I had searched with the resource file but this files are compiled. So I can't had custom informations to the resource file depending on which user is connected to the download website.

Then, I had searched for programmatically read the attributes of a JAD file so that I could had a custom attribute in it. I have found the "How To" but that doesn't work at all on my environement (Eclipse Plugin + Simulator). I have found this thread but it seems that it doesn't work for others users too.

So :
  - Does this "HowTo" work ?
  - Is there another solution to add custom informations in an application that is deployed OTA ? I don't know like an ini file that you could change just in time Smiley Happy  ?

 

Regards,

 

Sylvain.

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

I couldn't figure out how to get the RIM resource and related features to work with the command line tools so I finally

went to a custom approach. In our app it fit in naturally as we wanted to make a "social app" that obtains

user information to the fullest extent the user cares to reveal. So, upon first use, the app makes a request to

our server along with GPS info if available and locale information and device specifics ( we use the profile

header file as well as anything we can get from the "info" classes) to provide graphic and later perhaps

text info ( localization hasn't been the focus as much as branding for proof of concept).

 

Server side logic is pretty simple once you have chosen a pattern- you need someone to look at the query string

and the device profile file and then pick the right stuff to send.

 

Developer
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

Thanks for the reply,

I think your app do the opposite of what I want my app to do Smiley Happy Probably because my previous message is not clear.

Your app sends information to your server, I want my app to already have custom informations when the user download it. In details, the user authenticate on a webpage, so the web page get the name of this user, his ID, and whatever and insert that informations into the app before sending it to the user's device.

I hope I am clearer.

Regards,

Sylvain.
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

If you believe the documentation, from 4.3 and later you can modify the jad file server side based on any information

you want. Prior to that, I think you would need to recompile your jar ( which is still doable but you would probably

need to send an SMS back to the user when his custom built app is done).

 

Just as a design issue, I'm not really sure how happy Mr. Smith will be to see "Hi Mr. Smith" after

he has to spend 10 minutes typing things he already knows into a small keyboard as he tries

to drive or listen to his boss. I don't think you can get the a browser to volunteer arbitrary information

but there are things like javascript for obtaining locaiton information from enabled devices. So, sure, you

may be able to write javascript to solicit some information but it would be rather limited.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/852943/What_Is...

 

 

[ the link may not work since your omniscient editor says I have invalid html but I really can't figure out

what it is complaining about and don't really care ]

 

 

Developer
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

Thanks again.

 

My example is volountary simple. On my web site, Mr Smith just authenticate and the webpage retrieve informations from the database that I want to be iclunded into the app especially to prevent Mr Smith form typing a lot of codes when using the pass Smiley Happy

 

I still search for a way to make the "HowTo" works... But I still can't read the JAD infos.

 

I tried this :

 

 

ApplicationDescriptor desc = ApplicationDescriptor.currentApplicationDescriptor(); CodeModuleGroup group = CodeModuleGroupManager.load(desc.getName()); if(group != null) { add(new RichTextField("Group: " + group.getName() )); for( Enumeration e = group.getPropertyNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); add(new RichTextField(name + ": " + group.getProperty(name) )); } } else { add(new RichTextField("Group is null !")); }

 

Result : group is always null.

 

I also tried to list all the modules with this code :

 

 

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; } }

 

Result : it doensn't find my module. I debuged it and inspect all the modules in the loop but with no results.

 

 

Any other ideas ?

 

 

 

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

For a midlet, there are plenty of example at sun,

 

http://developers.sun.com/mobility/reference/techart/design_guidelines/key_assignment.html

 

it probably isn't any harder to find the method in the link for reading a jad in a 4.3+ rim app.

 

Highlighted
Developer
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Add custom information to an application ? (Resource, JAD,...)

Finally !

 

If you run your application via the Eclipse plugin,your app doesn't appear in the module list.

You cannot simulate OTA installation by pressing the "Run" button in the Eclipse plugin.

I tried to launch the simulator first and install the app with the browser and it worked, I was able to read the custom properties from the JAD file.

 

I hope this thread will help some people.

 

Thanks all for your responses.

 

Sylvain.