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
New Contributor
YoungInvestorz
Posts: 7
Registered: ‎08-18-2012
My Device: Storm 9530
My Carrier: Digicel

querying BB5 properties

I am currently trying to determine which blackberry.system properties are enable on my BB5 device? I located on BlackBerry site (https://developer.blackberry.com/html5/apis/blackberry.system.html#.get) sample html snippet that I used to query the system properties. I used the sample provided but once the page is load it results in an "Not Found Request URL: http://localhost:8472/blackberry/system/get "  error 404.

 

Can you explain what I am doing wrong?

 

 

Below is the html I am using on my BB5 ..

 

<html>
<head>

<script type="text/javascript">
function getData(){
var req = new XMLHttpRequest();
req.open('GET', "http://localhost:8472/blackberry/system/get", true);
req.onreadystatechange = function(){document.getElementById("mySystemDiv").innerHTML=req.responseText;};
req.send(null);

}

</script>

</head>
<body>
<input type="button" onclick="getData();" value="Populate - System"/>
<div id="mySystemDiv">

</div>

</body>
</html>

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: querying BB5 properties

Hello,

 

Just to make sure we're starting off on the same page here,  make sure your config.xml includes the feature element

 

<feature id="blackberry.system" />

 

Next, I would try this approach instead the URI way, and access the object

 

var bbObject = blackberry.system;

/* bbObject should contain
   .hasCapability
   .hasDataCoverage
   .hasPermission

... and so on
*/

 

 

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.