0
votes

I am working on developing Blackberry application using PhoneGap framwork. I have executed the sample app using below link

http://wiki.phonegap.com/w/page/31930982/Getting%20Started%20with%20PhoneGap%20BlackBerry%20WebWorks

But browser is not working in my Simulator.I mean if I try to goto Google site I am getting below error

enter image description here

I tried following steps too 1)I have installed 'BlackBerry Email and MDS Services Simulators 4.1.2' 2)Run the MDS and Run my application

Even I am getting issue. Please advice!

Device details: Windows OS,PhoneGap,BlackBerry Email and MDS Services Simulators 4.1.2,Simulator:9550,BlackBerry WebWorks SDK 2.3.1.5

Config.xml

<?xml version="1.0" encoding="UTF-8"?>

<!--
  Widget Configuration Reference:
    http://docs.blackberry.com/en/developers/deliverables/15274/
-->

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
    version="1.0.0.0">

  <name>Corperate Directory</name>
<access subdomains="false" uri="http://www.google.com"/>


  <description>
      A sample application written with Cordova.
  </description>

  <license href="http://opensource.org/licenses/alphabetical">
  </license>

  <!-- Cordova API -->
  <feature id="blackberry.system" required="true" version="1.0.0.0" />
  <feature id="org.apache.cordova" required="true" version="1.0.0" />
  <feature id="blackberry.find" required="true" version="1.0.0.0" />
  <feature id="blackberry.identity" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
  <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
  <feature id="blackberry.utils" required="true" version="1.0.0.0" />
  <feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
  <feature id="blackberry.app" required="true" version="1.0.0.0" />
  <feature id="blackberry.app.event" required="true" version="1.0.0.0" />
  <feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
  <feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
  <feature id="blackberry.media.camera" />
  <feature id="blackberry.ui.dialog" />

  <!-- Cordova API -->
  <access subdomains="true" uri="file:///store/home" />
  <access subdomains="true" uri="file:///SDCard" />

  <!-- Expose access to all URIs, including the file and http protocols -->
  <access subdomains="true" uri="*" />

  <icon rim:hover="false" src="resources/icon.png" />
  <icon rim:hover="true" src="resources/icon.png" />

  <rim:loadingScreen backgroundColor="#CFCFCF"
                     foregroundImage="resources/loading_foreground.png"
             onFirstLaunch="true">
    <rim:transitionEffect type="fadeOut" />
  </rim:loadingScreen>

  <content src="index.html" />

  <rim:permissions>
    <rim:permit>use_camera</rim:permit>
    <rim:permit>read_device_identifying_information</rim:permit>
    <rim:permit>access_shared</rim:permit>
    <rim:permit>read_geolocation</rim:permit>
  </rim:permissions>

</widget>
1
I don't get it. Why are you going to an external site through phonegap? phonegap is created with the purpose of displaying local html pages as the UI for an application, not to use as a browser, for that, you can use a browser.Th0rndike
yes, but my application is webservice based. Need to implement as Blackberry app.In this case network should work to hit the server! To check my network is working I tried to goto Google site. I need help for the same.Muthukumar
Did you set the proper permissions in the blackberry manifest files?Th0rndike
Sorry I am not aware.. Can you plz explain more!Muthukumar
find between your project files a file named "config.xml" and post it's contents in your question.Th0rndike

1 Answers

-1
votes

You probably need to whitelist google.com in your 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.0.0">
<name>commonPitfalls</name>

    <access subdomains="false" uri="http://www.google.com"/>

</widget>

From: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Common-BlackBerry-WebWorks-development-pitfalls-that-can-be/ta-p/624712

Alternatively, instead of checking google.com, you could use the connection api that PhoneGap offers: http://docs.phonegap.com/en/1.8.0/cordova_connection_connection.md.html#Connection

Or use an xhr to google.com (with the appropriate whitelisting in your config.xml) to see if you get a response that way instead of loading in a page.