Lazarus

Programming => Operating Systems => Android => Topic started by: huberte on April 24, 2012, 03:34:43 pm

Title: [solved]Android color form, vectorial graphics (windows building)
Post by: huberte on April 24, 2012, 03:34:43 pm
Hi,

I did set a color for a form (black) but it's still gray in android.

What is the fastset way to deal with buttons and their designs (image ?)

I red some posts about vectorial graphics (which are far more better if I zoom with my phone) on this forum, but not in the Android section. Would it be possible to hve an app who open such files and show them ?

thks.
Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 24, 2012, 03:44:06 pm
I did set a color for a form (black) but it's still gray in android.

I fixed it in this commit: http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=37010

Quote
What is the fastset way to deal with buttons and their designs (image ?)

What do you mean? You want to change the look of the button? To which look? Or improve the existing default look?

Quote
I red some posts about vectorial graphics (which are far more better if I zoom with my phone) on this forum, but not in the Android section. Would it be possible to hve an app who open such files and show them ?

fpvectorial should work fine in Android: Read http://wiki.lazarus.freepascal.org/fpvectorial

I know that some people managed to render SVG using LCL-CustomDrawn-Android and Graphics32, but I have no idea how exactly it all works: http://wiki.lazarus.freepascal.org/File:vpr-android.png
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 25, 2012, 02:08:30 am
Quote
I fixed it in this commit: http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=37010

Sorry but I dont see where I should put this file or how to implement it.

Quote
What do you mean? You want to change the look of the button? To which look? Or improve the existing default look?

To look like ICS button : http://developer.android.com/design/downloads/index.html I did try with image, but it's not so good

Quote
I know that some people managed to render SVG using LCL-CustomDrawn-Android and Graphics32,

How can I contact Meanderix ?
Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 25, 2012, 08:22:19 am
Sorry but I dont see where I should put this file or how to implement it.

You need to use Lazarus from subversion and use the command "svn up" to upgrade your sources to the latest ones. Where did you obtain the Lazarus sources that you are using?

Quote
To look like ICS button : http://developer.android.com/design/downloads/index.html I did try with image, but it's not so good

The best would be to create a new drawer for Android 4, my drawer is based in Android 2. Look at the file lazarus/lcl/customdrawn_android.pas and you need to write a similar file which implements Android 4 style instead of the current Android 2.

Quote
How can I contact Meanderix ?

Via private message in the forum, he posted in this thread:

http://www.lazarus.freepascal.org/index.php/topic,16375.msg91337.html#new
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 25, 2012, 08:36:17 am
Quote
Where did you obtain the Lazarus sources that you are using?

I'm working with w7 lazarus, then to vbox for compiling and building apk (but I'm trying to only work on 7 : too much bugs with the vbox)

Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 25, 2012, 08:43:16 am
There are step-by-step instructions of how to setup the Windows environment now. The VBox image is very old now. But it does come with subversion, so you could use "svn up" inside the lazarus directory to update it.

For Windows only setup read:

http://wiki.lazarus.freepascal.org/Custom%20Drawn%20Interface/Android#Using_the_pre-compiled_compiler_in_Windows

and

http://wiki.lazarus.freepascal.org/Custom%20Drawn%20Interface/Android#Step_4_-_Creating_the_APK_package_in_Windows
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 25, 2012, 09:10:18 am
In windows 64, I did follow the instrucitons.

Which path for the libraries ?

lazarus\fpc\2.5.1\units\ which contains 92 folders from arm-linux (from a52 to zorba)

ends with

Quote
Error: ppcarm.exe can't be executed, error message: Failed to execute ""ppcarm.exe"  -B -MObjFPC -Scghi -O1 -Tlinux -Xs -XX -vewnhi -l -FiD:\Lazarus\Android\androidlcl\lib\arm-linux -FlC:\lazarus\fpc\2.5.1\bin -FlC:\lazarus\fpc\2.5.1\units -FuC:\lazarus\lcl\units\arm-linux -FuC:\lazarus\lcl\units\arm-linux\customdrawn -FuC:\lazarus\packager\units\arm-linux -FuD:\Lazarus\Android\androidlcl\ -Fu. -FUD:\Lazarus\Android\androidlcl\lib\arm-linux\ -FED:\Lazarus\Android\androidlcl\android\libs\armeabi\ -oliblclapp.so -dANDROID -Xd -CpARMV6 -dLCL -dLCLcustomdrawn androidlcltest.lpr

EDIT :

Quote
(...)change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL.

I did have download both ndk and sdk, but with the precompiled version, it's useless right ? So now I'm searching lic.so to find the folder :(
Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 25, 2012, 10:11:03 am
Which path for the libraries ?

lazarus\fpc\2.5.1\units\ which contains 92 folders from arm-linux (from a52 to zorba)

ends with

Error: ppcarm.exe can't be executed, error message: Failed to execute ""ppcarm.exe"  -B -MObjFPC -Scghi -O1 -Tlinux -Xs -XX -vewnhi -l -FiD:\Lazarus\Android\androidlcl\lib\arm-linux -FlC:\lazarus\fpc\2.5.1\bin -FlC:\lazarus\fpc\2.5.1\units -FuC:\lazarus\lcl\units\arm-linux -FuC:\lazarus\lcl\units\arm-linux\customdrawn -FuC:\lazarus\packager\units\arm-linux -FuD:\Lazarus\Android\androidlcl\ -Fu. -FUD:\Lazarus\Android\androidlcl\lib\arm-linux\ -FED:\Lazarus\Android\androidlcl\android\libs\armeabi\ -oliblclapp.so -dANDROID -Xd -CpARMV6 -dLCL -dLCLcustomdrawn androidlcltest.lpr

Which Lazarus are you using as you base one? It came with FPC 2.5.1 or 2.6.0 ?

Did you copy the executables too? To which folder?

Quote
I did have download both ndk and sdk, but with the precompiled version, it's useless right ? So now I'm searching lic.so to find the folder :(

libc.so is located in the NDK in this directory: C:\Programas\android-ndk-r7b\platforms\android-8\arch-arm\usr\lib\
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 25, 2012, 03:56:45 pm
Quote
Which Lazarus are you using as you base one? It came with FPC 2.5.1 or 2.6.0 ?

9.30.4 with 2.6.0

Quote
Did you copy the executables too? To which folder?

Copy to \fpc\2.5.1\bin like the wiki said

Quote
libc.so is located in the NDK in this directory:

Thing is, the wiki never says to download the NDK nor the sdk in the part : "Using the pre-compiled compiler in Windows"
Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 25, 2012, 04:06:14 pm
Copy to \fpc\2.5.1\bin like the wiki said

It should be copied to the folder of the installed compiler, in your case 2.6.0 not 2.5.1

Quote
Thing is, the wiki never says to download the NDK nor the sdk in the part : "Using the pre-compiled compiler in Windows"

Ok, I fixed both that and the other thing about the /bin directory in the wiki. Please read again here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Using_the_pre-compiled_compiler_in_Windows
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 25, 2012, 08:51:55 pm
Still not working. I did download the ndk and sdk (there is a r7c which correct the bug from r7b) :

http://developer.android.com/sdk/ndk/index.html

I do have

C:\lazarus\fpc\2.5.1\units with 92 folders from "a52" to "zorba"
C:\lazarus\fpc\2.6.0\bin\x86_64-win64 with exe files (arm-linux-xxxx.exe)

I did add/change to project, options, libraries (-Fl),  :

C:\lazarus\fpc\2.5.1\units\
D:\Lazarus\Programmes\android-ndk-r7c\platforms\android-8\arch-arm\usr\lib\
C:\lazarus\fpc\2.6.0\bin\x86_64-win64\

I did change this :
android-ndk-r5\toolchains\arm-eabi-4.4.0\prebuilt\linux-x86\lib\gcc\arm-eabi\4.4.0   

to

D:\Lazarus\Programmes\android-ndk-r7c\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.4.3

nothing with the sdk ?

building androidlcltest ends with :
Quote
androidlcltest.lpr(1,1) Fatal: Can't find unit system used by androidlcltest

EDIT :I have no customdrawnproc.pas to upgrade in my lazarus folder.
Title: Re: Android color form, vectorial graphics
Post by: felipemdc on April 26, 2012, 08:51:30 am
C:\lazarus\fpc\2.5.1\units with 92 folders from "a52" to "zorba"
C:\lazarus\fpc\2.6.0\bin\x86_64-win64 with exe files (arm-linux-xxxx.exe)

Ok, so far good.

Quote
I did add/change to project, options, libraries (-Fl),  :

C:\lazarus\fpc\2.5.1\units\
D:\Lazarus\Programmes\android-ndk-r7c\platforms\android-8\arch-arm\usr\lib\
C:\lazarus\fpc\2.6.0\bin\x86_64-win64\

-Fl should contain only the path to the binary libraries, that is D:\Lazarus\Programmes\android-ndk-r7c\platforms\android-8\arch-arm\usr\lib\

The others are unnecessary, although they won't hurt either and your error is unrelated to that.

Quote
nothing with the sdk ?

You will need the SDK to build the APK afterwards.

Quote
building androidlcltest ends with : androidlcltest.lpr(1,1) Fatal: Can't find unit system used by androidlcltest

Note that the error changed. So we advanced. Before it could not find the compiler, now it can. Now it can't find the system unit, the one in C:\lazarus\fpc\2.5.1\units\

Could you attach here your file lazarus/fpc/$version$/bin/cfg.fpc ? (or was it fpc.cfg?)

Quote
EDIT :I have no customdrawnproc.pas to upgrade in my lazarus folder.

You need to a newer Lazarus. You cannot use 0.9.30. The idea would be to get Lazarus from SVN: http://wiki.lazarus.freepascal.org/Getting%20Lazarus

The file is in the folder lazarus/lcl/interfaces/customdrawn/

But if using SVN is too hard you should just try a snapshot from Lazarus 1.1 from here: http://www.hu.freepascal.org/lazarus/
Title: Re: Android color form, vectorial graphics
Post by: huberte on April 26, 2012, 08:41:18 pm
Quote
Quote from: huberte on April 25, 2012, 08:51:55 pm
C:\lazarus\fpc\2.5.1\units with 92 folders from "a52" to "zorba"
C:\lazarus\fpc\2.6.0\bin\x86_64-win64 with exe files (arm-linux-xxxx.exe)
Ok, so far good.

Nope It should be C:\lazarus\fpc\2.5.1\units\arm-linux where all those folders go.

Thanks a lot for the lazarus Maj, you really should add something to the download link on the left, where you could explain stable, snapshot and svn. I did succeed with turtle-noise  (turnoise, tortnoise)

Now I did have the latest files, I have to build the lilbraries, right ? Here the error, how can I do this ?

Quote
Fatal: Rebuild needed of unit LazLogger used by LCLProc, ppu=..\components\lazutils\lib\arm-linux\lazlogger.ppu, package LazUtils

Solved, thks to http://www.lazarus.freepascal.org/index.php/topic,16083.msg87046.html#msg87046 , uninstall all, reinstall all
TinyPortal © 2005-2018