How to port my windows project for android?

I did not find very helpful things that explain this process. What I got and did was starting a new project:

  • AIR Mobile AS3 App for Android app

  • created a lib folder and copied into it starling.swc downloaded from starling zip file.

  • Installed from AppMan Flex SDK 4.6.0 + AIR SDK 32.0, AIR SDK 32.0 runtime: Flash Player (SA)

  • Configured application.xml: not sure if the version it displays for

  • <application xmlns=""> had to change to 32.0 render mode - direct

  • created certificate from bat

  • In Project - Properties : SDK using Flex SDK 4.6.0 + AIR SDK 32.0, adding in Compiler options -swf-version=43 which corresponds to 32 allegedly, adding lib\starling.swc string in SWC Libraries

I added in the xml some recommended line that clears the bin in RunApp.bat

:: Clear bin folder and copy over assets to be packaged.
for /D %%p IN (“bin*.*”) DO rmdir “%%p” /s /q
xcopy “assets” “bin” /s /c /y /i /q

in SetupSDK.bat

echo ERROR: incorrect path to Android SDK in ‘bat\SetupSDK.bat’
echo Looking for: %ANDROID_SDK%\platform-tools

echo ERROR: incorrect path to Flex SDK in ‘bat\SetupSDK.bat’
echo Looking for: %FLEX_SDK%\bin

and then what? how do I import things that previously were import openfl.? Now it’s importing import, so what of the windows imports?
Where do I put assets? The same way? What code needs to be converted, what will work from windows build or what has to be changed?

I would test it still as desktop as set in one of the xmls

Do you want to write in ActionScript 3.0 or Haxe?

openfl create project MyNewProject
cd MyNewProject
openfl test android -air

The above will create a new project and will package, build, install and run for Android using the Adobe AIR SDK (run openfl setup air at least once to set the path to your SDK)

You can also do openfl setup android to set the path to your Android SDK/Android NDK in order to run openfl test android for native Android builds… but if you’re interested in AIR perhaps try that first?

We use tools to reduce the amount of scaffolding required and to make it easy to build cross-platform

Well, I have this OpenFl project for windows and im trying to make the app work on android. I tried to save from having to port to android by trying apk like Wine to run an windows exe, and as expected it did not work, so im trying to port my neko project for android. The question is how?

I prefer in Haxe but it has to be Action Script to work for android later on? Trying to save from changing code where possible, AIR Mobile AS3 App has differences in syntax.

My app will be mostly displaying images through menu’s and using mysql DB’s.

The problems even from setup as old tutorials have outdated versions: Flex SDK is 4.6.0 and AIR SDK is 32.0.0, I installed Flex SDK + AIR SDK.

Im not sure if that’s the one needed and I often get errors with failing to find the SDK’s.

Right now im trying as simple as displaying an image project.

Do I need starling.swc ? Im trying such project but the error I get errors related to the SDK paths.
ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'

Looking for: ..\FlashDevelop-5.3.3\Apps\flexsdk\4.6.0\bin

Is there a step by step instructions for it?

Or can someone make a quick display image project that can be tested on desktop for later port to Android?

What do you use to run your OpenFL Windows project?

openfl test windows
openfl test neko
openfl test air
openfl test electron

“windows” uses C++ which is also supported on Android. We currently allow for AIR Android builds but Neko does not support Android and we do not currently have templates for using Electron on Android either

EDIT: In other words it’s usually as simple as running openfl setup android then openfl test android to “port” an OpenFL project from Windows to Android

Only Neko runs it, so yes neko. So, does that mean I can build it for Android from Neko?

If Yes, it asks for Android SDK, Android NDK, Java JDK, what is the step-by-step to get them? I once tried Android SDK that asks to install Android Studio (a whole program) and asks to install Android SDK, is this the only way to get Android SDK? And what about NDK and JDK? Or what is the way to do it from Flash Develop.

And I keep getting wrong paths, asking for platform-tools folder, I had to copy platform tools from the Android Studio because the adb in bin\ folder installed from AppMan was not liked when t rying to run a new ASC3 app project.////These questions are only if the neko project can be built for android.

Or if Not doable (the port from Neko), then would it work by re-writing some of the code for AS3? Like starting AIR Mobile AS3 App and doing in this way. Then do I need the Starling framework because im new to the whole Android thing, or what step-by-step way to build the code for it?

I am ok writing specific code in AIR Mobile AS3 App if I know im on the right way.

1. Android SDK

The Android SDK includes the Android device tools and Java libraries needed by Android applications.

You will (currently) need the Android SDK with the Android SDK platform tools and the Android API 26 package installed.

Nowadays Google funnels new users through downloading Android Studio, which includes the Android SDK somewhere in its install directory. I have not looked at this recently so I’m not the best person to ask about exactly how to get it.

2. Android NDK

The Android NDK includes the C++ compiler and headers for building C++ code for Android.

Current HXCPP releases and Android device versions should work if you download Android NDK r12b through r15c. I would recommend r15c for now, an upcoming HXCPP release will likely add support for the newer NDK versions.

3. Java JDK

The Java JDK includes a compiler for Java content needed for Android.

I believe current Android tools are compatible with Java 8 (but not Java 9 yet) so download the latest Java 8 JDK (Java Development Kit) and install it. You need the JDK (which includes a JRE) and not just the JRE (Java Runtime Environment) because we will need to compile Java code.

4. openfl setup and/or openfl config

When the Android NDK, SDK (with needed packages) and the Java JDK are ready on your system, you can tell OpenFL where these are located. You can do this by running openfl config or openfl setup as a short-hand for the Android target.

openfl config ANDROID_SDK path/to/android/sdk
openfl config ANDROID_NDK_ROOT path/to/android/ndk
openfl config JAVA_HOME path/to/java/jdk

You can also run openfl config or openfl config JAVA_HOME to print a list of all your current defines or to print the value of a single define.

openfl setup android

“setup android” runs a wizard to configure ANDROID_SDK, ANDROID_NDK_ROOT and JAVA_HOME for you.

It is also possible to run OpenFL on an unconfigured system if these are set as environment variables but I would recommend setting it above as a more convenient way to handle it

Adobe AIR Setup

If you would prefer to try Adobe AIR, download and extract the Adobe AIR SDK on your system, then run openfl setup air and specify the path.

Run openfl test air to build and run the application on your desktop using AIR. You can use either openfl test android -air or openfl test air -android to build, package and run as an AIR Android application

Thanks but I did not understand what I can do and what I cannot. I tried Android SDK and it comes as 1GB software where you have to use im not sure another language for coding or the way it works is different and not clear unlike using FlashDev and my plan is to use FlashDevelop and port it to android apk.

So, my question would be basic but anyway: if I have neko project, how does building for APK work with the coding? Do I have to turn all classes and everything coded into AS3 as I’m about to start or any of the above information can make it work with the haxe code I use for the neko project without much conversion? For example when I created an html5 project besides finding where to put it online, I did not have to convert any code. I know Android is much different, so this was my question mostly. If there is a tutorial on such steps I am Ok to look them up

Have you tried running these three commands on the one OpenFL project?

openfl test neko
openfl test flash
openfl test html5

Like you said, “when I created an html5 project … I did not have to convert any code”

openfl test air
openfl test windows
openfl test android

These are the same, but require additional libraries to compile.

I was just starting to use AS3 but of course if I can keep the current code, best is to try to build from the openfl project.
Yes I would try test android (or F5 in android in Flashdevelop), it asks for platform-tools/build-tools/

Error: Cannot find directory “C:\Programs\FlashDevelop-5.3.3\Apps\flexairsdk\4.6.0+32.0.0\platform-tools/build-tools/”

I downloaded android SDK Platform tools from here

And this must be build tools

^ is this enough for Android SDK? I found also
That has, or the above 2 are enough?

downloaded NDK

downloaded JDK

I set the folders im only not sure what SDK folder should be - the platform tools or build tools? But by directing to platform tools from the above it should be that? here are my paths:

Path to Android SDK [C:\Programs\Android Development\platform-tools]: (contains adb, other files and the build-tools folder)
Path to Android NDK [C:\Programs\Android Development\android-ndk-r20]:
Path to Java JDK [C:\Programs\Android Development\jdk1.8.0_221]:

Getting these errors when compiling to android from my main project

‘arm-linux-androideabi-g++’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not create PCH
Build halted with errors.

I’m asking this, let’s say I start a brand new OPenFL project .hxproj that has Main.hx. I test some display image in neko build. Works? Good. Now let’s select android. What do I need to set up for it to make it all correctly? Including the project.xml, maybe if I have to change Platform in Project-Properties and so on. For that I get the error:

in NativeCFFI.hx error: function body required
@:cffi private static function lime_jni_create_method(className:String, method:String, signature:String, isStatic:Bool, quiet:Bool):Dynamic;

you don`t have to setup android enviroment manually. There is no problem with your app (probably), Haxe code and project.xml is exactly the same for any platform. There is a problem with environment, every platform can be compiled with proper environment, so compiler can get what is needed

All this “unrecognize” mean haxe can`t find proper libraries, so you have to do “test” and follow errors to set up this stuff

That’s the problem, im not sure how to solve these errors thats the reason for asking in the first place lol

n NativeCFFI.hx error: function body required
@:cffi private static function lime_jni_create_method(className:String, method:String, signature:String, isStatic:Bool, quiet:Bool):Dynamic;

Since I dont touch in-built stuff and cant find how to fix this, it is why im asking

Is that using the openfl test android command?