BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-03-2007, 02:41 PM   #1
mattmattmatt
New Member
 
Join Date: Jan 2007
Model: 7100
Posts: 2
Default Small App

Please Login to Remove!

Hi, I'm trying to make a tiny app that uses net.rim.blackberry.api.browser.*; to open a website.

I created and compiled a midlet, preverified it and turned it into a .jar (I even have the code signing keys from RIM for the Browser) but what I can't seem to do is convert the .jar into a .cod for OTA installation... I keep getting this error:

Class: SiteLauncher has no member: <init>

Java is not my native language so I'm a little stuck. Is there a step by step guide or can someone tell me how to make this work?

I want to make an app that installs over the air from a website and is desktop item that when clicked takes you to a website.

Last edited by mattmattmatt; 01-03-2007 at 03:56 PM..
Offline  
Old 01-04-2007, 03:52 AM   #2
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

try this:

private static void LaunchBrowser(){
boolean retval = true;
int handle = CodeModuleManager.getModuleHandle("net_rim_bb_brow ser_daemon");
if (handle <=0 ){
retval = false;
System.exit(0);
}else{
ApplicationDescriptor[] browserDescriptors = CodeModuleManager.getApplicationDescriptors(handle );
if (browserDescriptors == null ){
retval = false;
System.exit(0);
}else{
if ( browserDescriptors.length <=0 ){
retval = false;
System.exit(0);
}else{
String[] args = {"url", "http://yourwebsite.com"};
ApplicationDescriptor descriptor = new ApplicationDescriptor(browserDescriptors[0],"url invocation", args,null, -1, null, -1,ApplicationDescriptor.FLAG_SYSTEM);
try{
ApplicationManager.getApplicationManager().runAppl ication(descriptor);
}catch(ApplicationManagerException e){
retval = false;
}
System.out.println("trying website = " + args[1]);
System.exit(0);
}
}
}
}
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 01-04-2007, 09:33 AM   #3
kevin.ross
Knows Where the Search Button Is
 
kevin.ross's Avatar
 
Join Date: May 2006
Location: Franklin, Tennessee
Model: 8300
Carrier: AT&T
Posts: 42
Default

jfisher, that's certainly one way to get the browser up and running, and sometimes the only way to start some applications. If the user is targeting devices > 4.0.0, it may be more concise to accomplish the same thing with the following:

Code:
BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage( "http://www.metova.com" );
I know it was more difficult pre 4.0 so I thought I would mention the shortcut, I hope that it helps.
__________________
Kevin Ross | Metova | www.metova.com
Offline  
Old 01-04-2007, 09:59 AM   #4
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

it's that simple now?!!!!!!

haha, i'll have to go back and rewrite some of my code!
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 01-04-2007, 01:48 PM   #5
mattmattmatt
New Member
 
Join Date: Jan 2007
Model: 7100
Posts: 2
Default

kevin.ross:
The way you described is how I am attempting to do it. I think the problem may be my .jad file doesn't have the right attributes.

jfisher:
Am I to understand that this may not work with devices that are < 4.0.0 and that I should use your code to open a browser/site?
Offline  
Old 01-04-2007, 02:00 PM   #6
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

i've used that class for various sites and clients over the last couple of years without a problem. it should work on older versions of the jde too, can't recall exactly but i think i've been re-using that code snippet since 3.6 (could be wrong bout' that).
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


10 Feet/3M For iPhone 13 12 11 PRO MAX MINI  X XR XS 8 7 Fast Charging USB Cable picture

10 Feet/3M For iPhone 13 12 11 PRO MAX MINI X XR XS 8 7 Fast Charging USB Cable

$5.00



10 feet/3M OEM iPhone 12 11 PRO XS MAX XR 10 8 7 SE Fast Charging USB Data Cable picture

10 feet/3M OEM iPhone 12 11 PRO XS MAX XR 10 8 7 SE Fast Charging USB Data Cable

$4.50



NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch picture

NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch

$31.90



A1618 NEW OEM Battery for MacBook Pro 15

A1618 NEW OEM Battery for MacBook Pro 15" Retina A1398 Mid 2015 020-00079

$43.90



Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C picture

Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C

$17.99



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$40.90







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