haxelib run flixel-tools tpl -n appname
"Enter". This create new project named "appname" inside "way/appname" directoryhaxelib run flixel configure . -ide vscode
"Enter". This configure all projects in subdirectories for comfort vscode editing
"haxe.displayConfigurations": [
["export/windows/cpp/haxe/debug.hxml"],
["export/android/haxe/debug.hxml"],
// ["export/flash/haxe/debug.hxml"],
this control intellisense autocomplete. Now after compile "lime build android" "lime build cpp -debug" (or Ctrl+Shift+b "lime build cpp -debug") once each target, you can switch intellisense autocomplete for targets use gear bottom screen "Haxe" -> "Enter" -> select Haxe display configuration -> choose from two variants(others was commented). "android" variant will right showing openfl objects types and parameters for example inside "#if android" haxe condition. "cpp" variant (if it first in list inside setting.json) will work global or inside "#if desktop" haxe condition. Choosing one variant , auto turn off all others.
<haxedef name="HXCPP_CHECK_POINTER" if="debug" />
<haxedef name="HXCPP_STACK_TRACE" if="debug" />
this allow to see additional information(about crushes etc) inside vscode "debug console" (after "Ctrl+Shift+b" command)
<haxelib name="extension-admob" />
class Main extends Sprite
{
public static var ads:Ads;
...
public function new()
{
super();
ads=new Ads("bannerid","interstitialid",30,0,"dn",false);//true = testing ads for app debugging process or can be ban from admob
...
30 - seconds before next show.Main.ads.showbanner(); //banner
Main.ads.hidebanner(); //banner
Main.ads.between(); //interstitial
lime build android
press "Enter" and wait. First time build process will slow, at least 20 minutes, then second etc times will faster, close to 1 minute. Inside "export" folder will be created "android" folder with debug version of apk, placed in "way/appname/appname/export/android/bin/bin/appname-debug.apk". Can be installed to unlocked android device manually, but can't be uploaded in playstore (https://play.google.com/store)<manifest ... android:versionCode="1" android:versionName="1.0.0" package="com.appname.myapp">
<application android:debuggable="false" ... android:label="appname">
<activity ... android:label="appname" ...>
<app title="app name" file="appname" main="Main" version="1.0.0" company="HaxeFlixel" />
<template path="assets/data/AndroidManifest.xml" rename="AndroidManifest.xml" if="android"/>
If Main.hx was renamed for example to M.hx (for short name call syntax) then syntax must be <app title="app name" file="appname" main="M" version="1.0.0" company="HaxeFlixel" />
or will project building error
<icon path="assets/images/icon/icon.svg" />
<icon path="assets/images/icon/36.png" size="36" if="android" />
<icon path="assets/images/icon/48.png" size="48" if="android" />
<icon path="assets/images/icon/72.png" size="72" if="android" />
<icon path="assets/images/icon/96.png" size="96" if="android" />
keytool -genkey -v -keystore keystorefile.keystore -alias appname -keyalg RSA -keysize 2048 -validity 10000
"Enter"
<certificate path="D:/dev/keystorefile.keystore" password="keystore password" alias="appname" alias-password="appname alias password" />
or relative way to "keystorefile.keystore" file (will not work if, for example, the Java SDK(Java SE Development Kit) installed on disk "C" but "keystorefile.keystore" file placed on disk "D" in Windows7 etc)
<certificate path="./keystorefile.keystore" password="keystore_password" alias="appname" alias-password="appname_alias_password" />
lime build android
"Enter" and wait. The second build process will more fast, close 1 minute. Will be created release version of apk, placed in "way/appname/appname/export/android/bin/bin/appname-release.apk". The apk signing will be add automatically. The release version of apk can be installed to unlocked android device manually, and can be uploaded in playstore (https://play.google.com/store)
<manifest ... android:versionCode="2" android:versionName="1.0.1" package="com.appname.myapp">
every next apk release "android:versionCode" must be increased at least 1 from previous version
lime build android
"Enter"