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
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified
Accepted Solution

How to create a web launcher icon?

I'm not sure where to post this but I'm trying to place an icon on my blackberry. When click I would like it to go to a website. I can't find a tutorial or anything on this. Can someone provide some help on this?

 

Thanks

Please use plain text.
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified

Re: How to create a web launcher icon?

I know somewhere on blackberry's site is a tutorial on this but I can't seem to find it. I saw it just the other day but don't remember how I came across it.
Please use plain text.
JSanders
Posts: 84,430
Likes: 22,909
Solutions: 5,893
Registered: ‎04-01-2008
My Device: Z30 • Z10 • Torch9850 • Playbook
My Carrier: Verizon

Re: How to create a web launcher icon?

[ Edited ]

check this thread here on another forum, you might inquire with the user known as 7100simpleisbetter.

 

 

http://www.blackberryforums.com/aftermarket-software/140100-free-custom-web-shortcuts.html?highlight...

 

Message Edited by JSanders on 12-07-2008 06:23 PM




1. If any post helps you please click the Like Button below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes


Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4   Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA   Display/Scan Bar Code
Please use plain text.
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified

Re: How to create a web launcher icon?

Hmm although I thank you for you help, I was looking to learn how to create them myself. I want to create a few different ones and it would be more useful if I could do it myself.

 

Thanks

Please use plain text.
JSanders
Posts: 84,430
Likes: 22,909
Solutions: 5,893
Registered: ‎04-01-2008
My Device: Z30 • Z10 • Torch9850 • Playbook
My Carrier: Verizon

Re: How to create a web launcher icon?

I understand that, it is a very simple process--I am told. I just know that person could advise you what to do.

 

You can also check with the user here on this Forum "simon hain", I have had him create a webshortcut for me in the past.




1. If any post helps you please click the Like Button below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes


Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4   Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA   Display/Scan Bar Code
Please use plain text.
Developer
Shinebox
Posts: 46
Registered: ‎10-29-2008
My Device: 9700

Re: How to create a web launcher icon?

[ Edited ]

create a custom png that is (I believe) 42x36.

 

 

 

use the java code below to create a web launcher application

 

----------------

 

package yourpackagehere;

 

import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.ui.UiApplication;


/**
 *
 */
class WebLink extends UiApplication{
   
    public static void main(String[] args){
        WebLink instance = new WebLink();
        instance.enterEventDispatcher();
    }
 
    public WebLink() {
        BrowserSession site = Browser.getDefaultSession();
        site.displayPage("http://www.yourURLhere.com") ;
        System.exit(0);
    }
   
}

--------------

 

if you're using the BlackBerry JDE, once you've created your project and have this java file in there, right-click to "add file to project".  Then add the png file (it will create an "img" folder).  Now, right-click the png in the jde now, and select "properties", then click "use as application icon".  I believe you also select "file is generated". 

 

I'm still a newbie too, but this code helped me out quite a bit.

 

 

 

Message Edited by Shinebox on 12-07-2008 10:29 PM
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to create a web launcher icon?

while the code above is correct you can achieve it a tiny bit simpler (and cleaner) when using Application instead of UiApplication. No need to create an instance, you can call the browser in the static context.
There are also a few lines more that provide a rollover image:
public static void main(String[] args) {
/*
* alternate entry point used by the autostart project
* to provide a rollover icon
*/
if (args.length>0 && "autostartup".equals(args[0])){
HomeScreen.updateIcon(Bitmap.getBitmapResource("icon.png"), 0);
HomeScreen.setRolloverIcon(Bitmap
.getBitmapResource("rollovericon.png"), 0);
} else {
Browser.getDefaultSession().displayPage("www.website.com");
}
}

if you do not know how to define an alternative entry point take a look at the knowledge base:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

while the code is supposed to work with 4.1 upwards i encountered difficulties when we deployed it on 4.1 OS, it ran fine when i removed the rollover code.
----------------------------------------------------------
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.
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified

Re: How to create a web launcher icon?


Shinebox wrote:

create a custom png that is (I believe) 42x36.

 

 

 

use the java code below to create a web launcher application

 

----------------

 

package yourpackagehere;

 

import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.ui.UiApplication;


/**
 *
 */
class WebLink extends UiApplication{
   
    public static void main(String[] args){
        WebLink instance = new WebLink();
        instance.enterEventDispatcher();
    }
 
    public WebLink() {
        BrowserSession site = Browser.getDefaultSession();
        site.displayPage("http://www.yourURLhere.com") ;
        System.exit(0);
    }
   
}

--------------

 

if you're using the BlackBerry JDE, once you've created your project and have this java file in there, right-click to "add file to project".  Then add the png file (it will create an "img" folder).  Now, right-click the png in the jde now, and select "properties", then click "use as application icon".  I believe you also select "file is generated". 

 

I'm still a newbie too, but this code helped me out quite a bit.

 

 

Message Edited by Shinebox on 12-07-2008 10:29 PM

Hmm I tried this code and it loaded up the website but it didn't direct my screen to the browser. I had to manually open up the browser. Is there something I have to call to open the browser?

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to create a web launcher icon?

I have had two problems with this sort of code depending on the OS involved.

 

a) For OS 4.2, the Firewall screen that you need to check to allow access is not displayed.

b) For OS 4.5, the Browser Session was never started (though the URL seemed to make through to the browser).

 

Are either of these your problem?

Please use plain text.
Developer
dmglakewood
Posts: 296
Registered: ‎12-07-2008
My Device: Not Specified

Re: How to create a web launcher icon?


peter_strange wrote:

I have had two problems with this sort of code depending on the OS involved.

 

a) For OS 4.2, the Firewall screen that you need to check to allow access is not displayed.

b) For OS 4.5, the Browser Session was never started (though the URL seemed to make through to the browser).

 

Are either of these your problem?


I'm not sure what the problem was other then the JDE just not supporting vista too well. I had so many problems using Vista, then I got the idea to use my virtural xp machine and everything worked just fine. Same with code signing it wouldn't work in vista but worked just fine in xp.

Please use plain text.