* * * *

Privacy Policy

Blog italiano

Clicca qui se vuoi andare al blog italiano su Lazarus e il pascal.

Forum ufficiale

Se non siete riusciti a reperire l'informazione che cercavate nei nostri articoli o sul nostro forum vi consiglio di visitare il
Forum ufficiale di Lazarus in lingua inglese.

Lazarus 1.0

Trascinare un file nel programma
DB concetti fondamentali e ZeosLib
Recuperare codice HTML da pagina web
Mandare mail con Lazarus
Stabilire il sistema operativo
Esempio lista in pascal
File INI
Codice di attivazione
Realizzare programmi multilingua
Lavorare con le directory
Utilizzare Unità esterne
TTreeView
TTreeview e Menu
Generare controlli RUN-TIME
LazReport, PDF ed immagini
Intercettare tasti premuti
Ampliare Lazarus
Lazarus e la crittografia
System Tray con Lazarus
UIB: Unified Interbase
Il file: questo sconosciuto
Conferma di chiusura di un applicazione
Liste e puntatori
Overload di funzioni
Funzioni a parametri variabili
Proprietà
Conversione numerica
TImage su Form e Panel
Indy gestiore server FTP lato Client
PopUpMenu sotto Pulsante (TSpeedButton)
Direttiva $macro
Toolbar
Evidenziare voci TreeView
Visualizzare un file Html esterno
StatusBar - aggirare l'errore variabile duplicata
Da DataSource a Excel
Le permutazioni
Brute force
Indy 10 - Invio email con allegati
La gestione degli errori in Lazarus
Pascal Script
Linux + Zeos + Firebird
Dataset virtuale
Overload di operatori
Lavorare con file in formato JSON con Lazarus
Zeos ... dietro le quinte (prima parte)
Disporre le finestre in un blocco unico (come Delphi)
Aspetto retrò (Cmd Line)
Lazarus 1.0
Come interfacciare periferica twain
Ubuntu - aggiornare free pascal e lazarus
fpcup: installazioni parallele di lazarus e fpc
Free Pascal e Lazarus sul Raspberry Pi
Cifratura: breve guida all'uso dell'algoritmo BlowFish con lazarus e free pascal.
Creare un server multithread
guida all'installazione di fpc trunk da subversion in linux gentoo
Indice
DB concetti fondamentali e connessioni standard
Advanced Record Syntax
DB concetti fondamentali e DBGrid
DB concetti fondamentali e TDBEdit, TDBMemo e TDBText
Advanced Record Syntax: un esempio pratico
Superclasse form base per programmi gestionali (e non)
Superclasse form base per programmi gestionali (e non) #2 - log, exception call stack, application toolbox
Superclasse form base per programmi gestionali (e non) #3 - traduzione delle form
Superclasse form base per programmi gestionali (e non) #4 - wait animation
Un dialog per la connessione al database:TfmSimpleDbConnectionDialog
Installare lazarus su mac osx sierra
immagine docker per lavorare con lazarus e free pascal
TDD o Test-Driven Development
Benvenuto! Effettua l'accesso oppure registrati.
Novembre 22, 2024, 10:42:39 am

Inserisci il nome utente, la password e la durata della sessione.

73 Visitatori, 0 Utenti

Autore Topic: Guida per installare lazarus per programmare android su linux :)  (Letto 6913 volte)

xinyiman

  • Administrator
  • Hero Member
  • *****
  • Post: 3273
  • Karma: +12/-0
Questa è la guida aggiornata suggeritami da un utente che programma regolarmente con android/lazarus da linux. Nei prossimi giorni la testo su una macchina virtuale. Se funziona bene vi giro la macchina virtuale.



I've updated the guide, integrating it with more specific steps.
A note on fpc version, that must be 2.6.4 for compiling the trunk version (3.1.1).
If you have Ubuntu 14.04 (like me) you must download the correct version from here:
http://packages.ubuntu.com/vivid/fpc-2.6.4

Thank you!

#######################
(replace $HOME with your username)

################
install some necessary programs:

(CMD) sudo apt-get install android-tools-adb ant fp-compiler openjdk-7-jdk subversion

################
(CMD) mkdir ~/Android
(CMD) cd ~/Android

################
install Android NDK
################

Download Android NDK from https://developer.android.com/ndk/downloads/index.html#download
follow instruction to install it

create a symbolik link for later use

(CMD) ln -s /home/$HOME/Android/android-ndk-r10e /home/$HOME/Android/ndk

################
install Android Sdk
################
Download Android Sdk from https://developer.android.com/sdk/index.html#Other (SDK Tools Only)
and extract it

(CMD) tar xzvf android-sdk_r24.3.4-linux.tgz

create a symbolik link for later use

(CMD) ln -s /home/$HOME/Android/android-sdk-linux /home/$HOME/Android/sdk

################
install SDK packages
################
Follow these instructions
https://developer.android.com/sdk/installing/adding-packages.html

and install SDK packages
(CMD) ~/Android/sdk/tools/android sdk

################
modify your PATH
################
Add to your ~/.bashrc:
export PATH=$PATH:~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin

################
download FPC and LAZARUS
################

svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
svn co http://svn.freepascal.org/svn/fpc/trunk fpc

################
install other needed packages
################
(ref.: http://wiki.freepascal.org/How_to_setup_a_FPC_and_Lazarus_Ubuntu_repository)
sudo apt-get install libgtk2.0-dev libgdk-pixbuf2.0-dev libgpm-dev fakeroot libncurses5-dev libtinfo-dev

################
BUILD FPC.DEB
################

(CMD) cd ~/Android/lazarus/tools/install
(CMD) ./create_fpc_deb.sh fpc /home/$HOME/Android/fpc/

################
purge fpc from system
################

REMOVE all fpc deb and fp_ deb (fpc, fpc-src, fp_compiler and so on)
(EX) sudo dpkg --remove fpc* fp-*

################
INSTALL the new trunk fpc package
################

(CMD) sudo dpkg -i ./fpc_3.1.1-150130_amd64.deb

################
BUILD FPC-SRC.DEB
we need source for fpc, now we create it, and install it
################

(CMD) ./create_fpc_deb.sh fpc-src /home/$HOME/Android/fpc/
(CMD) sudo dpkg -i fpc-src_3.1.1-150130_amd64.deb

################
BUILD LAZARUS.DEB AND INSTALL IT
################

(CMD) ./create_lazarus_deb.sh append-revision
(CMD) sudo dpkg -i lazarus_1.5.47565-0_amd64.deb

################
BUILD THE CROSS COMPILER
################

make clean crossall OS_TARGET=android CPU_TARGET=arm
sudo make crossinstall OS_TARGET=android CPU_TARGET=arm INSTALL_PREFIX=/usr

################
create symbolic link for newly created arm compiler
################

(CMD) cd /usr/bin
(CMD) sudo ln -s /usr/lib/fpc/3.1.1/ppcrossarm .
(CMD) sudo ln -s /usr/bin/ppcrossarm ppcarm

################
create symbolic link for linker
################
(CMD) sudo ln -s ~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
(CMD) sudo ln -s ~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.bfd
(CMD) ln -s /usr/bin/arm-linux-androideabi-as arm-linux-as
(CMD) ln -s /usr/bin/arm-linux-androideabi-ld arm-linux-ld

################
update /etc/fpc.cfg
################
Add these lines to /etc/fpc.cfg

#IFDEF ANDROID
#IFDEF CPUARM
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
#ENDIF
#ENDIF

################
install LAMW
################

(CMD) svn co https://github.com/jmpessoa/lazandroidmodulewizard.git
(CMD) ln -s /home/$HOME/Android/svn-lazandroidmodulewizard/trunk /home/$HOME/Android/lazandroidmodulewizard

################
Install LAMW on Lazarus
################

1. From Lazarus IDE - Install Wizard Packages
  1.1 Package -> Open Package -> "tfpandroidbridge_pack.lpk"  [Android Components Bridges!]
     1.1.1 From Package Wizard
                                - Compile
                                - Use -> Install
  1.2 Package -> Open Package -> "lazandroidwizardpack.lpk"
     1.2.1 From Package Wizard
                                - Compile
                                - Use -> Install
  1.3 Package -> Open Package -> "amw_ide_tools.lpk"  [folder: ..\LazAndroidWizard\ide_tools]
     1.3.1 From Package Wizard
                                - Compile
                                - Use -> Install

2. From Lazarus IDE menu Tools -->> "Android Module Wizard" --> Paths Settings"
  update paths settings according to your system
(ref. https://jmpessoa.opendrive.com/files?Ml82Nzg4MzA1OF9yVVU3RA)

     -Path to Java JDK (ex. /usr/lib/jvm/java-7-openjdk-amd64)
     -Path to Android SDK( ex. /home/renabor/Android/sdk)
     -Path to Ant bin (ex. /usr/bin)
     -Select Ndk version: [10]
     -Path to Ndk (ex  /home/$HOME/Android/android-ndk-r10e)
     -Path to Java Resources  [Simonsayz's Controls.java,  *.xml and default Icons]: (ex. /home/$HOME/Android/svn-lazandroidmodulewizard/trunk/java)

################
BUILD YOUR FIRST PROJECT
################

Open a project from lazandroidmodulewizard/demos/Ant or lazandroidmodulewizard/demos/Eclipse directory
open ~/Android/lazandroidmodulewizard/demos/Eclipse/AppDemo1/jni/controls.lpi
from Project->Options, change/modify paths according to your system (under «paths» and «other»)

(ex. for «paths» ../../../Android/android-ndk-r10e/platforms/android-21/arch-arm/usr/lib;/home/$HOME/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.6/)

(ex. for «other» -Xd -CfSoft -CpARMV6 -XParm-linux-androideabi- -FD/home/$HOME/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin)

build it!

################
################
compile for ARM
################
################

from shell
(CMD) cd ~/Android/lazandroidmodulewizard/demos/Eclipse/AppDemo1

################
build.xml
################

<?xml version="1.0" encoding="UTF-8"?>
<project name="AppDemo1" default="help">
<property name="sdk.dir" location="/home/$HOME/Android/sdk"/>
<property name="target"  value="android-19"/>
<property file="ant.properties"/>
<fail message="sdk.dir is missing." unless="sdk.dir"/>
<import file="${sdk.dir}/tools/ant/build.xml"/>
</project>

################
build.sh
################
edit build.sh and leave only this line:

   ant -Dtouchtest.enabled=true debug

################
install.sh
################

- FROM COMMAND LINE
chmod +x ./build.sh
./build.sh
cd bin
~/Android/sdk/tools/android avd &
adb install AppDemo1-debug.apk

Enjoy!
Ieri è passato, domani è futuro, oggi è un dono...

bonmario

  • Hero Member
  • *****
  • Post: 1358
  • Karma: +11/-1
Re:Guida per installare lazarus per programmare android su linux :)
« Risposta #1 il: Agosto 28, 2015, 08:22:20 am »
Ottimo, grazie !!!!

Ciao, Mario

 

Recenti

How To

Utenti
  • Utenti in totale: 803
  • Latest: maXim.FI
Stats
  • Post in totale: 19169
  • Topic in totale: 2286
  • Online Today: 99
  • Online Ever: 900
  • (Gennaio 21, 2020, 08:17:49 pm)
Utenti Online
Users: 0
Guests: 73
Total: 73

Disclaimer:

Questo blog non rappresenta una testata giornalistica poiché viene aggiornato senza alcuna periodicità. Non può pertanto considerarsi un prodotto editoriale ai sensi della legge n. 62/2001.