Page 1 of 2

Harbour For Android

Posted: Fri Feb 13, 2015 12:51 am
by Roberto Lopez
Alexander Kresin work in HWGUI has been a big source of knowledge and inspiration for me.

Indeed, my first 'public' activity in any programming forum (early 2002) was publishing my own HWGUI samples.

Some days ago, He published 'H4A' (Harbour for Android): http://kresin.ru/en/h4a.html

Here is a little detailed tutorial for beginners, about the steps to follow to create your
own .apk for Android written with Harbour:

1. Download 'h4a':

http://kresin.ru/down/android/h4aFirstApp_v4.zip

2. Unzip in C:\.

3. Download Java Development Kit (JDK) for Windows:

http://www.oracle.com/technetwork/java/ ... 33151.html

4. Run it and accept suggested install location (at the date of this post, it is: C:\Program Files\java\jdk1.8.0_31. It will change according version number) .

5. Go to: https://developer.android.com/sdk/index.html ('SDK Tools Only' section, near the end of the page) and download Windows version.

6. Create the folder tree: c:\Android\sdk and install Android SDK there.

7. Run C:\Android\sdk\SDK Manager.exe and follow these directions found in android.com:
As a minimum when setting up the Android SDK, you should download the latest tools and Android platform:
Open the Tools directory and select:
Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools (highest version)
Open the first Android X.X folder (the latest version) and select:
SDK Platform
A system image for the emulator, such as
ARM EABI v7a System Image
8. Edit the file C:\h4aFirstApp\h4a\setenv.bat and change paths according to the location of the tools you've installed. With the versions installed at the time of this post, it should look as this:

Code: Select all

   @set ANDROID_HOME=c:\Android\sdk
   @set BUILD_TOOLS=%ANDROID_HOME%\build-tools\21.1.2
   @set NDK_HOME=c:\Android\android-ndk-r10d
   @set JAVA_HOME=C:\ARCHIV~1\java\jdk1.8.0_31
   @set ADB=%ANDROID_HOME%\platform-tools\adb.exe
   @set ANDROID_JAR=%ANDROID_HOME%/platforms/android-21/android.jar
   @set APPNAME=h4aFirstApp
   @set PACKAGE=su.ak.%APPNAME%
   @set PACKAGE_PATH=su\ak\%APPNAME%
   @set MAIN_CLASS=MainActivity
   @set HRB_INC=c:/harbour/include
Tips:
- You don't need NDK at this time, so, don't care about it.
- Please, be careful: Path names changes with tools versions!
- Do not forget to put your Harbour bin folder in your path.

9. Now, we are ready to create our first .apk. from our demo Harbour program located at
C:\h4aFirstApp\source\testhrb.prg.

You only must to execute C:\h4aFirstApp\build.bat. Once the build process is finished, you'll find
your .apk at C:\h4aFirstApp\bin

10. To test it, you only must to copy the .apk generated file to an Android device
and run it.

You can do that in many different ways. In my case, I do file transfers via FTP and
launch apks from a file management app.

Don't forget to change your device configuration to allow application installation
from sources different than Play Store.

Harbour For Android Site: http://kresin.ru/en/h4a.html

Enjoy!

Roberto.

Harbour For Android

Posted: Fri Feb 13, 2015 1:12 am
by Pablo César
Thank you Roberto for your shared info ! :D

Re: Harbour For Android

Posted: Fri Feb 13, 2015 4:37 am
by bpd2000
Thank you Mr. Roberto

Re: Harbour For Android

Posted: Fri Feb 13, 2015 6:32 am
by mol
Very nice guide!
Thanks! I'll try it when I find few time.

Re: Harbour For Android

Posted: Fri Feb 13, 2015 7:21 am
by dragancesu
The long awaited

I got to try

Re: Harbour For Android

Posted: Fri Feb 13, 2015 8:23 am
by serge_girard
Thanka Roberto!

Serge

Re: Harbour For Android

Posted: Fri Feb 13, 2015 8:53 pm
by jucar_es
Gracias...

excelente

Como ejecuto

h4aFirstApp.unsigned.apk


En un celular con android 4.0

Re: Harbour For Android

Posted: Fri Feb 13, 2015 9:26 pm
by danielmaximiliano
Gracias por la informacion Roberto ....

Re: Harbour For Android

Posted: Sat Feb 14, 2015 12:05 am
by Renegado
Como ejecuto

h4aFirstApp.unsigned.apk
En un celular con android 4.0
Hola jucar_es
Cópialo en la sd card y desde un administrador de descargas o la app ficheros instálalo haciendo tap en él.

Re: Harbour For Android

Posted: Sat Feb 14, 2015 9:46 am
by dragancesu
I guess that the author should be more information and not just congratulations

I tried it and works

Phone MOTOROLA XT615 MOTOLUXE Android version 2.3.7