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
Contributor
ckcoleman
Posts: 15
Registered: ‎08-21-2011
My Device: 9930

Webworks Accessing URLS

Hi,

I wondered if someone could help with an app for a school.

 

I have a webapp which I use on different platforms (Android, Apple etc).

 

I do not want the address bar to appear when it is used. I can do this on Apple via meta tags but can't on a blackberry. To get around this, I am trying to use webworks to package the HTML files.

 

I can package it up fine, but whenever I try to access any external URL within it, it just freezes the simulator.

 

I don't really understand the config.xml file but what I have written is below. I wondered if anyone would be able to check if it is correct.  Essentially, I want to be able to access any URL from within my 'app' in full screen mode on a blackberry.

 

Many thanks.

 

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="2.0">

  <name>School App</name>

  <description>
   The School App for BlackBerry provides access to all web services for School
  </description>
  <author>
  Chris
  </author>

  <rim:loadingScreen backgroundImage="icons/splash.png"
                     foregroundImage="icons/tophead.jpg"
                     onLocalPageLoad="true"/>

  <icon src="icons/applogo.jpg"/>

  <content src="index.html"/>

  <feature id="blackberry.ui.dialog" required="true" version="1.0.0"/>
  <feature id="blackberry.app.event" required = "true" version="1.0.0"/>
    <feature id="blackberry.invoke" required = "true"
             version="1.0.0"/>
<feature id="blackberry.app" required="true" version="1.0.0.0"/>
  <feature id="blackberry.identity" required="true" version="1.0.0.0"/>
  <feature id="blackberry.invoke.BrowserArguments" required="true" version="1.0.0.0"/>
  <feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
    <feature id="blackberry.app" required="true" version="1.0.0.0"/>
  <access subdomains="true" uri="*"/>
 
 </access>
 
 
 

</widget>

Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Webworks Accessing URLS

Welcome to the forums!

Make sure you're either connected to the default wifi connection on the simulator or have MDS open (a DOS window with several commands running in the background when the simulator opens).
Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Contributor
ckcoleman
Posts: 15
Registered: ‎08-21-2011
My Device: 9930

Re: Webworks Accessing URLS

Thanks for that.

 

All seems to be fine. Is my config.xml file correct?

 

I have tried to ripple in Chrome - but the page just bombs out with a "Looks like what we have here is a failure to... emulate." And the online version (hosted elsewhere) just gets a white screen when I enable ripple on it. Grrrr

 

All I want is my mobile designed site to run full screen on a blackberry and allow it to access all the links to different places (google docs etc) without opening a browser window.  It was dead easy on Android and iPhone.

 

 

Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Webworks Accessing URLS

The one thing I did notice in your file is the following:

<access subdomains="true" uri="*"/>

</access>

Get rid of the </access>
Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Contributor
ckcoleman
Posts: 15
Registered: ‎08-21-2011
My Device: 9930

Re: Webworks Accessing URLS

[ Edited ]

Hi,

Thanks again. I missed that.

 

 

So far, I can package up the app into a cod file (signed) and install it on to the simulator - runs OK.

When accessing some urls (e.g. Google Calendar etc)- very randomly I get an unable to select correct transport something or other (missed the error message). Is this something I should worry about? Cannot get it to duplicate the error now (grrrr)

 

--- Along with error 104 when clicking on some links and time outs.  Not all though. Some work.

 

 

Apologies for asking probably trivial questions. Support and guidance is very much appreciated.

 

Can I also ask - can host the cod file myself and users can browse to the site to install or do I have to submit to blackberrys store?

 

 

Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Webworks Accessing URLS

Keep the error in mind for when it happens again.

You can host the file on your own web server as long as you're able to serve the correct mimetype.

Check this article for the correct mimetypes:

http://supportforums.blackberry.com/t5/Testing-and-Deployment/The-required-MIME-types-for-a-web-serv...
Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Contributor
mxberry
Posts: 37
Registered: ‎01-21-2012
My Device: Bold 9900

Re: Webworks Accessing URLS

Hi.

 

I have try everything for 1 week now and can get it done. On the ripple simulator works like a charm but before it run on the simulator i get this red error window that saids: Oh Snap! Build request failed with message: error

 

i didn't mind the error cause the same one was showing when i made the PlayBook app that is running fine on my 64GB PlayBook.

 

So when i install the app on my Bold 9900 and i run it i get this error window with a exclamation icon that saids: Error starting AlertaHuracan: Module 'AlertaHuracan' attempts to access a secure API.

 

Here is my XML file code.

 

<?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.0.0">

	<name>Alerta Huracan</name>
	<author>Medios Corp.</author>
	<description>Acceso Directo al Sitio de Alerta Huracan</description>
	<content src="index.html"/>
	<icon src="images/icon.png"/>
	
	<feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
	<feature id="blackberry.invoke.BrowserArguments" required="true" version="1.0.0.0"/>
	<feature id="blackberry.app" required="true" version="1.0.0.0"/>
	
</widget>

 Here is my Html file code

 

<!DOCTYPE html>
<html>
<body>
	<script type="text/javascript">

			//Open the URL
			var url = "http://www.alertahuracan.com";
			var args = new blackberry.invoke.BrowserArguments(url);
			blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

			</script>
</body>
</html>

Hope someone can help me out.

 

 

Contributor
mxberry
Posts: 37
Registered: ‎01-21-2012
My Device: Bold 9900

Re: Webworks Accessing URLS

Anyone???

 

Hi again. I found some problems with my App for Smartphones. The one for PlayBooks works like a charm. The issue goes in the index.html file. When i use this code:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.alertahuracan.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

            //close this app
            blackberry.app.exit();
        }, false);
    </script>
</body>
</html>[/CODE]

I'm not able to sign the app. But when i change the code to this:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.alertahuracan.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    </script>
</body>
</html>[/CODE]

The signing works perfectly but i have closing issues when i load it to my Bold 9900. It runs well at the star but when i close it it stays on. I have to close it twice. :confused:

Hope someone can help me out with this.

Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900

Re: Webworks Accessing URLS


mxberry wrote:

Anyone???

 

Hi again. I found some problems with my App for Smartphones. The one for PlayBooks works like a charm. The issue goes in the index.html file. When i use this code:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.alertahuracan.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

            //close this app
            blackberry.app.exit();
        }, false);
    </script>
</body>
</html>[/CODE]

I'm not able to sign the app. But when i change the code to this:

[CODE]<!DOCTYPE html>
<html>
<body>
    <script>
        window.addEventListener("load", function(e) {
            
            //Open the URL
            var url = "http://www.alertahuracan.com";
            var args = new blackberry.invoke.BrowserArguments(url);
            blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    </script>
</body>
</html>[/CODE]

The signing works perfectly but i have closing issues when i load it to my Bold 9900. It runs well at the star but when i close it it stays on. I have to close it twice. :confused:

Hope someone can help me out with this.


you are missing one of these two lines in your xml files (first is all urls second is that specific one). I usually include both.

 

<access uri="*" subdomains="true"/>
<access uri="http://www.alertahuracan.com" subdomains="true"/>


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!