Harbour and Android

781 views
Skip to first unread message

alkresin

unread,
Feb 2, 2015, 6:55:11 AM2/2/15
to harbou...@googlegroups.com
Hi All,

 recently I started experimenting with Android and have created a small demo application. It allows to write your own simple application - just edit the prg source file and rebuild the apk, Some details and an application package - at http://www.kresin.ru/en/h4a.html

Regards, Alexander.

alkresin

unread,
Feb 4, 2015, 2:28:59 AM2/4/15
to harbou...@googlegroups.com
Version 2 is uploaded:

Added additional support for hrb updates. An update module is included in testhrb.prg, it allows to get new hrb files from my site directly from the program.

Regards, Alexander.

Alejandro Padrino

unread,
Feb 5, 2015, 2:01:48 AM2/5/15
to harbou...@googlegroups.com

Is this Harbour compiler for Android?  Or is this a sample application to build .apk files?

alkresin

unread,
Feb 5, 2015, 8:57:52 AM2/5/15
to harbou...@googlegroups.com
> Is this Harbour compiler for Android?  Or is this a sample application to build .apk files?

   This is a sample application, which demonstrates, one of ways to use Harbour code in Android applications.
It build .apk files with .hrb, incorporated in it and provide a way to execute this hrb.

Regards, Alexander.

alkresin

unread,
Feb 5, 2015, 11:03:16 AM2/5/15
to harbou...@googlegroups.com
Version 3 has been uploaded:

Now, if the string, returned by FModExec(), begins with "<html", it is opened not in a TextView, but in WebView widget, i.e. it is possible to use any kind of html formatting, including using of css and javascript. The title of a module is set now to appropriate menu item. The standard icon is changed to Harbour logo.

Regards, Alexander.

Sami Laham

unread,
Feb 5, 2015, 2:52:03 PM2/5/15
to harbou...@googlegroups.com
Hi Alex is very interesting, look like a web-service but run only on-line  may be can use (html5 web-sql) to use in local storage and run off-line like (phonegap or cordova) i will following the next steps. 
Congratulations 

Sami Laham

Anthony Smith

unread,
Feb 5, 2015, 10:33:27 PM2/5/15
to harbou...@googlegroups.com
This looks great!

Is it possible to post a working copy for linux?

it Would appreciate a fully working linux demo so I can take a serious look at it.
I tried the build.sh , modified it and it does not work for me :(

many thx
Anthony

alkresin

unread,
Feb 6, 2015, 6:19:23 AM2/6/15
to harbou...@googlegroups.com
Hi,

 I just uploaded the version 3a, which includes sh scripts for Linux - tested on Debian 7.
Path to JDK ( javac, etc ) isn's set there - it is supposed that it is in your PATH.

Regards, Alexander.

roberto.p...@gmail.com

unread,
Feb 7, 2015, 5:08:01 PM2/7/15
to harbou...@googlegroups.com
Thanks. Great work!

As I've asked in a previous thread, If we could catch webview events from Harbour (ie: form's submit button) we could build our GUIs with plain HTML. 

That could allow us to build simple and lightweight Harbour GUI Android apps.

I hope that this be possible in the future.

Thanks again

Regards,

Roberto.

Francesco Perillo

unread,
Feb 7, 2015, 6:17:34 PM2/7/15
to harbou...@googlegroups.com


On Sat, Feb 7, 2015 at 11:08 PM, <roberto.p...@gmail.com> wrote:

As I've asked in a previous thread, If we could catch webview events from Harbour (ie: form's submit button) we could build our GUIs with plain HTML.

Can't you simulate a button with css and using a standard <a> tag??

I see that QWebPage::acceptNavigationRequest should be overloaded...

You can use hbqt_hbqtableview.cpp as the base to create a HBQWebPage. But then you also need to create a HBQWebView that uses it or QWebView:setPage() to set your object.



Francesco Perillo

unread,
Feb 7, 2015, 6:20:19 PM2/7/15
to harbou...@googlegroups.com

Francesco Perillo

unread,
Feb 7, 2015, 6:26:47 PM2/7/15
to harbou...@googlegroups.com
Ant this other that uses javascript. http://doc.qt.digia.com/4.6/webkit-formextractor.html

roberto.p...@gmail.com

unread,
Feb 8, 2015, 6:19:05 AM2/8/15
to harbou...@googlegroups.com
Francesco,

I guess you are referring to using QT on Android.

I don't want to start a debate about QT pros and cons. The fact is that I simply decided that QT will not be my way on Android.

So, my wish (as I've stated in other thread) is to be able to use plain Harbour for Androind (fast and lightweight) using HTML/CSS/JavaScript GUIs as (ie) RFO BASIC does, meaning, something like this:

html.open
html.load.url "file:///sdcard/rfo-basic/data/myform.html"
do
    html.get.datalink data$
until data$ <> ""
data$ = mid$(data$,5)
print "Form data: "+data$

In addition, you could use strings instead of HTML files, so, we could create our HTML forms dinamycally from Harbour.

input "Name:", name$

frm$ = "<form action=\"form\">Name: <br>" + ~
    "<input type=\"text\" name=\"name\" value=\"" + ~
    name$ + "\"><br><br>" + ~
    "<input type=\"submit\" name=\"submit\" value=\"submit\">" + ~
    "</form>"
html.open
html.load.string frm$
do
    html.get.datalink data$
until data$ <> ""
data$ = mid$(data$,5)
print "Form data: "+data$ 

The possibilities are huge.

Note that only three things are required to make this work: html.open, html.load and html.get.datalink.

Dreaming a little more... if these features could be added to all platforms supported by Harbour, we will have a universal, multi-platform, lightweight and simple alternative GUI for our programs: HTML.

More info on RFO BASIC HTML interface: http://rfobasic.com/#section-10.3

Regards,

Roberto.

alkresin

unread,
Feb 9, 2015, 7:57:20 AM2/9/15
to harbou...@googlegroups.com
Thanks, Roberto.


> If we could catch webview events 
from Harbour (ie: form's submit button) we could build our GUIs with plain HTML.

 I look at this direction, too.
But now I gradually, little by little, try to implement another approach - creating natural Android GUI compenents with Harbour code - some HDroidGUI.

Regards, Alexander.

roberto.p...@gmail.com

unread,
Feb 9, 2015, 3:44:58 PM2/9/15
to harbou...@googlegroups.com
But now I gradually, little by little, try to implement another approach - creating natural Android GUI compenents with Harbour code - some HDroidGUI.

That will be great too. 

Regards,

Roberto.

alkresin

unread,
Feb 10, 2015, 11:18:13 AM2/10/15
to harbou...@googlegroups.com
Version 4 has been uploaded:

 Mastering the technique of calling Java methods from Harbour and debugging techniques - added Harbour function h4a_isInternetOn() to determine whether there is an Internet connection and h4a_Wrlog( sText ) - write debug messages to a log for saving to a file using
 adb shell logcat.

 Scripts are slightly modified.

Regards, Alexander.

roberto.p...@gmail.com

unread,
Feb 12, 2015, 8:13:36 PM2/12/15
to harbou...@googlegroups.com
Hi All,

I've created a little tutorial about h4a setup, for those that (like me) has no experience with Android development and could feel a little 'intimidated'.


I hope it be useful for someone.

Regards,

Roberto.

alkresin

unread,
Feb 17, 2015, 6:09:10 AM2/17/15
to harbou...@googlegroups.com
Thanks, Roberto!
I plan to write a more detailed description, but not now. The documentation ever was a difficult work for me.
I uploaded that sample to the github: https://github.com/alkresin/h4aFirstApp
And yet another - https://github.com/alkresin/libharbour4a - scripts to build the Harbour library libharbour.so for Android, the ready library itself is included in the sample.

Also, I plan to upload a first basic draft of HDroidGUI very soon.

Regards, Alexander.

Sami Laham

unread,
Feb 18, 2015, 10:21:12 AM2/18/15
to harbou...@googlegroups.com
Good news !!!! I'm anxious to see this news, thank you for sharing , thanks Roberto too

Regards 

Sami

alkresin

unread,
Feb 18, 2015, 11:54:53 AM2/18/15
to harbou...@googlegroups.com
Version 5 is uploaded.

Now application behaves normally when device orientation is changed.
Simple menu introduced.
Added a prototype of a JavaScript -> Java -> Harbour bridge. It became possible to call Harbour functions from the Javascript in WebView, to create a multiline prg strings and send them from WebView to Harbour VM for execution. It is a way to creating web-interface, based on Javascript + Harbour interaction - possibly, something like Roberto told about..

Regards, Alexander.

roberto.p...@gmail.com

unread,
Feb 18, 2015, 7:56:29 PM2/18/15
to harbou...@googlegroups.com
It is a way to creating web-interface, based on Javascript + Harbour interaction - possibly, something like Roberto told about..

It is a lot more than that I've talked about. It is simple and powerful. A huge step forward for Harbour!

Thanks!

Reagrds,

Roberto.


 

Rafa Carmona

unread,
Feb 19, 2015, 4:20:16 AM2/19/15
to harbou...@googlegroups.com
FANTASTIC!  Alexander

Big JOB!

Regards


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

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



--
Saludos
Rafa Carmona

roberto.p...@gmail.com

unread,
Feb 21, 2015, 10:29:33 PM2/21/15
to harbou...@googlegroups.com
Hi All,

I've created an HTML demo, that generates a form, able to get a value from the user and send it to a Harbour function as a parameter.



Regards,

Roberto.

Reply all
Reply to author
Forward
0 new messages