Harbour For Android

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Harbour For Android

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Harbour For Android

Post by Pablo César »

Thank you Roberto for your shared info ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Harbour For Android

Post by bpd2000 »

Thank you Mr. Roberto
BPD
Convert Dream into Reality through HMG
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Harbour For Android

Post by mol »

Very nice guide!
Thanks! I'll try it when I find few time.
Last edited by mol on Fri Feb 13, 2015 8:27 am, edited 1 time in total.
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Harbour For Android

Post by dragancesu »

The long awaited

I got to try
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Harbour For Android

Post by serge_girard »

Thanka Roberto!

Serge
There's nothing you can do that can't be done...
jucar_es
Posts: 82
Joined: Thu Nov 13, 2008 11:12 pm

Re: Harbour For Android

Post by jucar_es »

Gracias...

excelente

Como ejecuto

h4aFirstApp.unsigned.apk


En un celular con android 4.0
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Harbour For Android

Post by danielmaximiliano »

Gracias por la informacion Roberto ....
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Renegado
Posts: 83
Joined: Tue Mar 11, 2014 11:59 pm

Re: Harbour For Android

Post 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.
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Harbour For Android

Post 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
Post Reply