Forum > Android

IFDEF for Android

(1/2) > >>

IndianaJones:

Hi all,
Is there an special definition (IFDEF) for Android platform?
Thanks.

Andru:
Nope, because FreePascal doesn't support Android officially... So the only one solution is something like this(but this is a bad idea):

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IF DEFINED(LINUX) and DEFINED(CPUARM)}  {$DEFINE ANDROID}{$IFEND} 
or just using define ANDROID manually when you compile your project.

felipemdc:
Since the LPI needs to be different anyway for Android, just add -dANDROID in the Android LPI. The example project does that.

IndianaJones:

@Andru: I dont think it is a bad idea, if the source needs to be compiled under Windows,Linux,Mac,Android ...etc. I just read the screen metrics of the Android device, so that doesnt necessary for the other platforms.

@Felipe: But that information only supports if the application runs only on Android platform.

felipemdc:

--- Quote from: IndianaJones on January 04, 2012, 09:54:20 pm ---@Felipe: But that information only supports if the application runs only on Android platform.

--- End quote ---

Why? The example project runs in any operating system.

Navigation

[0] Message Index

[#] Next page

Go to full version