Configuring Lazarus for Android lazarus / 43-Android ---------------------------------------------------------------------- ghassen_khalil · 2013-07-10 09:23 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 · 2013-07-10 09:39 Afaik Android is mostly still in development. There is no end user docs and support yet. ---------------------------------------------------------------------- ghassen_khalil · 2013-07-10 09:46 but there are some peoples that succeeded to build .apk with Lazarus !!! ---------------------------------------------------------------------- Leledumbo · 2013-07-10 11:40 Quotebut 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 There are at least 2 wiki entries that you have to read: This one explains Android support from the compiler sideThis 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 · 2013-07-10 12:45 Thnx, but those two wiki entries are those who troubled me  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 · 2013-07-10 13:00 Quoteand 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 · 2013-07-11 10:17 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 · 2013-07-11 12:21 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 · 2013-07-12 11:10 I'm newbie to Lazarus and FPC .. I can't understand what you are saying ---------------------------------------------------------------------- BigChimp · 2013-07-12 12:19 Then perhaps it's better to learn a bit more before attempting to do this. ---------------------------------------------------------------------- Leledumbo · 2013-07-12 17:40 QuoteI'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 · 2013-07-12 20:07 Quote from: BigChimp on July 12, 2013, 02:19:37 pmThen perhaps it's better to learn a bit more before attempting to do this. Quote from: Leledumbo on July 12, 2013, 07:40:19 pmThen 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 · 2013-07-12 20:38 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.ht ml#msg125363 Greetings! ---------------------------------------------------------------------- ghassen_khalil · 2013-07-13 10:15 Quote from: Leledumbo on July 12, 2013, 07:40:19 pmQuoteI'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 · 2013-07-13 10:23 QuoteI 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. ---------------------------------------------------------------------- picstart · 2013-07-13 12:51 Creating a "hello world" app using lazarus for a PC requires minimal skill. Cross compiling for wince arm involves checking some boxes prior to the compile. It is akin to using a cell phone to call and say "hello". For Lazarus to Android however you must first have the skill to climb Mt Everest before using the phone. The skill isn't in coding it is in climbing and avoiding the crevasses of an obtuse cross compile. There is only a short lived return in mastering this obtuse process. It is just to obtuse for many to travel the path so it is destined to become obsolete. It is like learning a dying language spoken by only a few hundred people compared to learning English French Spanish Chinese etc. Lack of intuitive Android support may result in Lazarus becoming a dying language in the tablet universe. ---------------------------------------------------------------------- BigChimp · 2013-07-13 13:03 If you feel so strongly about it, please contribute to make Android development using Lazarus easier. ---------------------------------------------------------------------- Leledumbo · 2013-07-13 13:28 QuoteIf you feel so strongly about it, please contribute to make Android development using Lazarus easier.Like providing a preconfigured Lazarus complete with NDK & SDK (and eat that gigabytes download) ---------------------------------------------------------------------- picstart · 2013-07-13 14:40 Well if the message was factually incorrect the response would be that Lazarus Android is easy and here's why. Often a response to a messenger bringing an unpleasant truth is to shoot the messenger or in this case ask the messenger to come back with a message saying the messenger he/herself has resolved the issue. I gave up on Lazarus for Android app development perhaps many have also done so. Soon few if any messengers will arrive with fore-warnings of the demise of Lazarus in the tablet universe; especially if they are shot upon speaking the truth. Anyway my message fell on deaf ears so lets drop it. ---------------------------------------------------------------------- marcov · 2013-07-13 15:34 Quote from: picstart on July 13, 2013, 04:40:00 pmWell if the message was factually incorrect the response would be that Lazarus Android is easy and here's why. Nobody said it was easy. Just the Mt Everest analogy, and the wild death-by-tablet extrapolations are ridiculous. QuoteOften a response to a messenger bringing an unpleasant truth is to shoot the messenger or in this case ask the messenger to come back with a message saying the messenger he/herself has resolved the issue. You are not merely the messenger. You composed that "opinion", so you are responsible for it. As sender/creator, not as messenger. QuoteI gave up on Lazarus for Android app development perhaps many have also done so. Me too. I don't think Lazarus and mobile go together very well, at least the designer part. But that is more a problem of the extreme volatility of the mobile sector and its users than of Lazarus. ---------------------------------------------------------------------- Scoops · 2013-07-13 16:06 Hi, I have only recently bought an android device, and have only briefly delved into getting a sytem up and running for Android development, it really is a BIG climb. For the developers who have managed, is it not possible to get a Live Linux disto pre-configured to allow others to profit.  Lots of developers can code but are not great at system configuration, maybe a live cd with everything to cross compile for whatever system suported by Lazarus.  Then all these problems about setting up for Windows or Linux or Android would be settled.  If you develop in Lazarus use the Default laz live cd, (settled).  Making life easier will obviously help to get more people to code using FPC/Lazarus.  My PC is virtually never off, so if ever it was a case of dowloading gigabytes its not something which bothers me.  As I said earlier i have only briefly delved into Android, so if this is not possible i will apologise in advance, and hats off to the developers who do understand and keep up the good work. ---------------------------------------------------------------------- zariq · 2013-07-13 16:30 Personally I could put up with the setting up hassles, if at the end of it if it was possible for me to make something useful. I'm not saying it is not possible for anyone to make anything useful. But whenever I have tried to add anything to, or change the example which comes with Lazarus, then the results are not what they should be. I posted about a couple of them issues but never got much of a response. Communication is the biggest problem at the moment. If we were told that it was being worked on but it is going to take time, then I and most people would happily wait for as long as it took. If somebody said that nothing is being done and nothing will be done go and learn java, then that would be good aswell. As it is nothing is being said e.g.  http://wiki.freepascal.org/Custom_Drawn_Interface/Android#Roadmap Don't get me wrong I'm not complaining about the rate of progress, but I wouldn't mind knowing if any progress is likely or not. ---------------------------------------------------------------------- Leledumbo · 2013-07-13 16:54 QuoteDon't get me wrong I'm not complaining about the rate of progress, but I wouldn't mind knowing if any progress is likely or not.AFAIK currently there's only very few people maintaining everything about Android. For LCL, Felipe is the only one working for it.  So you can start asking him (he seems to be gone these days, haven't seen him posting anything). I don't even know who maintains the compiler part. ---------------------------------------------------------------------- zariq · 2013-07-13 17:53 Felipe has been gone for a few weeks now. Will ask him when he comes back. ---------------------------------------------------------------------- ghassen_khalil · 2013-07-15 08:31 thank you anyway .. you were very helpful ---------------------------------------------------------------------- marcov · 2013-07-15 12:28 Quote from: Leledumbo on July 13, 2013, 06:54:33 pm I don't even know who maintains the compiler part. Yury did the target support, and a few commits after, last on june 4th ---------------------------------------------------------------------- mbdev · 2013-07-15 15:24 Take a look at http://www.mbs-software.org/ There are some articles how to setup Lazarus for Android or iOS. I hope it helps ---------------------------------------------------------------------- mirce.vladimirov · 2013-08-07 11:39 there's somtehing useful I believe http://www.pilotlogic.com/sitejoom/index.php/93-wiki/codetyphon- tutorials/222-cross-build-for-android not tried by myself so please report if it's useful. I noticed they missed to say about providing the android add-on for the fpc compiler. ---------------------------------------------------------------------- jmpessoa · 2013-08-07 21:56 Hi ghassen_khalil, From this thread: Lazarus1.1 For Android (FPC2.7.1 http://forum.lazarus.freepascal.org/index.php/topic,20918.msg121775.ht ml#msg121775 You can download here: https://skydrive.live.com/?cid=89ae6b50650182c6&id=89AE6B50650182C6%21 149 See the zariq post here: http://forum.lazarus.freepascal.org/index.php/topic,21544.0.html Greetings!