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

Web and WebWorks Development

Reply
New Contributor
narayandevadiga
Posts: 6
Registered: ‎04-09-2010
My Device: 8120
Accepted Solution

Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

Hi all...

I am very new to blackberry aplication development..

 

I want to create web icon on blackberry . i  am using BlackBerry Plug-in for Microsoft Visual Studio

 

Please give any sample code or reference link  on how to create a web icon using BlackBerry Plug-in for Microsoft Visual Studio.

 

please its urgent.


Thanks in advance.

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

By "Web Icon" are you referring to pushing an Icon to the Home Screen of the device? or are you wanting to create a small application that will then launch the Browser when clicked.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
narayandevadiga
Posts: 6
Registered: ‎04-09-2010
My Device: 8120

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

Thanks for your reply..

 

Actually i want to have an icon on home screen .. that will then launch the Browser when clicked

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

There are a couple of ways you can do this with a BlackBerry.

 

1) You can push an icon to the users desktop using BES push or the new WebSignals.  This method doesn't require device side code, but it does require server side code integrated with the BlackBerry Enterprise sever (BES) or with our public WebSignals service

 

2) You can create a small Java application that is installed on the device that will launch the browser to a specific URL.  You will require the Java Plug-in for Eclipse to accomplish this.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
livtext
Posts: 36
Registered: ‎01-20-2010
My Device: 8520

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

 

/*
 * abc.java
 *
 * © <handbo.com>, 2003-2009
 * Confidential and proprietary.
 */

package abc;

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://abc.com/");
site.showBrowser();
System.exit(0);
}
}

 

 

New Contributor
narayandevadiga
Posts: 6
Registered: ‎04-09-2010
My Device: 8120

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

THnks for your reply....

 

unfortunately i am using BlackBerry Plug-in for Microsoft Visual Studio.. so can you please provide .net code for the same...

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Create web icon using BlackBerry Plug-in for Microsoft Visual Studio

[ Edited ]

Hi narayandevadiga,

 

There isn't an equivalent in C#.  The BlackBerry OS will only run Java code.  You will need to use the Eclipse development environment to do target all device OS versions.

 

You can create the same application using a BlackBerry Widget in Visual Studio, but it will only work on OS 5.0 and higher.

 

The equivalent Widget code would look like the following:

 

 

<html>
  <head>
    <script type="text/javascript">
      function doLoad() {
         var args = new blackberry.invoke.BrowserArguments('http://www.blackberry.com');
         blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
         blackberry.app.exit();
      }
    </script>
  </head>
  <body onload="doLoad()">
  </body>
</html>

 

 

You will also want to make sure you have the following feature id's declared in your widget config.xml file:

 

 

<feature id="blackberry.app" version="1.0.0"/> 
<feature id="blackberry.invoke" version="1.0.0"/> 
<feature id="blackberry.invoke.BrowserArguments" version="1.0.0"/> 
<feature id="blackberry.identity" version="1.0.0"/> 

 

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter