Harbour For Android

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 3897
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 132 times

Harbour For Android

Post by Roberto Lopez » Fri Feb 13, 2015 12:51 am

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: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Fri Feb 13, 2015 1:12 am

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: 943
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 117 times
Been thanked: 42 times

Post by bpd2000 » Fri Feb 13, 2015 4:37 am

Thank you Mr. Roberto
BPD
Convert Dream into Reality through HMG

User avatar
mol
Posts: 2801
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 112 times
Been thanked: 52 times
Contact:

Post by mol » Fri Feb 13, 2015 6:32 am

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: 438
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 3 times
Been thanked: 58 times

Post by dragancesu » Fri Feb 13, 2015 7:21 am

The long awaited

I got to try

User avatar
serge_girard
Posts: 1803
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 261 times
Been thanked: 60 times
Contact:

Post by serge_girard » Fri Feb 13, 2015 8:23 am

Thanka Roberto!

Serge

jucar_es
Posts: 75
Joined: Thu Nov 13, 2008 11:12 pm

Post by jucar_es » Fri Feb 13, 2015 8:53 pm

Gracias...

excelente

Como ejecuto

h4aFirstApp.unsigned.apk


En un celular con android 4.0

User avatar
danielmaximiliano
Posts: 2030
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 77 times
Been thanked: 11 times
Contact:

Post by danielmaximiliano » Fri Feb 13, 2015 9:26 pm

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
Renegado
Posts: 77
Joined: Tue Mar 11, 2014 11:59 pm
Been thanked: 3 times

Post by Renegado » Sat Feb 14, 2015 12:05 am

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: 438
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 3 times
Been thanked: 58 times

Post by dragancesu » Sat Feb 14, 2015 9:46 am

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