Recent

Author Topic: Configuring Lazarus for Android  (Read 15042 times)

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Configuring Lazarus for Android
« on: July 10, 2013, 11:23:45 am »
Hi everybody,
Can someone guide me through a tutorial and describe me the necessary steps to generate Android application with Lazarus, I found a lot of informations on forums but it doesn't worked for me and it was uncomplete :(

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: Configuring Lazarus for Android
« Reply #1 on: July 10, 2013, 11:39:37 am »
Afaik Android is mostly still in development. There is no end user docs and support yet.

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Re: Configuring Lazarus for Android
« Reply #2 on: July 10, 2013, 11:46:11 am »
but there are some peoples that succeeded to build .apk with Lazarus !!!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configuring Lazarus for Android
« Reply #3 on: July 10, 2013, 01:40:25 pm »
Quote
but there are some peoples that succeeded to build .apk with Lazarus !!!
Yes, we are too geek to make it possible, so you have to be a geek too if you want to be like us :P
There are at least 2 wiki entries that you have to read:
  • This one explains Android support from the compiler side
  • This one explains how LCL Custom Drawn is used to create LCL powered Android application. Watch out, the article contains information regarding hacked 2.5.1 & 2.6.1 arm-linux version of the compiler, which even though still capable to generate Android app, but not supported by the compiler team

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Re: Configuring Lazarus for Android
« Reply #4 on: July 10, 2013, 02:45:53 pm »
Thnx, but those two wiki entries are those who troubled me  :P
Anyway I downloaded the Virtual Box image containing FPC and Lazarus and the whole configuration to build .apk .. and when I tried to compile my own project (not the one given in the examples directory called AndroidLCL) I got an error :
Code: [Select]
Error: can't open Android/lib/arm-linux/unit1.o for reading : No such file or directory

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configuring Lazarus for Android
« Reply #5 on: July 10, 2013, 03:00:46 pm »
Quote
and when I tried to compile my own project (not the one given in the examples directory called AndroidLCL) I got an error :
This is why I said you have to be a geek, where being a geek is to read the wiki thoroughly, not skipping any steps and try to understand the whole concept before proceeding. PATH settings to NDK toolchains and the cross compiler are the most important part. That error might not be the first one, try copy-paste-ing the whole messages (right click->copy all and hidden messages).

Next, you better use androidlcl as a template instead of writing from scratch, because you'll need to setup directory & ant build configuration files to generate the apk.

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Re: Configuring Lazarus for Android
« Reply #6 on: July 11, 2013, 12:17:25 pm »
Code: [Select]
Options changed, recompiling clean with -B
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.5.1 [2011/01/19] for arm
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling project1.lpr
Compiling unit1.pas
unit1.pas(16,28) Hint: Parameter "Sender" not used
Assembling unit1
Assembler messages:
Error: can't open Android/lib/arm-linux/unit1.o for reading: No such file or directory

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configuring Lazarus for Android
« Reply #7 on: July 11, 2013, 02:21:37 pm »
Do you have -XD$FPCTARGET- in your fpc.cfg? If yes, do you have arm-linux-as and arm-linux-ld accessible from PATH?

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Re: Configuring Lazarus for Android
« Reply #8 on: July 12, 2013, 01:10:42 pm »
I'm newbie to Lazarus and FPC .. I can't understand what you are saying :(

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Configuring Lazarus for Android
« Reply #9 on: July 12, 2013, 02:19:37 pm »
Then perhaps it's better to learn a bit more before attempting to do this.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configuring Lazarus for Android
« Reply #10 on: July 12, 2013, 07:40:19 pm »
Quote
I'm newbie to Lazarus and FPC .. I can't understand what you are saying :(
Then it's not your time yet to try the Android target.

zariq

  • Full Member
  • ***
  • Posts: 109
Re: Configuring Lazarus for Android
« Reply #11 on: July 12, 2013, 10:07:37 pm »
Then perhaps it's better to learn a bit more before attempting to do this.

Then it's not your time yet to try the Android target.


Does anyone know if someone is trying to integrate some of the process into Lazarus
or are things likely to stay as they are for the foreseeable future.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2302
Re: Configuring Lazarus for Android
« Reply #12 on: July 12, 2013, 10:38:24 pm »
I think a good starting point is to implement a android moule wizard mimicking the "Apache Module" wizard... but my "proof of concept" is stopped because I could not still solve the problem discussed in...

http://forum.lazarus.freepascal.org/index.php/topic,17365.msg125363.html#msg125363

Greetings!










Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ghassen_khalil

  • New Member
  • *
  • Posts: 10
Re: Configuring Lazarus for Android
« Reply #13 on: July 13, 2013, 12:15:58 pm »
Quote
I'm newbie to Lazarus and FPC .. I can't understand what you are saying :(
Then it's not your time yet to try the Android target.

I just figured it out .. but it's always my time to know new things .. we all started from zero with a little bit of help bro !!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configuring Lazarus for Android
« Reply #14 on: July 13, 2013, 12:23:23 pm »
Quote
I just figured it out .. but it's always my time to know new things .. we all started from zero with a little bit of help bro !!
Many great programmers start that way, feel free to follow their way. But I don't suggest jumping to advanced stage if you haven't mastered the basic and intermediate ones.

 

TinyPortal © 2005-2018