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
Highlighted
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified
Accepted Solution

How To - Add application options to the BlackBerry Options

[ Edited ]

I built the "How To - Add application options to the BlackBerry Options" sample from the knowledge base and run it on a Pearl Flip but I don't see any new options added. I might be looking in the wrong place but i thought the sample adds "Options Sample" to the list of options.

 

Does anyone know where to look for the new option added by this sample?

 

 

I went back and setup alternate entry point recompiled and still can't find where the new option is.

Message Edited by ipcTony on 12-11-2008 12:26 PM
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: How To - Add application options to the BlackBerry Options

[ Edited ]

ugh... its working sorta.  switch over to 8800 cingular device with OS 4.1 and the custom options showed up.

 

Any ideas why it does not work on the Pearl Flip phone?

 

 

Working on the Pearl Flip now...

 

I went back and compiled it on JDE 4.1 and load it on the Pearl and it worked. my demo works with HTML messages so I can't compile it with JDE 4.1 to be used on OS 4.5 and greater. Is there a reason compileing in JDE 4.5 does not work on the Pearl Flip?

Message Edited by ipcTony on 12-11-2008 02:15 PM
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How To - Add application options to the BlackBerry Options

Just to clarify, are you testing with the OptionsProviderDemo that is included with the BlackBerry JDE?  What version of BlackBerry handheld software do you have on your BlackBerry Pearl Flip?  You can find this under Options, About on the BlackBerry Pearl.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: How To - Add application options to the BlackBerry Options

[ Edited ]

Mark I got it working.the OS is v4.6.0.48 platform 4.1.0.13 The custom options are working now. I cleaned up my code and its ok.

 

I do have another problem that hope you or someone can help with.

I have (2) cod files. The first file is setup as a alternate entry point that loads options, custom memu and implements the run objects for the menus. The menu was added to Mail, Memo, Task, Calendar applications.

The second file is a library which i developed for other standard CLDC applications and handles all my processing bluetooh code.

The problem I'm seeing is that I can call my library process function from any of the custom menu but if i call the processor function in a certain order it seems to block access to the processor function.

This works
Call from Memo -- exit Memo
Call from ToDo -- exit ToDo
Call from Calendar -- exit Calendar


This does not work
Call from Mail -- exit Mail 
Call from Memo -- no access to fucntion

 

It seems like when the run objects for Memo, Task, Calendar are completed it terminates or shutdown something in the alternate entry point application and my bluetooth connection shuts down. This is find for saving battery on device.


But when the Mail run object completes bluetooth connection still running therefore it blocks any calls from the other run object.


Do you know if the mail application handles custom menu run objects differently? It seems like a thread is being opened and never closes and release my library function.

 

 

 

//Run is called when the menuItem is invoked
public Object run(Object context)
{
//context object should be a email message
if (context instanceof Message)
{
Call my library processor (mesage_data);
}
return context;
}

//Run is called when the menuItem is invoked
public Object run(Object context)
{
//context object should be a email message
if (context instanceof BlackBerryMemo)
{
Call my library processor (memo_data);
}
return context;
}

//Run is called when the menuItem is invoked
public Object run(Object context)
{
//context object should be a email message
if (context instanceof BlackBerryEvent)
{
Call my library processor (event_data);
}
return context;
}

//Run is called when the menuItem is invoked
public Object run(Object context)
{
//context object should be a email message
if (context instanceof BlackBerryToDo)
{
Call my library processor (todo_data);
}
return context;
}

 

 

I can terminate/shutdown the connection after the mail run object terminates but I wouldstill like to know why the closing the mail application does not work like the other apps.

Message Edited by ipcTony on 12-14-2008 02:48 PM
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How To - Add application options to the BlackBerry Options

Note that the Messages application runs constantly.  "Closing" it just moves the application into the background.  This could describe the behaviour you are seeing (I can't say for sure since I don't know what actions are being taken within your library).  Your application should ensure that it closes all connections and cleans up resources it may be referencing but no longer need.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: How To - Add application options to the BlackBerry Options

Thanks Mark. That makes perfect sense as the mail app needs to retrieve incoming messages at all times.

 

I've updated my code to programmatically shut down my library from all the apps I've added a custom menu too. Better be safe to know that the library is closed and ready for next event to use it.