Facing Android Development

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Facing Android Development

Post by esgici »

Roberto Lopez wrote: ...
In the case that I find enough time to create the translator to 'sugarize' the client syntax, you should give it a try.
...
Thanks; very good news :!:

Everybody likes sugar :)

With my best regards :)
Viva INTERNATIONAL HMG :D
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Facing Android Development

Post by serge_girard »

Thanks Roberto,

As I'm not at home I only read new messages. When I'm back home I'll give it a look!

Serge
There's nothing you can do that can't be done...
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Facing Android Development

Post by serge_girard »

Roberto,

I could not resist a quick try... Compiling (build test.prg) gives an error.. can't find....

Compiling build test (without .prg) is OK.

Serge
There's nothing you can do that can't be done...
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Facing Android Development

Post by esgici »

Hi all

Does anyone think to sell their old Android machine to me ? :lol:

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Facing Android Development

Post by Roberto Lopez »

serge_girard wrote:Roberto,

I could not resist a quick try... Compiling (build test.prg) gives an error.. can't find....

Compiling build test (without .prg) is OK.

Serge
Is working here... what is exactly the error message?
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Facing Android Development

Post by serge_girard »

Roberto,

This is the error when trying to compile with (build test.prg):

Code: Select all

Harbour 3.2.0dev (r1312192324)
Copyright (c) 1999-2013, http://harbour-project.org/
Compiling 'TEST.PRG'...
Lines 9, Functions/Procedures 1
Generating C source output to 'C:\Users\GEBRUI~1\AppData\Local\Temp\hbmk_n7spfs.
dir\TEST.c'... Done.
Het systeem kan het opgegeven bestand niet vinden.	(The system can't find the file.. or something)
Druk op een toets om door te gaan. . .(Press any key to continue)
Build test (without .prg) is giving "1 file is replaced (or something like that) " os this is OK and it will probably be a path-error or something?

Regards Serge
There's nothing you can do that can't be done...
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Facing Android Development

Post by andyglezl »

One file for client side and one file for server side.

The client is HTML and the server is Harbour.

In the case that I find enough time to create the translator to 'sugarize' the client syntax, you should give it a try.

I'm sure that using your own app in a phone is an enough reward :)
Hola
Parece prometedor, espero ansioso algunos ejemplos para probar ! Gracias.
----------------------------------------------------------------------------------------------------
hi
Looks promising, I look forward examples to test examples! Thanks.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
serge_girard
Posts: 3420
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Facing Android Development

Post by serge_girard »

Roberto,


I did some tests with HMG/WEB Alpha 012 + NETIO.

HMG + NETIO works fine but combining with HMG/WEB Alpha 012 gives an runtime-error:

TEST.cgi - Entrypoint not found
Unable to find entrypoint of procedure hb_fileRegister in DLL-file harbour-32.dll

What I did:
1) HMG app with NETIO (See Connect_NetServer() and USERSDBF()... : works OK
2) Server application with several queries (see Q_USERS()) which are called from HMG app: works OK
3) Index.html with TEST.CGI which calls also Server-app-query Q_USERS: gives runtime-error.
4) Index.html with TEST.CGI which has a copy of Q_USERS: works OK.

So I can't get NETIO working with CGI. Harbour-32.dll is located in the same folder as the CGI modules.
Any idea how to fix this?

Serge

See source-snippets:


PRG-CGI module

Code: Select all

/* build.bat :
**************
@ECHO OFF
CLS

SET HBPATH=C:\harbour\bin
SET HMGINCPATH=c:\hmgweb\include
SET APACHECGIPATH=c:\hmgweb\apache\cgi-bin
%HBPATH%\hbmk2 %1 -i%HMGINCPATH% hbmysql.hbc hbmisc.hbc hbnetio.hbc hbct.hbc -shared
IF ERRORLEVEL 0 MOVE %1.exe %APACHECGIPATH%\%1.cgi

*/


// TEST.PRG --> TEST.CGI   ------------------------------------------------------
#include "hmg.ch"
#include "error.ch"
#include "common.ch"
#require "hbnetio"



REQUEST HB_GT_CGI_DEFAULT
REQUEST HB_GT_WIN_DEFAULT



FUNCTION MAIN()
/**************/
LOCAL	 aQuery				:= {} 

PUBLIC cNetServer       := '127.0.0.1'          // local server or any addres (even Internet)
PUBLIC nNetPort         := 2941                 // you can choose any you want
PUBLIC cNetPass         := 'something_secret'   // Idem

PUBLIC _HMG_SYSDATA_		[ 32 ]


cQUERY	:= getvalue("url")   
cWHERE	:= getvalue("where") 
// requested query existing eg: Q_USERS

IF !Connect_NetServer()
	xSUR_NAME		:= ''
	xFAM_NAME		:= ''
ELSE
	aQuery			:= netio_funcexec( cQUERY, cWHERE )
   xSUR_NAME		:= ALLTRIM(aQuery[1] [1] )  
   xFAM_NAME		:= ALLTRIM(aQuery[1] [2] ) 
	netio_disconnect( cNetServer , nNetPort )
ENDIF 
	 
OutStd( "Content-type: text/html" + hb_OSNewLine() + hb_OSNewLine() )
OutStd( '<br> ' )
OutStd( xSUR_NAME + ' ' + xFAM_NAME + '<br> ' )

/* ok
aAr := Q_USERS()
xSUR_NAME		:= ALLTRIM(aAr [1] [1] )  
xFAM_NAME		:= ALLTRIM(aAr [1] [2] ) 
OutStd( "Content-type: text/html" + hb_OSNewLine() + hb_OSNewLine() )
OutStd( '<br> ' )
OutStd( xSUR_NAME + ' ' + xFAM_NAME + '<br> ' ) */

RETURN NIL	





FUNCTION Connect_NetServer()
/**************************/
LOCAL c_STR_Con := "net:"

lConnect    := netio_connect( cNetServer , nNetPort ,, cNetPass, 9 )
IF .Not. lConnect
   RETURN .F.
ENDIF

RETURN .T. 
// TEST.PRG --> TEST.CGI   ------------------------------------------------------


HMG App

Code: Select all

FUNCTION Connect_NetServer()
/**************************/
LOCAL c_STR_Con := "net:"

lConnect    := netio_connect( cNetServer , nNetPort ,, cNetPass, 9 )
IF .Not. lConnect
   RETURN .F.
ENDIF

RETURN .T. 
// TEST.PRG --> TEST.CGI   ------------------------------------------------------




FUNCTION USERSDBF()
/*******************/
cWHERE := ''

IF !Connect_NetServer()
	xSUR_NAME		:= ''
	xFAM_NAME		:= ''
ELSE
	aQuery			:= netio_funcexec( 'Q_USERS', cWHERE )
   xSUR_NAME		:= ALLTRIM(aQuery[1] [1] )  
   xFAM_NAME		:= ALLTRIM(aQuery[1] [2] ) 
	netio_disconnect( cNetServer , nNetPort )
ENDIF 

MSGINFO(xSUR_NAME, 'xSUR_NAME')
RETURN


SERVER Function

Code: Select all

/*************************************************************************/
/* Q_USERS is located within HMGSERVERIO.PRG                             */
/* When calling netio_funcexec( 'Q_USERS', '' ) from a HMG Application   */
/* (function USERSDBF) this works fine.                                  */
/*                                                                       */
/* When calling from TEST.CGI it gives a runtime-error:                  */
/* TEST.cgi - Entrypoint not found                                       */
/* Unable to find entrypoint of procedure hb_fileRegister in DLL-file    */
/* harbour-32.dll.                                                       */
/* (see att.  )                                                          */
/*************************************************************************/


FUNCTION Q_USERS()
/**************************************/
LOCAL       a, aRecordset := {}, aFIELD := {}
PARAMETERS  cWHERE  


USE  USERFILE  
IF!EMPTY(cWHERE)
	SET FILTER TO FAM_NAME == cWHERE
ENDIF
GO TOP

DO WHILE .NOT. EOF() 
   aFIELD   := {}
   FOR a = 1 to fcount()
      AADD(aFIELD , fieldGet(a) )
   NEXT a

   AADD( aRecordset , aFIELD )
   SKIP
ENDDO

USE

RETURN aRecordset

Greetings and thanks, Serge
Attachments
HB32.jpg
HB32.jpg (23.74 KiB) Viewed 4378 times
There's nothing you can do that can't be done...
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Facing Android Development

Post by Roberto Lopez »

serge_girard wrote:Roberto,

I could not resist a quick try... Compiling (build test.prg) gives an error.. can't find....

Compiling build test (without .prg) is OK.

Serge
Sorry... my mistake... its build test (without '.prg')
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: Facing Android Development

Post by Roberto Lopez »

serge_girard wrote:Roberto,


I did some tests with HMG/WEB Alpha 012 + NETIO.

HMG + NETIO works fine but combining with HMG/WEB Alpha 012 gives an runtime-error:

TEST.cgi - Entrypoint not found
Unable to find entrypoint of procedure hb_fileRegister in DLL-file harbour-32.dll
<...>
I can't help, since I've not tested NETIO on a CGI app.

Anyway... maybe in real world conditions, you should not need that.

At least in my case, the dbf files are located in the same machine as the web server, son your cgi apps, does not need to communicate with dbf files via NETIO. You should follow that path, since is the most simple and efficient.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply