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: 29
Registered: ‎09-12-2008
My Device: Curve 8330

Re: Alternate Entry Point

Check your rapc output file; each project entry point will have been assigned a number.  It might be 1, 2, 6, whatever; it depends upon the number of entry points in your workspace.  Try 1, 2, 3, etc. until it works if you can't find the rapc output file.
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Alternate Entry Point


 

However, I now have two applications on the home screen ribbon.  Careful study of the attachments to the knowledgebase article on alternate entry points referenced above reveals that the version of the JDE I'm using  (Version 4.3.0.1r) doesn't have the 'none' checkbox on the "Home Screen Position" item on the application tab of the properties screen.

 

Was this checkbox replaced with something else?  I don't find any documented (document version 4.3.0) method of the HomeScreen class that seems to do it...

 

Any assistance would be appreciated.  Thanks in advance.


Checking off the "System Module" checkbox prevents the application defined in that project from displaying an icon.

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: 29
Registered: ‎09-12-2008
My Device: Curve 8330

Re: Alternate Entry Point

Mark, that's perfect.  Thanks for the help.
New Developer
Posts: 7
Registered: ‎08-12-2008
My Device: Not Specified

Re: Alternate Entry Point

Hi KarlH,

 

just read your last post but couldn't find such data in any of the file. Is the file you're talking about also generated when building from JDE or only with command-line? if also from JDE, how can I find it?

 

thanks!

Developer
Posts: 29
Registered: ‎09-12-2008
My Device: Curve 8330

Re: Alternate Entry Point

So using the JDE version 4.3.0.1r, it puts it in the same directory as the source files.  In my case (I'm a simple man not using many libraries of reusable code and such) all the source for a project is in one directory, say C:\Documents and Settings\a0153103\My Documents\BlackBerry\Code\Sandbox\SlideShow and in there are files like SlideShow.java, SlideShow.jad, SlideShow.jar, SlideShow.cod, etc...

 

One file, SlideShow.rapc, is some output of the compiler.  A sample is shown below:

 

MIDlet-Name: SlideShow
MIDlet-Version: 0.0
MIDlet-Vendor: Karl Hartronft
MIDlet-Description: Displays pictures in series on the Blackberry
MIDlet-Jar-URL: SlideShow.jar
MIDlet-Jar-Size: 0
MicroEdition-Profile: MIDP-2.0
MicroEdition-Configuration: CLDC-1.1
MIDlet-1: SlideShow,,
RIM-MIDlet-Flags-1: 3
MIDlet-2: ,SlideShowEmpty.png,gui
RIM-MIDlet-Flags-2: 0

 

In this example, there are two entry points for SlideShow, one is MIDlet-1 and one is MIDlet-2.  These are the numbers to use (one or the other) in the setRolloverIcon call.  For example, in this app I used

 

HomeScreen.updateIcon(regularIcon, 1); HomeScreen.setRolloverIcon(rolloverIcon, 1);

 

As I said the other way to determine the right number is to start at 0 and increment a couple of iterations until it works.  I did that and it worked at 1.  I was then able to match the number to the MIDlet-#.

 

So the way this works is that there are two names for this app.  One, SlideShow, is set to be a system module, auto-run on startup.  It doesn't show up on the ribbon but it does get started when the Blackberry resets, without any parms.  So after everything is quiet, it sets the regular and rollover icon for the other entry point that is on the ribbon.  It goes away after that.  The other entry point (they call it an entry point but it actually starts at main like the other one does) is SlideShowUI, and it gets the "gui" parameter when selected by the customer and knows to actually do the customer-desired application work.

 

Clear as mud?

New Developer
Posts: 7
Registered: ‎08-12-2008
My Device: Not Specified

Re: Alternate Entry Point

gotcha...

 

reading that I think it was already not that unclear, must have been my mind!

 

Thanks, I'll try this right away.

Developer
Posts: 29
Registered: ‎09-12-2008
My Device: Curve 8330

Re: Alternate Entry Point

So I did some more testing with a second app, and in both my apps the number is 1.

 

Also, I had a problem in the 2nd app accessing the bitmap and the sample code I found (and posted above) doesn't check to see if the bitmaps are processed successfuly.  You might want to check for null bitmaps because I got a corrupted one and it made both not work.

 

Also, reset after loading your code, even if you get an exception when loading it.  For some reason I got an exception (bad arg as above) but after a reset it worked.  This was on the simulator; don't know if it'll be the same on a real device.

 

Good luck.

New Developer
Posts: 7
Registered: ‎08-12-2008
My Device: Not Specified

Re: Alternate Entry Point

I actually face this very behavior. The latest app I've developped throws the exception ONLY on first launch right after instal and reboot (it then obviously ignores rollovericon and option provider stuff I implemented there).

Pretty strange actualy as it behaves OK in the sim, throwing the Exception only if a bad index is specified.

On a real device it basically always (whatever the index) throws the Exception but only on first time and not anymore after I reboot...

 

I tend to think it's not that much related to the index I use... even tried to sequentially use 1, 2, 3, etc. (though your method + simulator gave me the supposed correct index)

 

I'll do some more investigation...

 

I'm afraid I might need luck :-)

 

Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: Alternate Entry Point

The knowledgecenter article is in error, and this is still a bug which has never been resolved.  I get the error sometimes on some hardward, even if compile with the BB JDE.

 

First, you have to realize (this is NOT in the knowledge base article) that the "index" must be 1, as the index 0 (the default) module is the hidden (system) autostart entry point.  It is mdule 2 (ie index 1) that must have an icon.  You can easily see this if you just do not mark the first hidden (system), and then give them each distinct titles (such a mod 1 and mod 2).

 

It would be nice if RIM addressed this bug.  It scares users and leads to many unneccessary contacts to support.

 

RIM are you listening?  Even Idea and ToDo Matrix have this issue, and they write quality software!

 

I wouldn't hold your breath for a fix.  Smiley Happy

 

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Alternate Entry Point

You can run into a race condition if the BlackBerry handheld is not restarted when the application is installed (such as when performing an over the air download using the browser).  The issue is that the auto start application could run and attempt to set the icon for an entry point that has not been registered with the system (these are happening in parallel).  The work around to this is to catch the exception, pause for a short time and try again.  This doesn't occur after a reset since the entry points have been registered.

 

Version 4.7.0 of the BlackBerry JDE and the BlackBerry JDE Plug-in for Eclipse have simplified setting the rollover icon.  This can now be done in the project properties and doesn't require any coding.  To specify the rollover icon, right click on the project in the BlackBerry JDE, select Properties, click on the Resources tab and add your rollover icon in the Focus icon files section.  Note that this also requires BlackBerry handheld software version 4.7.0 and higher.

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