July 16, 2019, 06:12:36 AM

Author Topic: My first post, please help me with android sdk correct version for max ng  (Read 1880 times)

Offline eNano

  • Jr. Member
  • **
  • Posts: 12
Hi,
I'm a Blitz3d user and I really want to get into BlitzMax for Android but is a complete unknown subject for me and I don't find any good tutorial to get started.
My first attempt was to compile a sample and run it in a cell phone (Android 6.0.1) but I had no success on that.

I did this so far:
- I've grabbed a copy of Brucey's firepaint demo
- I've unzipped Android NDK r15b
- I've unzipped Apache Ant 1.10.1
- I've unzipped Android SDK tools 26.0.1
- In the sdk manager command line I've installed:
  -platform-tools
  -platforms;android-26
  -system-images;android-19;google_apis;armeabi-v7a
  -tools
  -build-tools;26.0.1
  -emulator

- I've configured custom.bmk according to the tutorial in bmx-ng.com and I've followed all the points in that tutorial as well
The code apparently is compiled successfully but the apk isn't running in the device
- I've tried the demo made by brucey in 2014 ( http://brucey.net/programming/blitz/bmx_ng/demos/android_test_01-debug.apk.zip ) and it works fine

So my question would be: what should I have installed to build an apk with the same features of brucey's test?

Thanks a LOT in advance for any help


Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: My first post, please help me with android sdk correct version for max ng
« Reply #1 on: September 21, 2017, 09:35:21 PM »
Windows? I have not been into BMX-NG lately, but you could try using an earlier build of NG. The last working NDK that I tested with NG was 13b. You can also try checking the log for specific issues.

Offline eNano

  • Jr. Member
  • **
  • Posts: 12
Re: My first post, please help me with android sdk correct version for max ng
« Reply #2 on: September 21, 2017, 10:04:36 PM »
Hi RonTek,
Yes is Windows 7 x64

My checked options in Program menu are:
Build Options>Build GUI App
Build Options>Quick Scan
Build Options>Overload Warnings
Platform>Android
Architecture>ARMeabi v7a

When I press the rocket this is what is shown in the output window

Building firepaint
LoadBMK : E:/REALTIME/BlitzMaxNG/bin/custom.bmk
Loading E:/REALTIME/BlitzMaxNG/bin/custom.bmk
LoadBMK : E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/pre.bmk
Loading E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/pre.bmk
LoadBMK : E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/firepaint.bmk
[ 93%] Processing:firepaint.bmx
"E:/REALTIME/BlitzMaxNG/bin/bcc"  -g armeabiv7a -v -r -s -w -f sdl.gl2sdlmax2d -t gui -p android -o "E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/.bmx/firepaint.bmx.gui.release.android.s" "E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/firepaint.bmx"
Parsing...
Semanting...
Generating interface...
Generating header...
Generating source...
[ 96%] Compiling:firepaint.bmx.gui.release.android.armeabiv7a.c
E:\REALTIME\ANDROID\android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe -I"E:/REALTIME/BlitzMaxNG/mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/pngloader.mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/random.mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/ramstream.mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/standardio.mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/blitz.mod" -I"E:/REALTIME/BlitzMaxNG/mod/brl.mod/appstub.mod" -I"E:/REALTIME/BlitzMaxNG/mod/sdl.mod/gl2sdlmax2d.mod"  -DNDEBUG  -w -DBMX_NG -fno-strict-aliasing -fno-exceptions -c -O2 -s --sysroot E:\REALTIME\ANDROID\android-ndk-r15b/platforms/android-12/arch-arm  -o "E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/.bmx/firepaint.bmx.gui.release.android.armeabiv7a.o" "E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/.bmx/firepaint.bmx.gui.release.android.armeabiv7a.c"
[100%] Linking:firepaint
E:\REALTIME\ANDROID\android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe -fPIC -shared  -LE:\REALTIME\ANDROID\android-ndk-r15b/sources/cxx-stl/stlport/libs/armeabi-v7a -Wl,-soname,libfirepaint.so  -Wl,--export-dynamic -rdynamic  -o "E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/libfirepaint.so" "E:/REALTIME/BlitzMaxNG/tmp/ld.tmp" --sysroot E:\REALTIME\ANDROID\android-ndk-r15b/platforms/android-12/arch-arm -Wl,-Bdynamic -lGLESv2 -lGLESv1_CM  -lstlport_shared -llog -ldl -landroid
LoadBMK : E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/post.bmk
Loading E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/post.bmk
"E:\REALTIME\ANDROID\apache-ant-1.10.1/bin/ant.bat" debug
Buildfile: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 26.1.1
 [checkenv] Installed at E:\REALTIME\ANDROID\Android SDK

-setup:
     [echo] Project Name: firepaint
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 26.0.1
     [echo] Resolving Build Target for firepaint...
[gettarget] Project Target:   Android 8.0.0
[gettarget] API level:        26
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for firepaint...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
    [javac] Compiling 2 source files to E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] 3 warnings

-post-compile:

-obfuscate:

-dex:
      [dex] input: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\classes
      [dex] Found Deleted Target File
      [dex] Converting compiled files and external libraries into E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\classes.dex...

-crunch:
   [crunch] Crunching PNG Files in source dir: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\res
   [crunch] To destination dir: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [aapt] Found Deleted Target File
     [aapt] Creating full resource package...

-package:
[apkbuilder] Found Deleted Target File
[apkbuilder] Creating firepaint-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug:
 [zipalign] Running zip align on final apk...
     [echo] Debug Package: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\firepaint-debug.apk
[propertyfile] Updating property file: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\build.prop
[propertyfile] Updating property file: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\build.prop
[propertyfile] Updating property file: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\build.prop
[propertyfile] Updating property file: E:\REALTIME\BlitzMaxNG\DEMOS\firepaintAndroid\android-project-firepaint\bin\build.prop

-post-build:

debug:

BUILD SUCCESSFUL
Total time: 3 seconds
Executing:firepaint
"E:/REALTIME/BlitzMaxNG/DEMOS/firepaintAndroid/firepaint"

Process complete



Then I grab the "firepaint-debug.apk" file but when I run it an error message says "Sorry. The application FirePaint has stopped." with an Ok button.

Here I've found other people with a similar problem http://socoder.net/?Topic=6323

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: My first post, please help me with android sdk correct version for max ng
« Reply #3 on: September 21, 2017, 10:21:33 PM »
By log I mean the error log on your device, I use CatLog.






Offline eNano

  • Jr. Member
  • **
  • Posts: 12
Re: My first post, please help me with android sdk correct version for max ng
« Reply #4 on: September 22, 2017, 12:19:47 AM »
Ok I didn't know about that kind of log sorry.

I've installed CatLog but is really hard for me to interpret something on it!
I have filtered this lines, could be useful some part of this?

09-21 19:52:15.637 I/ActivityManager(2269): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=net.dabz.test.firepaint/.BlitzMaxApp (has extras)} from uid 10099 on display 0
09-21 19:52:16.044 I/ActivityManager(2269): Start proc 7569:net.dabz.test.firepaint/u0a146 for activity net.dabz.test.firepaint/.BlitzMaxApp
09-21 19:52:17.764 I/LaunchCheckinHandler(2269): Displayed net.dabz.test.firepaint/.BlitzMaxApp,cp,ca,1744
09-21 19:52:17.793 I/WindowManager(2269): Screen frozen for +1s578ms due to Window{20cdf81 u0 net.dabz.test.firepaint/net.dabz.test.firepaint.BlitzMaxApp}
09-21 19:52:18.975 F/DEBUG   (320): pid: 7569, tid: 7639, name: SDLThread  >>> net.dabz.test.firepaint <<<
09-21 19:52:19.025 F/DEBUG   (320):     #13 pc 000d574c  /data/app/net.dabz.test.firepaint-1/lib/arm/libfirepaint.so (Android_InitTouch+40)
09-21 19:52:21.150 W/ActivityManager(2269):   Force finishing activity net.dabz.test.firepaint/.BlitzMaxApp
09-21 19:52:21.206 I/WindowState(2269): WIN DEATH: Window{20cdf81 u0 net.dabz.test.firepaint/net.dabz.test.firepaint.BlitzMaxApp}
09-21 19:52:21.280 I/ActivityManager(2269): Process net.dabz.test.firepaint (pid 7569) has died

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: My first post, please help me with android sdk correct version for max ng
« Reply #5 on: September 22, 2017, 12:34:27 AM »
Yes, starting with NG particularly the latest NG installation is really a pain, but that's given. Perhaps you can just use Dabz build and start from there.

http://www.bmx-ng.com/main/downloads/
http://www.bmx-ng.com/main/tutorials/building-for-android/

If you really wanted to use the latest, then I suggest posting a GitHub issue to Brucey instead and post the complete log txt.

When using CatLog, make sure to clear first the log, run the app, switch and stop the log immediately after the crash. That way you don't have to deal with longer unwanted messages. :)




Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: My first post, please help me with android sdk correct version for max ng
« Reply #6 on: September 22, 2017, 12:40:46 AM »
Any chance not to use Monkey-X and particularly Cerberus-X instead?  It has store services, basic 3D stuff and the HTML5 build among other features and then there's update and support from these awesome gents.  :D

https://www.cerberus-x.com/community/

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 390
Re: My first post, please help me with android sdk correct version for max ng
« Reply #7 on: September 22, 2017, 01:00:27 AM »
Hello eNano,

I installed the Android SDK a while ago so I'll go over what I did. First you need lots of disk space (30 GB) I ended up using 2 partitions. Oh and I think I used Dabz's NG 0.77.

1. Download the Java JDK SE 7, browse to the archived versions. I was using Win7 x64 so I got jdk-7u79-windows-x64.exe the latest is 7u80 which should be fine. Then install and add a new env var: JAVA_HOME = C:\Program Files\Java\jdk1.7.0_79 (or whatever)
2. To get the Android SDK you have to install the latest version of Android Studio bundle which has an SDK manager. I think I installed Android 6.0 (API 23) and probably API 21. The file I have is android-sdk_r24.4.1-windows.zip - I was using Android 5.1. I think the idea here is to install all APIs from the latest to the oldest you want to target.
3. Then download the Android NDK I got android-ndk-r11c-windows-x86_64.zip - I think the SDK manager does this too.
4. Apache-Ant I got apache-ant-1.9.7-bin.zip, if using Java7 the latest would be Apache 1.9.9.
5. Then in custom.bmk I added this - note you shouldn't change the versions without researching it on the Android site.
Code: [Select]
addoption android.home "C:/android-sdk-windows"
addoption android.sdk "C:/android-sdk-windows"
addoption android.ndk "C:/android-ndk-r11c"
addoption android.toolchain.version "4.9"
addoption android.platform "12"
addoption ant.home "C:/apache-ant-1.9.7"

Offline eNano

  • Jr. Member
  • **
  • Posts: 12
Re: My first post, please help me with android sdk correct version for max ng
« Reply #8 on: September 22, 2017, 08:53:54 PM »
Hi RonTek and markcwm,
Thanks a lot for the tips, the first thing I've tried was Monkey-X but I've found it a little confusing compared to blitz3d, one example is the lack of pointers (I'm not a coder, I just try to learn stuffs from forums). I find BlitzMax a little more frendly to me because from one side is widely tested in several forums and there are a lot of resources in many places, and in the other hand is more similar to maxscript from 3ds max with stuffs like pointers, handles, event managers and those kind of things that I'm learning so far. I will try to make BlitzMax NG run following the advises of markcwm but if is too much for me I guess I'll have to try other choices  :(

I don't even know what version of blitzmax ng I'm using, how can I see if is Dabz's?

Offline Pingus

  • Jr. Member
  • **
  • Posts: 91
Re: My first post, please help me with android sdk correct version for max ng
« Reply #9 on: September 22, 2017, 11:51:48 PM »
@Enano,

Just want to say good luck. I followed a similar path a while ago but never was able to make my apk running, so I gave up because Android market is not my primary target anyway. But I will follow your adventures with interrest.
It is really a pity that nowadays there are so few easy to use engines for Android/IOS. To my knowledge, only AGK is pretty straightforward from PC->Android. At the cost of a 'player' running the interpreted basic code.

Offline eNano

  • Jr. Member
  • **
  • Posts: 12
Re: My first post, please help me with android sdk correct version for max ng
« Reply #10 on: September 23, 2017, 12:19:33 AM »
Thanks a lot for your opinion Pingus, I was sniffing a dead end here and your message tells me that too. I have been able to make an apk from monkey-X, using minib3d to make a spinning cube but I'm not feeling comfortable with that language, and my lack of knowledge about java or python or C leaves me practically no stable choices and packages like unreal engine are extremely heavy for what I need.
I guess I'll try a few more tests to see what happens, I'll let you know if I have luck with something

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 390
Re: My first post, please help me with android sdk correct version for max ng
« Reply #11 on: September 23, 2017, 04:27:54 AM »
Hi eNano,

I just called it Dabz's version because he made it, whereas if you go to the official releases on Github you'll see there is no 0.77 so Dabz took the latest source at the time and the version comes from bcc.

I haven't had time to try the latest release 0.87 on Android and I've forgotten a fair bit so can't be much more help but it's not that hard when you know what to do. Brucey's firepaint example is all I built so start with that to make sure your setup is right. Oh, you need to put the resources folder in the main Blitzmax folder IIRC. Also, there may have been a maximum filesize for the apk but I can't remember.

I did need to do a bit of reading (mainly on the Android site) to build up a limited knowledge, you could try some tutorials.