Harbour Android Build - A Success with Some Tweaks

988 views
Skip to first unread message

Pritpal Bedi

unread,
Oct 11, 2013, 7:08:04 AM10/11/13
to harbou...@googlegroups.com
Hello Przemek, all

Attached is the andoid.bat and corresponding directory 
listing of complete HB_INSTALL_PREFIXed folder.

Note: if you are trying with the batch file with contents of 
the message from Przemek, then it will be hard. The reason is 
these message lines contain a trailing space when copied,
and which goes inside the batch file. 

It took me a while why I was getting so many errors.
Also I have changed the contents slightly, may be I had 
different ndk. I also changed few sets, which were causing 
the result added multiple times when calling compiler.

Przemek will be pointing them out precisely.


But I could not compile any test application.
The error reported by windows is : could not find 
"hbmk2" as an operable command.


Przemek, thanks a lot.
Now it seems we will be able to build Android apps in very near future.


Regards
Pritpal Bedi
android_build.zip

Przemyslaw Czerpak

unread,
Oct 11, 2013, 11:05:09 AM10/11/13
to harbou...@googlegroups.com
On Fri, 11 Oct 2013, Pritpal Bedi wrote:

Hi,

> Hello Przemek, all
>
> Attached is the andoid.bat and corresponding directory
> listing of complete HB_INSTALL_PREFIXed folder.
>
> Note: if you are trying with the batch file with contents of
> the message from Przemek, then it will be hard. The reason is
> these message lines contain a trailing space when copied,
> and which goes inside the batch file.
> It took me a while why I was getting so many errors.
> Also I have changed the contents slightly, may be I had
> different ndk. I also changed few sets, which were causing
> the result added multiple times when calling compiler.
>
> Przemek will be pointing them out precisely.

my fault sending it as attachment would be much better idea.
I'm attaching it in original version.

> But I could not compile any test application.
> The error reported by windows is : could not find
> "hbmk2" as an operable command.

you need your platform native HBMK2 in the path. You can take
it from your windows build.

> Przemek, thanks a lot.
> Now it seems we will be able to build Android apps in very near
> future.

Native application works nice. They can be executed inside
Android Terminal Emulator (ATE).
Please only remember that in most of Android devices storage
area is mounted without noexec option what block using executable
attribute. It means that you will have to copy final binaries
to some other location. HOME dir is quite good one. You can make
cd
chmod 775 .
cat /sdcard/Download/myprg > ./myprog
chmod 775 ./myprog
./myprog

to
1) change current dir to HOME
2) set attributes for HOME dir (it's necessary sometimes)
3) copy downloaded application
4) set executable attribute to the application
5) execute it.

If you use non iso-8859-1 chars then you can configure ATE to use UTF8.
Set also:
ALT send ESC
Send mouse events
I also have some small patches for ATE which I hope they will be included
in next releases.
You want to execute only one application then you can set in ATE
start command to:
cd ; ./myprog ; exit

best regards,
Przemek
inst-android.zap

Francesco Perillo

unread,
Oct 11, 2013, 11:26:51 AM10/11/13
to harbou...@googlegroups.com
sorry to ask but /sdcard/hbtest on my nexus is dated 2011-04-20 and I reported for sure in the mailing list. At the time I compiled everything on linux.

From what I understand, now it is possible also from windows and there have been changes to the GT subsystems... I don't understand if there are news regarding the "gui" part.



Pritpal Bedi

unread,
Oct 11, 2013, 12:43:55 PM10/11/13
to harbou...@googlegroups.com
Hello Przemek

With harbour/bin/win/mingw/hbmk2, I am able to compile /tests/hello.prg
which produced, plain "hello" file without any extension, which is the 
way *nixes work.
I have Samsung's Note2 tablet. Tomorrow I will try to copy the "hello executable" 
onto that and will describe the success story or the failures. That will be my first 
attempt to explore on Android.

Thanks again for detailed explanation.


Regards
Pritpal Bedi

Massimo Belgrano

unread,
Oct 11, 2013, 1:05:35 PM10/11/13
to Harbour Project Main Developer List.
i not able jet
Wich set CCOMP for windows ndkr9? ( i not find 4.6 and 4.8)
C:\dvl\hb.android must be a empty dir?

Immagine in linea 1


2013/10/11 Pritpal Bedi <bedipr...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Massimo Belgrano
Delta Informatica S.r.l. (http://www.deltain.it/mbelgrano
image.png

Massimo Belgrano

unread,
Oct 12, 2013, 2:12:16 PM10/12/13
to Harbour Project Main Developer List.
Victory

seem that ndk Legacy-toolchains.zip is different from android-ndk-r9-windows-x86.zip also in toolchains folder (grunt google)
seem that harbour require 64 bit ndk

Windows 32-bit android-ndk-r9-windows-x86.zip
android-ndk-r9-windows-x86-legacy-toolchains.zip
Windows 64-bit android-ndk-r9-windows-x86_64.zip  (right for harbour)

android-ndk-r9-windows-x86_64-legacy-toolchains.zip
so now i am able create right executable that i post  in attacched
thank!

c:\harbour\tests>C:\DVL\HB.ANDROID\BIN\HBMK2A HELLO
hbmk2: Elaborazione in corso delle opzioni d'ambiente: -plat=android
       -comp=gccarm
hbmk2: Processing local make script: hbmk.hbm
Harbour 3.2.0dev (r1310111336)
Copyright (c) 1999-2013, http://harbour-project.org/
Compiling 'HELLO.prg'...
Lines 7, Functions/Procedures 1
Generating C source output to 'C:\Users\MBELGR~1\AppData\Local\Temp\hbmk_79rq0e.
dir\HELLO.c'... Done.


2013/10/11 Massimo Belgrano <mbel...@deltain.it>

i not able jet
Wich set CCOMP for windows ndkr9? ( i not find 4.6 and 4.8)
C:\dvl\hb.android must be a empty dir?


HELLO

Rossine

unread,
Oct 13, 2013, 8:15:00 AM10/13/13
to harbou...@googlegroups.com
Hi,

I managed to generate binaries harbour but hbmk2 is generated without extension.

My computer is windows 32 bits.

This is my directory c:\hb.android

C:\hb.android\bin>dir /b
hbpp
harbour
hbtest
hbmk2
hbi18n
hbrun
hbnetio
hbformat
3rdpatch.hb
check.hb
commit.hb
harbour.ucf
hbmk2.el.hbl
hbmk2.en.hbl
hbmk2.es.hbl
hbmk2.es_419.hbl
hbmk2.fr.hbl
hbmk2.gl.hbl
hbmk2.hu.hbl
hbmk2.it.hbl
hbmk2.pt_br.hbl
contrib.hbr
hbmk2a.bat

C:\hb.android\bin>

What I have to do to generate hbmk2.exe for me to test harbour for android ?

Regards,

Rossine.

Massimo Belgrano

unread,
Oct 13, 2013, 12:19:06 PM10/13/13
to Harbour Project Main Developer List.
In prev post of Przemek i read
you need your platform native HBMK2 in the path. You can take it from your windows build.

so i execute before script
cd \harbour
SET PATH=C:\HARBOUR\BIN\WIN\MINGW;%PATH%


2013/10/13 Rossine <qii...@ig.com.br>

What I have to do to generate hbmk2.exe for me to test harbour for android ?

Regards,

Rossine.

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Massimo Belgrano

unread,
Oct 13, 2013, 1:45:08 PM10/13/13
to Harbour Project Main Developer List.
Can be executed out of ate as standard android app?
I notice that in my notebook started from same \dvl\ insta-android.bat and harbour via git i receive error during compilation harbour android


2013/10/11 Przemyslaw Czerpak <dru...@poczta.onet.pl>
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Pritpal Bedi

unread,
Oct 13, 2013, 3:45:10 PM10/13/13
to harbou...@googlegroups.com
Hello Przemek

This query is initiated because of poor knowlegge of linux.

These steps I took:

1. Created tests/hello  with Android build.
2. Sent as an attachement to my email account.
3. Installed ATE on my phone Samsung Galaxy 2.
4. Doloaded from my email account "hello".
5. Executed ATE.

6. I could find "hello" inside the folder ATE landed after execution.
7. Executed  "./hello" 
8  Recieved echo:  ./hello: permission denied.
9. Executed:  chmod 775 ./hello
10 Executed: ./hello
11 Cursor returned back. No message. 

12. It appeared as if 'hello' needed a gt driver
13 So I tried with ./hello //gttrm  or //gtxwc but with same result.

It appear that "hello" was executed successfully but without a window.
I think I am missing some point as to how it has to be compiled,
but what, this I am missing.


Regards
Pritpal Bedi

Pritpal Bedi

unread,
Oct 13, 2013, 8:17:44 PM10/13/13
to harbou...@googlegroups.com
Hi

Disregard.


This query is initiated because of poor knowlegge of linux.

Disregard.

I have got it working on my phone Samsung Galaxy  II.

I was copying wrongly. "hello" works as expected, out of the box.
Now I will try with a client console.


Pritpal Bedi

Pritpal Bedi

unread,
Oct 14, 2013, 1:24:43 AM10/14/13
to harbou...@googlegroups.com
Hello Przemek


I could run a small application ( a client ) on Android via ATE.
 
Application appears, and if we have keyboard with arrow key navigation,
then I can travesr the menu as well.

However here are few glitches I face ( sure that is caused by some misses while compiling ):
The main issue is the SetMode( 25,80 ) which is not honored by the terminal app.
Rows and columns are decided by Android itself, so all rendering goes weired.
I am not linking any GT with it. So probably that would be the issue.
Any guidelines ?


Regards
Pritpal Bedi

Maurizio la Cecilia

unread,
Oct 14, 2013, 11:01:58 AM10/14/13
to harbou...@googlegroups.com
Hi Pritpal,
it's just what I was answering in another thread.
hbrun works fine in android console screen, using th gttrm driver.
other graphics gt, also emulating a console screen as gtxwc, are not supported AFAIK.
I don't know if android supports curses/slang libraries and if gtcrs or gtsln could be used.
Maybe with qt 5.2 and gtqtc a new chance will be available...
Waiting for Przemek's answers...
BR
Maurizio

Przemyslaw Czerpak

unread,
Oct 14, 2013, 2:24:15 PM10/14/13
to harbou...@googlegroups.com
Hi,

Android programs executed in ATE have to use one of terminal
or stdout GTs. By defualt it's GTTRM but it can be also
GTCRS, GTSLN, GTSTD and GTCGI.
GTSLN and GTCRS needs external libraries which user should
install in his env so it's not the best choice for beginners.
In fact they do not give any new functionality in comparision
to GTTRM so there is no reason to use them.
ATE does not support remote terminal window resizing so
SETMODE() will not work. When you change screen orientation
or font size the terminal window is resized and information
about it sent to the application which puts HB_K_RESIZE to
keyboard input queue. It means that it works like GTWVT with:

hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS )

so applications shoud be ready for dynamically changed screen
dimensions. In general it's good practice to write such programs.
If you cannot make it now then as simple workaround you can at
the begining of your code:

WOpen(0,0,maxRow(.t.),maxCol(.t.))

to open virtual window which will protect your screen contents
when terminal is resized.

When we will have our own dedicated for Android GT then we
can try to implement automatic font resizing and add scrolls
if it's not possible to set some font size.
Such functionality should have GTQTC for Android. So far I
haven't tried to compile it and create stand alone Android
application (.apk).
To create .apk we nead native GT. GTQTC can be such GT but
we can also create new one in pure JAVA.

best regards,
Przemek

PC Toledo

unread,
Oct 14, 2013, 5:00:40 PM10/14/13
to harbou...@googlegroups.com

Hi,

My first build...




Regards,
Toledo

Francesco Perillo

unread,
Oct 15, 2013, 6:10:35 AM10/15/13
to harbou...@googlegroups.com
Hi Przemek,
I was wondering in the past which is the best way to use harbour under android and iOs. Both have native and unique GUI frameworks that need complex compatibility layers similar to what hbQt does for Qt.

Using a simulated text-mode console on a mobile screen is very difficult, easier on a tablet, and can be accepted in some vertical markets or for private use. Absolutely can't be accepted for play store and worldwide distribution.

Let's concentrate on text-mode console. GTQTC may be ok but it needs to install Qt libraries... you propose to develop one in pure Java, that would solve android problem.

My proposal is to create a openGL based GT, since openGL ES is present on both iOs and Android. And Qt is now also openGL based....

I read a book about game programming on android and I saw they were using openGL to port old games written in c (the likes of doom, quake and others) to android. It may be possible to adapt the GT we already have and that use "canvas" to create the text-mode screen to use openGL ES (1)....

... just an idea of course...

My final goal is to have a GUI on android... and it probably will be using Qt but a text-mode solution can be ok... :-)

Francesco

Francesco Perillo

unread,
Oct 15, 2013, 6:27:19 AM10/15/13
to harbou...@googlegroups.com

Sorry, message was not complete.
 
I read a book about game programming on android and I saw they were using openGL to port old games written in c (the likes of doom, quake and others) to android. It may be possible to adapt the GT we already have and that use "canvas" to create the text-mode screen to use openGL ES (1)....


GT is of course non limited to put characters on screen but it must also handle input from keyboard and (eventually) mouse.

In the mentioned book there is quite complete code for interfacing with android for input, event handling and other stuff needed on android platform.

Massimo Belgrano

unread,
Oct 23, 2013, 11:30:58 AM10/23/13
to Harbour Project Main Developer List.


2013/10/15 Francesco Perillo <fper...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Dmitry Oleynikov

unread,
Nov 27, 2013, 8:57:26 AM11/27/13
to harbou...@googlegroups.com
Dear friends,
Could you be so kind and publish whole working set of crosscompiler
harbour for android?
I mean archive to unzip and use.

Thank you

2013/10/23 Massimo Belgrano <mbel...@deltain.it>:
C уважением,

Дмитрий Олейников
Reply all
Reply to author
Forward
0 new messages