Quintus to Android - html

I have tried to Google and read the Quintus wiki but no solution. Why does quintus platformer need server to run? Because this I can't use phonegap nor cocoonjs to convert my project to android game. Is there a better HTML5 2d game engine that I can use without server? Or what can I do to get quintus run as android application?

So I finally managed to get the game running with little bit of help, so I am answering here for myself. To get the game running on Android phone you need to quote some code.
Try commenting out this code from your quintus.js file and try again. I was facing a similar issue, commenting out this code resolved it:
if(document.location.origin === "file://" || document.location.origin === "null") {
if(!Q.fileURLAlert) {
Q.fileURLAlert = true;
alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again");
}
return errorCallback();
Then compile it with CocoonJS Webview+ and install debug.apk to get the game running.

Related

Distriqt GameServices ANE - Apple Game Center Problem

I'me developing a game in AS3 AIR and I'me using Distriqt GameServices native extension.
The problem is that I can not sign in to Apple Game Center.
In the documentation, it's stated that: If Google Play Services aren’t available then you won’t be able to use the functionality in this extension.
And there's a code snippet:
var result:int = GoogleApiAvailability.instance.isGooglePlayServicesAvailable();
if (result != ConnectionResult.SUCCESS) {
if (GoogleApiAvailability.instance.isUserRecoverableError( result )) {
GoogleApiAvailability.instance.showErrorDialog( result );
} else {
trace( "Google Play Services aren't available on this device" );
}
} else {
trace( "Google Play Services are Available" );
//init here
}
That sounds odd to me because Google Play Services are not available on iOS, naturally.
I've tried to skip this step and initialize the service without checking GoogleApiAvailability. But I'm getting this message after a successful initialization and then calling signIn() method:
The requested operation could not be completed because local player has not been authenticated.
That sounds odd too, because this is the authentication method itself!!
I'm almost sure that my setup is correct. And the extension is working fine on Android.
GameServices ANE Version: 5.0.011
Any help is appreciated,
Thanks
Ah, actually that had nothing to do with the Distriqt GameServices, so sorry.
The message "The requested operation could not be completed because local player has not been authenticated." was coming from iOS meaning the Game Center is not activated on the device.
Switching on Game Center in the device (settings-> gamecenter) solved the issue.

Permission issue for appium chrome borwser

I am implementing an appium test on remote android driver, with chrome browser for loading urls.
Some of the Urls are pdfs, and chrome asks to store those files. and appears that chrome doesnt have access to filesystem to store those files, which results in a dialog like below.
Please help me pass that dialog without any manual inputs.
Upon clicking continue, it will load actual permissions dialog from Android.
Here is my code initialize appium capabilities
DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.9.1");
caps.setCapability("deviceName","Samsung Galaxy S9 Plus HD GoogleAPI Emulator");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "Chrome");
caps.setCapability("platformVersion", "8.1");
caps.setCapability("platformName","Android");
caps.setCapability("autoAcceptAlerts", true);
caps.setCapability("autoGrantPermissions", true);
caps.setCapability("chromedriverArgs", "--allow-file-access-from-files");
caps.setCapability("maxDuration", 10000);
and this is the snippet I use to load a Url
driver.navigate().to("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf");
autoGrantPermission also doesnt work in this case because chrome is already installed. Appium team has already rejected this issue -
https://github.com/appium/appium/issues/10008
Please help!
Indeed I had very hard time finding out the solution, but eventually I found a workaround.
The best workaround would have been reinstalling the chrome package. I tried that, but I could not start chrome after reinstalling it, as I had no access to shell, and chromedriver complained. So I left that track.
I tried getting hold of adb command or mobile:changePermissions but for that you need to use server flag --relaxed-security while starting the server, and saucelabs doesnt provide any handy interface to start the server with this flag.
The last resort, I found a solution here - https://stackoverflow.com/a/51241899/4675277 . But just that was not sufficient, because it helped me fix chrome alert, but later on it popped up with another alert with allow and deny, for which another solution in the same question helped me. So this is the code I eventually used -
driver.navigate().to("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf");
String webContext = ((AndroidDriver)driver).getContext();
Set<String> contexts = ((AndroidDriver)driver).getContextHandles();
for (String context: contexts){
if (context.contains("NATIVE_APP")){
((AndroidDriver)driver).context(context);
break;
}
}
driver.findElement(By.id("android:id/button1")).click();
contexts = ((AndroidDriver)driver).getContextHandles();
for (String context: contexts){
if (context.contains("NATIVE_APP")){
((AndroidDriver)driver).context(context);
break;
}
}
driver.findElement(By.id("com.android.packageinstaller:id/permission_allow_button")).click();
((AndroidDriver)driver).context(webContext);
This helps allow all permissions required.

Viewing console output from TVJS

I'm working with the tvOS beta 3 and trying to do some basic debugging on the tvml/tvjs side of things.
Messages logged via console.log(...) in my js files don't appear in the main Xcode output window.
Is there somewhere else I can find these messages or a setting which needs to be configured?
You should actually use the debug console in Safari. (The developer forum suggests you use Safari 9 and upgrade to El Capitan, both of which I have so haven't been able to test with inferior version)
Open Safari > Develop menu > Simulator
Your app name should appear here once and from there you can use the console.
Give it a few seconds to appear, it's not always instantaneous.
You must give a name to the Bundle Identifier in General/Identity (com.yourcompany.appname) to appear the app in the developers tool.
If you are developing a hybrid application (TVML/TVJS + Swift) with TVMLKitchen you can implement a logging function in Swift and use it in the TVJS code. For my projects I use the following code:
Kitchen.appController.evaluateInJavaScriptContext({context in
let printInJS : #convention(block) (NSString!) -> Void = {
(string : NSString!) -> Void in
print("Log: \(string)\n")
}
context.setObject(unsafeBitCast(printInJS, AnyObject.self), forKeyedSubscript: "printInJS")
})

MVC - JSON.stringify not working when publishing app to IIS7

During my debugging phase everything with JSON.stringify(editedRows) was working fine on my local development server. I deployed my app to an IIS7 server and JSON.stringify(editedRows) stopped working when I browsed to the site. When I logged onto the server to launch the app from IIS, JSON.stringify(editedRows) worked. I looked over some posts, but nothing seem to solve this issue. Has anyone run into this issue? Thank you.
$('#SaveJobs').on('click', function () {
var editedRows = getEditedRows(); // get rows from a grid
alert('Before JSON'); // I see this alert
var json = JSON.stringify(editedRows);
alert('After JSON'); // I do not see this alert and my browser keeps waiting
});
well I added a reference to the json2.js script, which I did not have in my library of scripts and it worked. I am still confused on why it was working on my dev machine and when I logged onto the server without this library. I am using IE 10 and my other JS libraries are below. If somebody with more knowledge on this subject know please post it below. Thank you!
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/json2.js",
"~/Scripts/jquery.event.drag.js"

localStorage on wp8 error

I have a WP8 HTML/JS app and I need to save some simple data on the local storage. It should be something very easy, but it is giving my a headache already.
I tried to call the localStorage in many different ways but it doesn't work. The error message I get is:
The system cannot find the file specified.
The strange part, is that the sessionStorage seems to be fine. At least I don't get any error using that object.
Additional info:
- The ways I called localStorage are: localStorage.setItem(), window['localStorage'], window.localStorage, etc. they all say the same message.
- I am developing a Windows Phone HTML app OS8.
- The method I call the localStorage is in $('#channels').bind('pagebeforeshow', function (e, data) {...}
- The only references in the project are .Net for Windows Phone and Windows Phone.
- Some of the js libs I included are jQuery, jQuery mobile and ko.
- I am testing on both WP8 device and Emulator
I prefer not to use phoneGap and any other known db for devices, since I wouldn't like to involve interaction with the native code just to make the call to fetch and save some data.
UPDATE 1:
After thefrontender comment, I investigated one by one my js refs. The problem appear when I add the jqm 1.3 min.
All js are bundled with my app. Any other suggestions?
$(function () {
try {
localStorage.setItem('aaa', 123);
alert(localStorage.aaa);
}
catch (err) { alert(err.message) }
});
And if you replace
alert(localStorage.aaa);
with
alert(localStorage.getItem('aaa');
I got my answer form jQuery official forum after all.
You need to add modernizr with atleast localStorage from HTML5 section.
Add: (first or last doent matter)
as indicated in the following post too:
http://www.pksoftlab.com/?p=1073