{"id":20769242,"url":"https://github.com/rootkot/cordova-phaser2-android-tips","last_synced_at":"2026-03-19T17:27:17.954Z","repository":{"id":235026928,"uuid":"226400731","full_name":"rootKot/cordova-phaser2-android-tips","owner":"rootKot","description":"After hours of headache with setuping cordova let me save some tips for myself, and maybe it will be helpfull for you","archived":false,"fork":false,"pushed_at":"2019-12-16T23:13:51.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T06:48:07.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootKot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-12-06T20:03:18.000Z","updated_at":"2023-09-27T19:38:19.000Z","dependencies_parsed_at":"2024-04-22T03:09:55.835Z","dependency_job_id":"8dcc7947-8247-4135-9ca1-b1b2b65072b4","html_url":"https://github.com/rootKot/cordova-phaser2-android-tips","commit_stats":null,"previous_names":["rootkot/cordova-phaser2-android-tips"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootKot%2Fcordova-phaser2-android-tips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootKot%2Fcordova-phaser2-android-tips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootKot%2Fcordova-phaser2-android-tips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootKot%2Fcordova-phaser2-android-tips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootKot","download_url":"https://codeload.github.com/rootKot/cordova-phaser2-android-tips/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243099581,"owners_count":20236237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T11:42:57.383Z","updated_at":"2026-03-08T08:37:57.054Z","avatar_url":"https://github.com/rootKot.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# cordova-phaser2-android-tips\nAfter hours of headache with setuping cordova let me save some tips for myself, and maybe it will be helpfull also for you :)\n\n# Preparing to install cordova\n1. Java Development Kit 8 (JDK)\nhttps://www.oracle.com/java/technologies/jdk8-downloads.html\n2. Android Studio\nhttps://developer.android.com/studio?pkg=studio\n\nNote: Be sure that PATHs is setted\nWindows - https://evothings.com/doc/build/cordova-install-windows.html\n\nFrom Android Studio -\u003e Sdk manager installing android versions. I setuped 28v.\n\n# Cordova\n```\nnpm install -g cordova\ncordova create projectDirectory com.companyName.appName AppName\n```\n\nlets move to installed project directory and add android platform\n```\ncordova platform add android\n```\n\nAfter that, we can place our web source into 'www' directory, and try to build.\n```\ncordova build android\n```\nIf you facing the error that the taget is not specified then specifie it in platforms/android/build.gradle\n\nIn my case my game on phaser2 was realy bad performance, so I decided to change default WebView to ChromeView.\n\n# cordova-plugin-crosswalk-webview\nThis is a cordova plugin for solving our issue.\nhttps://github.com/crosswalk-project/cordova-plugin-crosswalk-webview\nBut as my cordova version is 9 this plugin wont work for me, so I found forked one which is solves my issue.\nhttps://github.com/ardabeyazoglu/cordova-plugin-crosswalk-webview-v3\nLets add it as plugin\n```\ncordova plugin add cordova-plugin-crosswalk-webview-v3\n```\n\nAfter that I had issue something like \"the minimum SDK version is setted 16\" (actually don't remember the error :) )\nSo I found all places where minSdkVersion was 16 and changed to 19.\n\n## IMPORTANT (what if performance still sucks?)\nFor good performace we need add --ignore-gpu-blacklist attibute in our config.xml\n```\n\u003cpreference name=\"xwalkCommandLine\" value=\"--ignore-gpu-blacklist\" /\u003e\n```\n\n## If your configurations not make changes\nTry to set performance options directly in /platforms/android/android.json\n\n# Lets lock orientation and make it fullscreen without status bar and buttons!\nhttps://github.com/apache/cordova-plugin-screen-orientation\n```\ncordova plugin add cordova-plugin-screen-orientation\n```\nhttps://github.com/apache/cordova-plugin-statusbar\n```\ncordova plugin add cordova-plugin-statusbar\n```\n\nand in www/index.html adding \u003cscript\u003e tag with the following code\n```\n  document.addEventListener(\"deviceready\", onDeviceReady, false);\n  document.addEventListener(\"resume\", onResume, false);\n  function onDeviceReady() {\n        screen.orientation.lock('landscape');\n        StatusBar.hide();\n  }\n  function onResume() {\n        StatusBar.hide();\n  }\n```\nAlso do not forget to add cordova.js before your script\n  \u003cscript type=\"text/javascript\" src=\"cordova.js\"\u003e\u003c/script\u003e\n\nAnd for fullscreen adding this preference:\n```\n\u003cpreference name=\"Fullscreen\" value=\"true\" /\u003e\n```\n\n# Finnaly my XML configurations look like this\n```\n    \u003cpreference name=\"webView\" value=\"org.crosswalk.engine.XWalkWebViewEngine\" /\u003e\n    \u003cpreference name=\"xwalkVersion\" value=\"23+\" /\u003e\n    \u003cpreference name=\"xwalkLiteVersion\" value=\"xwalk_core_library_canary:17+\" /\u003e\n    \u003cpreference name=\"xwalkCommandLine\" value=\"--ignore-gpu-blacklist\" /\u003e\n    \u003cpreference name=\"android-hardwareAccelerated\" value=\"true\" /\u003e\n    \u003cpreference name=\"xwalkMode\" value=\"embedded\" /\u003e\n    \u003cpreference name=\"xwalkMultipleApk\" value=\"false\" /\u003e\n    \u003cpreference name=\"android-minSdkVersion\" value=\"19\" /\u003e\n    \u003cpreference name=\"Fullscreen\" value=\"true\" /\u003e\n    \u003cpreference name=\"StatusBarOverlaysWebView\" value=\"true\" /\u003e\n    \u003cpreference name=\"Orientation\" value=\"landscape\" /\u003e\n```\n\n## Conclusion\nMainly my problem was with performance. And only thing that I needed was adding crossover-v3 plugin and set xwalk to --ignore-gpu-blacklist. After that everything magicly works fantastic! \n\n## What's next? Integrating AdMob!\nhttps://github.com/ratson/cordova-plugin-admob-free\n\n```\ncordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID=\"\u003cYOUR_ANDROID_ADMOB_APP_ID_AS_FOUND_IN_ADMOB\u003e\"\n```\n\n```\nvar admobid = {\n    banner: 'ca-app-pub-3921471305296855/2750437564',\n    interstitial: 'ca-app-pub-3921471305296855/2750437564',\n};\ndocument.addEventListener('deviceready', function() {\n    admob.banner.config({\n        id: admobid.banner,\n        isTesting: true,\n        autoShow: true,\n    });\n    admob.banner.prepare();\n\n    admob.interstitial.config({\n        id: admobid.interstitial,\n        isTesting: true,\n        autoShow: false,\n    });\n    admob.interstitial.prepare();\n}, false);\n\nfunction showInterstitialFunc() {\n    admob.interstitial.show();\n}\n\ndocument.addEventListener('admob.banner.events.LOAD_FAIL', function(event) {\n});\ndocument.addEventListener('admob.interstitial.events.LOAD_FAIL', function(event) {\n});\ndocument.addEventListener('admob.interstitial.events.LOAD', function(event) {\n});\ndocument.addEventListener('admob.interstitial.events.CLOSE', function(event) {\n    admob.interstitial.prepare();\n});\n```\n## Generating Signature\n```\n\"%JAVA_HOME%\\bin\\keytool\" -genkey -v -keystore Santa2020.keystore -keyalg RSA -keysize 2048 -alias santa2020 -validity 20000\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootkot%2Fcordova-phaser2-android-tips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootkot%2Fcordova-phaser2-android-tips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootkot%2Fcordova-phaser2-android-tips/lists"}