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
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel
Accepted Solution

Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Unable to open a url like www.yahoo.com or www.google.com   with html5 web app  on the BB 7.0 OS device/mobile where as it is opening in the simulator

 

 

My code is as follows:

 

 

config.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0" rim:header="WebWorks Sample">
<name>Google</name>
<description>This is HelloWorld.</description>
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />
<access uri="http://www.google.com/" subdomains="true" />
<access uri="*" subdomains="true" />
<icon src="icons/icon.png" />
<content src="index.html"/>
</widget>

 

 

 

index.html

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,
user-scalable=no">
<title>Google</title>
<script>
function toBrowser(){
var args = new blackberry.invoke.BrowserArguments('www.google.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}
</script>
</head>
<body>
<p onClick="toBrowser()" >Google</p>
</body>
</html>

 

 

 

The ror  while opening the application or clicking on the icon on the device is 

 

 

"The Protocol specified is not supported by the handheld.Please try a different URL. "

 

 

Please   solve my issue   . 

Developer
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Are you getting this error in the simulator?  Have you allowed intenet access for the simulator in your firewall?

If it helped you, click like. Smiley Happy
Trusted Contributor
Posts: 176
Registered: ‎01-20-2013
My Device: Bold 9790
My Carrier: Telus

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Don't you have to specify a protocol like http:// ?

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Do you mean to say  .   There is no need of putting http ?        please be clear I will update u anyhow by removing hettp.

 

 

Iam facing this problem only on the device.

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

it should be like this

var args = new blackberry.invoke.BrowserArguments('http://www.google.com');
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

[ Edited ]

Thank you   and   Yes SumiGhosh It is now working very fine. Wai I have a specific url let me test that  for my project and update u soon.

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Ok fine...
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

Wow   my specific url is also working and opening thank u very much SumiGhosh    .can I   have ur facebook id  if u

 

dont mind ?

 

 

I have lot or queries in future regarding my complete project

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

One last query in this topic  is   if I want to opening a website called www.google.com  directly without any click etc  after opening the aqpplication?

 

 

I mean I want a application   with which,  after clciking onthe icon of the application the   website should be opened.

 

 

 

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Unable to open a url like www.yahoo.com or www.google.com with html5 web app on the BB 7.0 OS device/mobile where as it is opening in the simulator.

[ Edited ]

for that you can do something like this.... remove the p tag
i.e <p onClick="toBrowser()" >Google</p>

and change the script like this

<script type="text/javascript">
function toBrowser(){
var args = new blackberry.invoke.BrowserArguments('www.google.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}

toBrowser();
</script>


this must work.....