BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-21-2008, 06:32 AM   #1 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please Login to Remove!

Wirelessly posted

Is there a way to create live on runtime new entry points with diferent argument to send to main entry point???
Offline  
Old 07-21-2008, 12:22 PM   #2 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted

Anyone???
Offline  
Old 07-21-2008, 12:28 PM   #3 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted

Alright... Let's remake the question:
How do I create, via source code, dynamic entry points??????

Someone???
Offline  
Old 07-21-2008, 08:45 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Perhaps no one has answered because no one knows how to do it. I don't think it is possible, if it was it would likely be implemented in net.rim.blackberry.api.homescreen.* but it isn't.

What are you trying to do, it may be that there is a supported way to solve your problem.
Offline  
Old 07-22-2008, 04:33 AM   #5 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hrbuckley

thanks for your answer.... i wasn't expecting a source on how to do it... i'm killing me for 2 weeks just on that problem.... i was expecting some ideas to look further....

well... the homescreen api is for later... for put animated icons, change icon text, CHANGE the app main entry point.... well... i need to ADD an app entry point... dynamically... ADD and REMOVE entry points.... as the user wants.....

actually, the app will always be the same one.... the only thing that will change will be the args....
Offline  
Old 07-22-2008, 06:30 AM   #6 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted

Just complementing...

I want the user to have the ability to add a new icon (entry point), to choose the icon he wants, to choose the icon name.... The only problem I'm having is to add an new icon...

I just saw in the jde debugger that there's a net.rim.device.apps.internal.system.RibbonIconFiel d when I run an app from the homescreen on the simulator... (That class isn't accessible)........ But there's gotta have a way to add a new "RibbonIconField"...
Offline  
Old 07-22-2008, 08:04 AM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Well not there doesn't have to be a way. Part of the implementation of Java is control over access to things that the developer wants to protect. If RIM (or any other library developer) doesn't allow access to RibbonIconField then we can't use it.

You will see lots of examples of this if you poke around in the simulator/debugger enough, but that doesn't mean you can use them.

As the application developer you can create multiple entry points to your application, and set the arguments for each entry point. Using the HomeScreen class you can change the main and rollover icons, perhaps from an icon that the user chooses from a list, website or file. I haven't seen any way to create new entry points to an application on the fly.

You could write an application that starts your main application using ApplicationManager.runApplication() method and allow the user to configure the icon and startup arguments, perhaps by using the OptionsManager/OptionsProvider API. If you compiled the program to multiple names like MyLauncher1, MyLauncher2, ... the user could download as many as wanted.
Offline  
Old 07-22-2008, 12:06 PM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Dec 2005
Model: 8310
Carrier: Rogers
Posts: 138
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

While there is no way to add entry points at runtime, there IS a way to launch your application with arguments.

This will likely achieve what you want. To do so you can try this:

Code:
ApplicationManager.getApplciationManager().launch( "YourModuleName?arg0&arg1&arg2..." );

// then in main ...
public static void main( String[] args ) {
   String arg0 = args[0];
   String arg1 = args[1];
   ...
}
When you enter the main function, you must be sure to check if you already have an instance of the app running so that you don't call enterEventDispatcher on more than one instance of your app.

You can do so by doing this:

Code:
RuntimeStore appReg = RuntimeStore.getRuntimeStore();
Object instance = null;
synchronized( appReg ) {
    instance = appReg.get( APP_ID );
    if ( instance == null ) {
        // you're safe to enter the event dispatcher
        // register your instance in the runtime store
        instance = new MyApplication();
        appReg.put( APP_ID, instance );
        instance.enterEventDispatcher();
    }
    else {
        // Parse your "special" arguments
    }
}
Where APP_ID is some constant int that you define.


However, if all you want is to allow the user to change the icon, then why not use the Homescreen API and the persistent store to persist a Bitmap object in the case of device restarts?
Offline  
Old 07-23-2008, 05:44 AM   #9 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8300
PIN: N/A
Carrier: Vivo
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hrbuckley
yes... i know that... and that's one thing that is really annoying about java.....

but... you gave me some ideia bout what i can do.... :p

-------------------------
CELITE
hmmm... nice... some new idea...... maybe i can add some function using an event dispatcher.... and the nice thing is that i do not need to test for an instance already running... since i'm sure it will not be running...... unless it locks the app before 10 code lines............... :p

-------------------------
thanks people....
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.