My html5 game is not working in BB10 simulator - html

I have created one html5 game.
As per bb10 webworks guidelines I have made config.xml file.
my game is working fine in ripple emulator .But when i tested it in BB10 Dev Alpha Simulator only black screen appears..
what is issue??
I have uploaded my code here.
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.5" id="mani" xml:lang="en">
<author href="http://www.example.com/"
rim:copyright="Copyright 1998-2012 My Corp">My Corp</author>
<name>mani</name>
<icon src="logo.png"/>
<content src="index.html"/>
<feature id="blackberry.identity" required="true" version="1.0.0.0"/>
</widget>
And I added script tag in index.html file.
Rest thing is untouched.
index.html
<script src="local:///chrome/webworks.js" type="text/javascript"></script>

If you are getting a black screen, then I expect there is a runtime error that has prevented your game from starting and/or
Here are instructions on how to use remote-web inspector. I recommend connecting, opening the console panel and reloading your app. It should tell you right away if there is an error:
https://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html
Do you have any remote content being used in your app? If so, I suspect the application does not have permission to access that content as I don't see any <access> elements in your config.xml. Make sure you properly whitelist all remote URLs: https://developer.blackberry.com/html5/documentation/access_element_834677_11.html

Related

Why does the code crash in an a-frame, with the error 'core: a-assets warn Asset loading timed out 3000ms'?

My code worked in the morning. I made a few changes and it stopped working. I ran the code reverted to the earlier version and it also stopped working with the following warning in the debug console of visual studio code:
A-Frame:error This HTML file is currently being served via the file:// protocol. Assets, textures, and models WILL NOT WORK due to cross-origin policy! Please use a local or hosted server: https://aframe.io/docs/0.5.0/introduction/getting-started.html#using-a-local-server.
aframe.io/releases/1.2.0/aframe.min.js:23
A-Frame Version: 1.2.0 (Date 2021-02-05, Commit #b220fa00)
aframe.io/releases/1.2.0/aframe.min.js:2682
THREE Version (https://github.com/supermedium/three.js): ^0.125.1
aframe.io/releases/1.2.0/aframe.min.js:2682
WebVR Polyfill Version: ^0.10.12
aframe.io/releases/1.2.0/aframe.min.js:2682
Uncaught Event
core:a-assets:warn Asset loading timed out in 3000 ms
releases/1.2.0/node_modules/debug/browser.js:111
This is the error in the browser console:
I can't figure out why it is not working. I have also used crossorigion=null
Here's the complete code:
<html>
<head>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras#v6.1.1/dist/aframe-extras.min.js"></script>
</head>
<body>
<a-scene>
<!-- Asset Management System -->
<a-assets>
<img id="space" src="space.jpg" crossorigin=null>
<a-asset-item id="spaceship" response-type="arraybuffer" src="spaceship.glb" ></a-asset-item>
</a-assets>
<!-- Sky -->
<a-sky src="#space"></a-sky>
<!-- Spaceship -->
<a-entity gltf-model="#spaceship" scale="0.1 0.1 0.1" animation-mixer="clip: CubeAction; loop: infinite" visible="" position="0 1.096 0" rotation="65.1693655337701 179.9998479605043 0"></a-entity>
<!-- Camera -->
<a-camera position="0 3.0 0" ></a-camera>
</a-scene>
</body>
</html>
My problem was that I wasn't using CORS in write manner. My files in the project are exposed at with extentions "C:/" whereasa cross orgion response request supports only https and remaining other mentioned in screenshot. It can be big problem to security therefore in order to avoid it make a server.
https://stackoverflow.com/a/33801287/16972919
In my case, Coding in VSCode
Install extension "Live Server"
move your file to the current directory that you coded
access or call your file like => ./yourFileName.glb
Open live server at the right bottom of VS Code, That's it
Holp this helps :)

Does Chrome allow auto discovery of OpenSearch?

Our company has an internal website that I am trying to add Chrome Omnibox support for via OpenSearch. The site is built with ASP.NET MVC 5.
I have added the following line to the <head> tag of my layout page:
<link rel="search" type="application/opensearchdescription+xml" title="ABC" href="/abcopensearch.xml" />
Here is my xml document which lives at the root level and is named abcopensearch.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns:moz="http://www.mozilla.org/2006/browser/search/" xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>ABC</ShortName>
<Description>Find all your assets</Description>
<Url type="text/html" method="get" template="https://www.abcstaff.com/Abc?q={searchTerms}"/>
<InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
What am I missing? Did Chrome remove the ability to automatically add search engines? I've restarted Chrome several times.

Push Service plugin for BlackBerry WebWorks 2.0.0.54 error (Cordova 3.2) (newest versions of both SDKs)

I'm trying to use the Push Service plugin in my BlackBerry Webworks app (BB10 in HTML5).
I added the plugin through the command line like the documentation says, and checked that the com.blackberry.push folder was infact inside my plugins folder in my project. I ran the app in my device and the Web Inspector gave the next error:
TypeError: 'undefined' is not an object (evaluating 'window.webworks.defineReadOnlyField')
This error appears when the plugin tries to define the push constants like SUCCESS or INVALID_PPG_SUBSCRIBER_STATE, so obviously the plugin never starts to work and I can't use the push service.
I have my Push credentials fine (they work fine in my OS 7 app), and I was very carefull when I wrote the config.xml file. Here it is:
<widget id="Sample"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0" version="0.0.1">
<name>Sample</name>
<license href="http://www.apache.org/licenses/LICENSE-2.0"/>
<author email="something#somwhat.com" href="http://www.something.com">Something</author>
<content src="splash.html"/>
<access uri="http://www.mypushserver.com/Registro_Portalesv4/modules/Register" subdomains="true"></access>
<access origin="*"/>
<preference name="fullscreen" value="true"/>
<preference name="webviewbounce" value="true"/>
<description>Example</description>
<icon src="img/icono.png"/>
<feature id="blackberry.app"/>
<feature id="blackberry.push" />
<feature id="blackberry.system" />
<feature id="blackberry.invoked" />
<feature id="blackberry.ui.dialog" />
<feature id="org.apache.cordova" required="true" version="1.0.0" />
<rim:permissions>*
<rim:permit>access_shared</rim:permit>
<rim:permit>post_notification</rim:permit>
<rim:permit system="true">_sys_use_consumer_push</rim:permit>
<rim:permit>read_device_identifying_information</rim:permit>
<rim:permit>access_pimdomain_messages</rim:permit>
<rim:permit>bbm_connect</rim:permit>
<rim:permit>run_when_backgrounded</rim:permit>
</rim:permissions>
<rim:invoke-target id="example.sample.invoke.push">
<type>APPLICATION</type>
<filter>
<action>bb.action.PUSH</action>
<mime-type>application/vnd.push</mime-type>
</filter>
</rim:invoke-target>
<!-- Have an invoke entry here for when a notification is clicked on in the BlackBerry Hub -->
<!-- This will cause the application to be opened -->
<rim:invoke-target id="example.sample10.invoke.open">
<type>APPLICATION</type>
<filter>
<action>bb.action.OPEN</action>
<mime-type>text/plain</mime-type>
</filter>
</rim:invoke-target>
</widget>
What I did notice was that the function "window.webworks.defineReadOnlyField" is located in the webworks-1.0.4.11.js file wich I don't have included in my project because I'm using cordova.js as the BlackBerry WebWorks Documentation, Upgrading to WebWorks 2.0 suggested. So I think that maybe the push plugin is not updated for the new SDK or I'm missing something as well.
Any ideas? Thanks in advanced!
PS: I'm porting my app from Phonegap Android, and worked fine when I ported it to Blackberry, except for the plugins, wich I had to add and adapt so they could work (except for the push plugin).
The problem solves by downloading the newest version of the PushService Plugin (updated 10 hours after I posted the question), that has fixed all the problems I mentioned on my question.
Also, don't forget to add a tag with the ppg url to you config.xml file, otherwise the push service won't work.

HTML page to windows gadget

I created a basic HTML5 page with some canvas drawing and third party meter gauge.
The page works well in browser.
I created a Windows 7 gadget out of it like given here: http://blog.brandoncopley.com/?p=69
But the gadget shows only white color.
It seems like no javascript s getting executed or canvas drawing is done.
I have tried following option to resolve the issue: http://www.sevenforums.com/tutorials/140358-gadgets-not-displaying-correctly-windows-7-fix.html
The Reset_gadgets.bat file also did not help.
All other gadgets are working good.
The gadget.xml looks like below:
<?xml version="1.0" encoding="utf-8" ?>
<gadget>
<name>simple</name>
<version>1.0.0.0</version>
<author name="MaxRecursion">
<info url="maxrecursion.wordpress.com" />
<logo src="logo.png"/>
</author>
<copyright>© MaxRecursion.</copyright>
<description>This is a simple gadget.</description>
<hosts>
<host name="sidebar">
<base type="HTML" apiVersion="1.0.0" src="index.html" />
<permissions>Full</permissions>
<platform minPlatformVersion="1.0" />
</host>
</hosts>
</gadget>
I am new with the Windows 7 gadgets, what can be the issue.
Gadgets run on IE7, so they don't support canvas. Excanvas (http://excanvas.sourceforge.net/) seems to work fine, and it's very easy to use. Just download the .js, put it in a folder with your gadget, and call it from the html before you use anything canvas related. That's it, it works its magic by itself, and the canvas tag will work the way it's supposed to.

Make content to scale and fit with PhoneGap (using viewport)

I am trying to adapt and port an old project to PhoneGap.
So far, the project works properly under Android browsers but it doesn't with PhoneGap since it doesn't adapt the content to fit the whole screen. It always leave a blank space and that's not what I would want. PhoneGap doesn't seem to pay attention to my viewport property in the metatag I am using.
I have been doing some tests to find out the problem without any kind of result.
For example, the following test just contains two files: index.html and config.xml
It contains a DIV that is 276 pixels width and I would want PhoneGap to make it fit the whole page as the Android browsers do.
By the way, I am using PhoneGap Build web site to build this test online.
Here is the content of the index.html file (I am not using DOCTYPE to make it simpler but even using it won't work properly):
<html>
<head>
<meta name="viewport" content="width=276, user-scalable=yes" />
<title>Title</title>
</head>
<body>
<div style="width:276px; background-color:orange;">I want to make this div fit to the page</div>
</body>
</html>
And this is the content of the config.xml file (note the preference EnableViewportScale set to "true", but even being set to "yes" won't work):
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.example"
versionCode="10"
version = "1.0.0">
<!-- versionCode is optional and Android only -->
<name>PhoneGap Example</name>
<description>
An example for phonegap build docs.
</description>
<author href="https://build.phonegap.com" email="support#phonegap.com">
Hardeep Shoker
</author>
<preference name="EnableViewportScale" value="true" />
</widget>
So that is. Is there anything that I am doing wrong? How can I archieve what I am trying to do? I am sure it should have a pretty simple solution but I can't find it right now.
Thank you very much in advance and sorry about my English, it's not my native language.
Cheers,
Joan
Try
<meta name="viewport" content="width=276, user-scalable=1" />
or
If you add the following lines to your onCreate() method:
WebSettings settings = this.appView.getSettings();
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
or
try using iScroll 4 (http://cubiq.org/iscroll-4)
Pinch / Zoom
I almost gave up, when I stumbled upon this post:
http://antonylees.blogspot.com/2012/06/phonegap-viewport-size-is-too-small-on.html
Basicly I modified my default AndroidManifest.xml entry from:
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
to
<uses-sdk android:minSdkVersion="7" />
You may play with the version a lil bit. Just don't target version 19 I guess. Plus you may add
target-densitydpi=device-dpi
target-densitydpi=medium-dpi
...
To your meta viewport tag, depending on what you're trying to do.
EDIT:
Ok, here's an exploanation: http://developer.android.com/guide/webapps/migrating.html
Since Android 4.4 (KitKat), WebView has changed with new one based on chromium. By having target version below 19, webview is set in quirks mode.
Note: If your targetSdkVersion is set to "18" or lower, WebView
operates in "quirks mode" in order to avoid some of the behavior
changes described below, as closely as possible—while still providing
your app the performance and web standards upgrades. Beware, though,
that single and narrow column layouts and default zoom levels are not
supported at all on Android 4.4, and there may be other behavioral
differences that have not been identified, so be sure to test your app
on Android 4.4 or higher even if you keep your targetSdkVersion set to
"18" or lower.
PP: Using LG L70 phone.