development <<< haxeflixel & vscode -> playstore apk
  1. create new flixel project and configure it for vscode comfort editing
  2. add admob advertisement [2018 extension-admob fail and looks dead for new haxeflixel environment]
  3. build debug apk , prepare project for build release
  4. create release key -> build apk -> sign apk use release key
  5. build next version of app (create updated version of apk, which can be uploaded in playstore as app update)
  1. create new flixel project and configure it for vscode comfort editing
    1. create the new project folder "appname"
    2. open console/terminal inside "way/appname" folder
    3. console
      haxelib run flixel-tools tpl -n appname
      "Enter". This create new project named "appname" inside "way/appname" directory
    4. console
      haxelib run flixel configure . -ide vscode
      "Enter". This configure all projects in subdirectories for comfort vscode editing
    5. copy codingtimecounter.py to "way/appname"
    6. run vscode -> tab files explorer -> open folder -> choose "way/appname/appname"
    7. vscode 'Ctrl + Shift + P' -> type 'run task' -> press 'Enter' -> press 'down arrow' and choose 'html5 debug/neko debug/cpp debug', press 'Enter', will be run debug your project, and will created 'export' path. Keep html5/neko export path in project and this path allow vscode haxe highlight working good. The "cpp debug" is prefered way, but first compilation need some times, depend from your PC speed, 10 .. 20 minutes. The "html5 debug/neko debug" faster but not full functional sometimes.
    8. vscode -> Ctrl+Shift+P -> Haxe: Restart Language Server -> "Enter" . If haxe code highlighting freeze or other problems
    9. "appname/.vscode/tasks.json" -> move the 'isBuildCommand': true, syntax from "flash debug" section to "cpp debug" section. Now "Ctrl+Shift+b" will run "cpp debug" build.
      Deprecated 2018-01-26, now need move "group": { "kind": "build", "isDefault": true },
    10. "appname/.vscode/settings.json" move up targets and comment others
      
          "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.
    11. add in Project.xml
      <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)
    12. done
  2. add admob advertisement
    1. create banner and interstitial inside admob account
    2. copy to comfort place bannerid and interstitialid of created banners
    3. add Ads.hx to "appname/source" folder (predetermined file with my personal implementation of the official extension-admob)
    4. add in Project.xml
      <haxelib name="extension-admob" />
    5. add in Main.hx
      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.
      0 - calls before next show.
      Change "false" to "true" in testing time.
      Show banner inside "create()" syntax of PlayState's.
      Hide banner before every "FlxG.switchState..." call.
    6. later use
      Main.ads.showbanner(); //banner
      Main.ads.hidebanner(); //banner
      Main.ads.between(); //interstitial
      
    7. done. Ads will be displayed only on android device. Cpp, Neko, Html5 builds can't show this.
  3. build debug apk , prepare project for build release
    1. look like haxeflixel use one debug key for signing debug.apk files. As result if one app without release key signing installed on android device, then second app cant be installed before removing first. Will repeating error in installation process.
    2. open console in "way/appname/appname" folder where placed file "Project.xml"
    3. console
      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)
    4. copy file "way/appname/appname/export/android/bin/bin/AndroidManifest.xml" to folder "way/appname/appname/assets/data"
    5. add in file "way/appname/appname/assets/data/AndroidManifest.xml"
      <manifest ... android:versionCode="1" android:versionName="1.0.0" package="com.appname.myapp">
      <application android:debuggable="false" ... android:label="appname">
      <activity ... android:label="appname" ...>
    6. add in Project.xml
      <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
    7. to use auto generating(autoexport from svg to few png with different sizes) icons for apk build, draw icon file, named "icon.svg", and place it into folder "way/appname/appname/assets/images/icon". Supported only simply svg contours placed on one layer(other layers should be deleted from file), multilayers, masks and inkscape filters not supported.
      add in Project.xml
      <icon path="assets/images/icon/icon.svg" />
    8. to use manual created icons, create png icons with sizes 36px, 48px, 72px, 96px named "36.png", "48.png", "72.png", "96.png".
      Place these files into folder "way/appname/appname/assets/images/icon".
      Add in Project.xml
      <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" />
    9. done
  4. create release key -> build apk -> sign apk use release key
    1. open console in keystore folder
    2. console
      keytool -genkey -v -keystore keystorefile.keystore -alias appname -keyalg RSA -keysize 2048 -validity 10000
      "Enter"
      make all steps(you will need type keystore password , and set new password for new alias "appname", the "-alias appname" syntax). At the end (question about data correct) type "yes"and press "Enter". The key will be created. The keystore will be created if it was not created before(first time trying create the apk release key in apk keys folder... you will need to set new password for keystore, and set new password for new alias "appname", the "-alias appname" syntax).
    3. add in Project.xml
      <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" />
    4. open console in folder "way/appname/appname/" where placed "Project.xml" file
    5. console
      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)
    6. done
  5. build next version of app (create updated version of apk, which can be uploaded in playstore as app update)
    1. add in file "way/appname/appname/assets/data/AndroidManifest.xml"
      <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
    2. open console in "way/appname/appname/" where placed "Project.xml" file
    3. console
      lime build android
      "Enter"
    4. done