top of page
  • Writer's pictureVishwas Gagrani

Installing OpenFl

Updated: Dec 25, 2022

Download the installer

To get started first install Haxe from these links:

https://haxe.org/download/

The installer will install both Haxe and Neko.

Haxe setup/installer on windows
Haxe setup/installer on windows

After the installation is complete open a new command-prompt (Windows) or terminal (macOS/Linux) and run these commands:

haxelib install openfl  
haxelib run openfl setup 



In order to check if OpenFL has been installed properly, try running the openfl command:

openfl




 


 

Setting up for Android

Install Lime:

You can skip this step if you have got lime already installed while installing haxe in the previous step. Lime is a flexible, lightweight layer for Haxe cross-platform developers.Lime supports native, Flash and HTML5 targets


To install, open command prompt and run:

haxelib install lime 


Install Java:

After registering and logging into www.oracle.com, java can be downloaded from here:

https://www.oracle.com/technetwork/java/javase/overview/index.html


Install Android:

Install Android Studio from: https://developer.android.com/studio/ Open Android Studio


Go to Tools > SDK Manager > Android SDK > SDK Platforms

Choose the android version. I have chosen Android 8.0 (Api level 26 ) and 9.0 for API level 29.



Now, go to Tools > SDK Manager > Android SDK > SDK Tools

Choose NDK


Click Apply Button




Once done you can use the lime command as follows :

c:\>  lime setup android 

Here is a screenshot from my DOS terminal



Signing the APK for release


It's important to sign your APK before you can upload it for distribution. In fact most possibly you won't be able to create a release version if the apk is not signed. So, this is a very important step.

Open command prompt with admin previliges ( Note: with administrator previliges otherwise keystore file would fail to save in that folder )

Now enter the commands as shown:

c:\Program Files\Java\jre6\bin>keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
 Enter keystore password:
 Re-enter new password:
 What is your first and last name?
   [Unknown]:  v
 What is the name of your organizational unit?
   [Unknown]:  v
 What is the name of your organization?
   [Unknown]:  v
 What is the name of your City or Locality?
   [Unknown]:  v
 What is the name of your State or Province?
   [Unknown]:  v
 What is the two-letter country code for this unit?
   [Unknown]:  vv
 Is CN=v, OU=v, O=v, L=v, ST=v, C=vv correct?
   [no]:  y 
Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of 10,000 days
 
for: CN=v, OU=v, O=v, L=v, ST=v, C=vv  Enter key password for <alias_name>
  (RETURN if same as keystore password):  [Storing my-release-key.keystore] 

The my-release-key.keystore file has been saved in the same folder ( c:\Program Files\Java\jre6\bin )


Put this file in your source folder. On compilation of your code, you will be asked the password for the keystore and alias. Provide the password and the apk generated this time will be signed apk .


 


136 views

Recent Posts

See All

To parse a Json string you need to use an Array of Object. And then the Object fields can be accessed using Reflection. import openfl.utils.Object; import openfl.Assets; import openfl.display.*; impo

bottom of page