BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 11-16-2007, 01:00 PM   #21
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default clarification

Please Login to Remove!

Ecarmody - thanks for sharing the code, this was exactly I was looking for and i have already signed my application. I have a small problem, I am not a Java guy so this might be a dumb question. I copied the code as you gave into a .java file and created a MIDlet project but when I say compile all I get the following error.

C:\Program Files\Research In Motion\BlackBerry JDE 4.2.0\bin\rapc.exe -quiet -noconvertpng import=..\lib\net_rim_api.jar;..\lib\net_rim_api.j ar codename=FMobile -midlet FMobile.rapc warnkey=0x4b505454;0x52424200;0x52435200;0x5252540 0
Warning!: No entry points found
WebLaunch: Warning!: No definition found
com.rim.resources.FMobileRIMResources: Error!: Class: WebLaunch has no member: <init>
Error while building project

thanks in advance,

KK


Quote:
Originally Posted by ecarmody View Post
anyways, guruleenyc, here is a complete java app that you can compile with the BlackBerry JDE. It does require the use of a signed element for the "Browser" class element which will cost you or your company $100 to register with RIM.
You can compile run/test this in the simulator without issues, but if you try to download to a device it won't run unless its signed.

To meet all your objects, this isn't exactly a push. However, you can host the compliled application code, which is the .COD file, on your companies web server (needs MIME type set up), and then you only need to email out to your users an email with the http link to the .cod file. They do a "Get Link" in the email and the application gets installed and the icon shows on the BB desktop.

Also, for custom icon, in the JDE tool, you add an icon file to the project, right click on it and set to Application icon. Then complile the app and load to your device.

Code:
package WebLaunch;

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

public class WebLaunch extends UiApplication
{
    
    public static void main(String[] args)
    {
        WebLaunch theApp = new WebLaunch();
        theApp.enterEventDispatcher();
    }

    public WebLaunch()
    {
        BrowserSession browserSession = Browser.getDefaultSession();
        browserSession.displayPage
                ("http://www.google.com");   //or your intranet site
        System.exit(0);
    }
    
}
Regards,
Eric
Offline  
Old 11-16-2007, 02:33 PM   #22
ecarmody
Thumbs Must Hurt
 
Join Date: Apr 2005
Location: Portland, OR., USA
Model: 9800
Carrier: AT&T
Posts: 82
Default

kk - the sample weblaunch app is written as Blackberry CLDC type, not a generic MIDLET. The errors your getting suggest you have the project propertise set to midlet.

In the BlackBerry JDE, open project propertises. On Application tab, set Project Type to CLDC Application. This should then compile.

The code I gave for WebLaunch is BlackBerry specific code since it uses the BlackBerry browser objects. No need to try and make it a generic midlet, use the cldc instead.

Regards,
Eric
Offline  
Old 11-19-2007, 11:13 AM   #23
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default

Eric,
Thanks for the reply. It was very helpful & i got it working
Offline  
Old 11-19-2007, 02:55 PM   #24
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default

Eric,
It is working fine except that the focus does not change to the blackberry browser when using blackberry pearl. Do you know how to fix it?


Thanks,
Krishna

Last edited by kk; 11-19-2007 at 03:21 PM..
Offline  
Old 11-19-2007, 04:43 PM   #25
ecarmody
Thumbs Must Hurt
 
Join Date: Apr 2005
Location: Portland, OR., USA
Model: 9800
Carrier: AT&T
Posts: 82
Default

Possible you need to check to see which browser you want to invoke. Use this link, it shows how to loop through the browsers and launch a specific one.

Livelink - Redirection
Offline  
Old 11-21-2007, 08:46 AM   #26
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default

Eric,
when I do this the browser did launch but when I click hide from the menu then whole blackberry (pearl) freezes.
Offline  
Old 11-21-2007, 11:45 AM   #27
ecarmody
Thumbs Must Hurt
 
Join Date: Apr 2005
Location: Portland, OR., USA
Model: 9800
Carrier: AT&T
Posts: 82
Default

humm ... dunno why that would happen. Possible post your program code.
Offline  
Old 01-18-2008, 11:19 AM   #28
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default

Eric,
I am having a issue with Blackberry Pearl 8100. When I click the icon the browser app loads the application but does not get the focus so I have to manually go and click the browser button.

Can you please tell me what I am doing wrong? or How do I fix it?


Following is the code I am using


package WebLaunch;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.system.*;
import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.servicebook.ServiceRecord;
import net.rim.device.api.servicebook.ServiceBook;
import net.rim.device.api.util.StringUtilities;


public class WebLaunch extends UiApplication
{

public static void main(String[] args)
{
WebLaunch theApp = new WebLaunch();
theApp.enterEventDispatcher();
}

public WebLaunch()
{
//BrowserSession browserSession = Browser.getDefaultSession();
//browserSession.displayPage

launchBrowser("http://mobile.xxxx.com"); //or your intranet site
System.exit(0);
}

public void launchBrowser(String address) {

try {

//try to launch the default browser
BrowserSession browserSession = Browser.getDefaultSession();
browserSession.displayPage (address);

} catch(Exception e) {

//if that fails - like usuall, find an alternate browser to launch
launchAltBrowser(address);

} finally {

}

}

public void launchAltBrowser(String address) {

String uid = null;

ServiceBook sb = ServiceBook.getSB();

//find the browser services on the device

ServiceRecord[] records = sb.findRecordsByCid("BrowserConfig");

if( records != null ) {

int numRecords = records.length;

for( int i = 0; i < numRecords; i++ ) {

ServiceRecord myRecord = records[i];

if( myRecord.isValid() && !myRecord.isDisabled() ) {

uid = myRecord.getUid();

try {

BrowserSession visit = Browser.getSession(uid);

visit.displayPage(address);

//If this config dosent work we will throw an exceptino and move on

//otherwise we will break and quit.
break;

} catch(Exception e) {

//This didnt work - move on to the next one.

}

}

}

}

}




}
Offline  
Old 01-19-2008, 02:08 PM   #29
brcewane
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Default

Just curious..maybe the thread has diverted from the original poster..

But if you have a BES why not just do a Browser Channel Push.. you push web content, and the link to a read and unread icon from the server to the BES via an HTTP POST and it shows up as an icon on the main ribbon.

When the user clicks on it, it opens their browser to that link.

BlackBerry - BlackBerry | Wireless Handheld Devices, Software & Services from Research In Motion (RIM)
Offline  
Old 01-20-2008, 11:54 AM   #30
nerdseeksblonde
New Member
 
Join Date: Jan 2008
Model: 8300
PIN: N/A
Carrier: ATT
Posts: 1
Default helloworld example may help, does this work with VZ?

The JDE helloworld example uses this code, perhaps your focus problem would be solved with this addition ( I haven't tried it as I am using code similar to yours and noted a problem with the 7130 keeping the "blackberry" logo image on the screen until I push the button ):
public HelloWorld()
{
// Push the main screen instance onto the UI stack for rendering.
pushScreen(new HelloWorldScreen());
}
}

/*package*/ final class HelloWorldScreen extends MainScreen implements HelloWorldResResource
{


Does anyone know offhand if VZ lets you load stuff with a minimum of effort? I tested my app, similar to yours but using midlet architecture, on a variety of ATT BB's and it seemed to run consistently. However, I have reports of problems loading onto VZ phones - I'll see if this is part of their walled garden but IIR they aren't alway real open about their restrictions.
Thanks.
Offline  
Old 01-23-2008, 04:54 PM   #31
kk
New Member
 
Join Date: Dec 2004
Model: Pearl
Carrier: AT&T
Posts: 7
Default

I don't know why this started happnening lately. When I install the app OTA i get a message saying it has been successfully installed but does not show option to run nor do I see the icon on my desktop.

Any ideas?
Offline  
Old 03-23-2008, 06:54 PM   #32
buckylastard
New Member
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: att
Posts: 1
Default browser hang-up problem

Hi, I am having a problem with the following code. It successfully opens the browser but hangs up before the designated site loads. Sometimes it will load the page but it frequently fails. I am getting this problem on 8800s and Curves on both BIS and BES. For some reason, hitting the application button seems to force the browser to load the page.

Does anyone have any idea what my problem is?

/*
* mysite.java
*
* © <your company here>, 2003-2005
* Confidential and proprietary.
*/

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

public class mysite extends UiApplication {
public static void main(String[] args){
mysite instance = new mysite();
instance.enterEventDispatcher();
}

public mysite() {
BrowserSession site = Browser.getDefaultSession();
site.displayPage("mysite");
System.exit(0);
}
}

Thanks in advance,
Bucky
Offline  
Old 06-03-2008, 10:55 AM   #33
HAZARD
New Member
 
Join Date: Feb 2007
Model: 8700
Carrier: t-mobile
Posts: 4
Default

Ive found this thread while trying to solve a problem we are experiencing atm.

Unfortunately the solution to my problem was not in here, but I want to answer some of the earlier questions:

Browser starting with empty page (8800/8300):
We have experienced this Problem on Devices using Software Version 4.2 whenever the Browser was previously closed using the red hangup key instead of the escape button or browser menu.
In this case the browser seems to stay in the background and doesnt load the page uppon reinvokation. REALLY closing the browser by escape helps as a workaround.

Browser not getting focus:
There seems to be a bug in 4.2.0 that doesnt put the browser to the foreground when its invoked.
As a workaround add the following lines:

Code:
         BrowserSession browserSession = Browser.getDefaultSession();
         //now launch the URL
         browserSession.displayPage("http://demo.mobilezukunft.de/TelcatWEB/login.jsp");

         //The following line is a work around to the issue found in
         //version 4.2.0
         browserSession.showBrowser();
Hope that helps whoever is crossing this thread next time

regards,

Kolja Märtens
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


National Instruments Mainframe Chassis - NI-PXIe-1071 w/Warranty picture

National Instruments Mainframe Chassis - NI-PXIe-1071 w/Warranty

$690.00



Agilent E1301B Mainframe  9-slots with multimeter, totalizer, and relay muxes picture

Agilent E1301B Mainframe 9-slots with multimeter, totalizer, and relay muxes

$200.00



1 Pcs National Instruments NI PXIe-1071 NI-SD200 Mainframe PXIE-1071 Chassis picture

1 Pcs National Instruments NI PXIe-1071 NI-SD200 Mainframe PXIE-1071 Chassis

$395.00



Tektronix TM503 3 Bay Mainframe With FG 503, DM 502, PS 503 A Modules 120V AC picture

Tektronix TM503 3 Bay Mainframe With FG 503, DM 502, PS 503 A Modules 120V AC

$169.64



NEWPORT 8800 PHOTONICS TEST SYSTEM MAINFRAME picture

NEWPORT 8800 PHOTONICS TEST SYSTEM MAINFRAME

$499.99



MT9810A ANRITSU OPTICAL TEST SET MAINFRAME picture

MT9810A ANRITSU OPTICAL TEST SET MAINFRAME

$500.00







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