Virtual Machine + Lazarus + Android lazarus / 43-Android ---------------------------------------------------------------------- xinyiman · 2011-12-27 13:11 Hello, I wanted to know if someone was kind enough to create a virtual machine linux (ubuntu example) with a version of the above Lazarus that allows you to compile Android. Why I Paciocco a bit 'with the various guides I've found, but failed to make the environment! Now my problem is to program on Android not spend my days to prepare the development environment. So I was wondering if those who follow the Android compiler can prepare a virtual machine ready to be programmed on. Let me know thanks ---------------------------------------------------------------------- felipemdc · 2011-12-27 13:18 I dont think anyone has created such a virtual machine. The wiki has step-by-step very clear instructions about how to proceed to setup the environment here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Usin g_the_pre-compiled_compiler I think it would be better if you say in which step you had trouble, which Linux variant you are using, which processor kind you have, etc. Using Mandriva or Mageia Linux might help, because I use these. ---------------------------------------------------------------------- xinyiman · 2011-12-27 13:25 I can not remember, I have tested just about a month ago on a virtual machine. But I am of the view that if there was something already done (and kept updated, so a virtual machine would be really ideal) would have an incentive to use it a lot. If you like to consider it do me a favor. ---------------------------------------------------------------------- IndianaJones · 2011-12-27 13:37 Actually, I am using Mac OS X to compile android example. But my test case (android) and carbon are separated, if you insterested I will write it down the step by step instructions. But perhaps that link which Felipe mentioned is the basic explanation to compile android application. ---------------------------------------------------------------------- xinyiman · 2011-12-27 13:53 In this period I do not have much time to devote, so that's why I asked this question. Similarly it would be nice to have a virtual machine is updated, update the official schedule of items for Android. I also think that many like me do not have much time to devote to the preparation of the development environment and therefore would prefer to devote to program rather than take the time to prepare the environment. ---------------------------------------------------------------------- mdalacu · 2011-12-27 14:14 I also wold appreciate a lite, generic Ubuntu VBox image with Lazarus configured to compile for Android. It's not so easy to follow the guide. Thank you. ---------------------------------------------------------------------- xinyiman · 2011-12-27 14:21 Quote from: mdalacu on December 27, 2011, 03:14:14 pmI also wold appreciate a lite, generic Ubuntu VBox image with Lazarus configured to compile for Android. It's not so easy to follow the guide. Thank you. Thank goodness I'm not alone! ---------------------------------------------------------------------- felipemdc · 2011-12-27 14:24 Quote from: IndianaJones on December 27, 2011, 02:37:45 pmActually, I am using Mac OS X to compile android example. But my test case (android) and carbon are separated, if you insterested I will write it down the step by step instructions. I am interrested in step-by-step instructions to get it working under Mac OS X. It works fine with Linux inside Parallels, but some small things would be more confortable / faster developing directly on Mac OS X. This week I will also be pushing for a Windows snapshot. ---------------------------------------------------------------------- felipemdc · 2011-12-27 14:31 Quote from: mdalacu on December 27, 2011, 03:14:14 pmI also wold appreciate a lite, generic Ubuntu VBox image with Lazarus configured to compile for Android. It's not so easy to follow the guide. Thank you. The best I could ever make would be a Parallels Desktop VM with Mageia Linux. I think it is way too soon for something like that now, but I could add it in our next release. ---------------------------------------------------------------------- felipemdc · 2011-12-27 20:29 I guess it is your lucky day, because I managed to get instructions to build a windows->android cross-compiler: http://wiki.lazarus.freepasca l.org/Custom_Drawn_Interface/Android#Building_the_compiler_yourself_in _Windows But while this is enough to build the native side of the project, one still needs to build the Java side which requires the horrible ant. Setting up ant in Windows is the worse nightmare a programmer can face =( So I gave up on this approach and will build a Virtual Box image for Android development and host it for everyone instead (what you originally wanted). You should thank the Blaise Pascal magazine (http://www.blaisepascal.eu/) for this, since publishing there is what motivates me for this work. ---------------------------------------------------------------------- mdalacu · 2011-12-28 06:26 QuoteSo I gave up on this approach and will build a Virtual Box image for Android development and host it for everyone instead (what you originally wanted). You should thank the Blaise Pascal magazine (http://www.blaisepascal.eu/) for this, since publishing there is what motivates me for this work.Thank you (or who you want me to :-) ), i will wait for this. I also recommend Ubuntu for this, not any other linux distro since is the most common  and google is using it. ---------------------------------------------------------------------- irfanbagus · 2011-12-28 07:54 Quote from: felipemdc on December 27, 2011, 09:29:52 pmBut while this is enough to build the native side of the project, one still needs to build the Java side which requires the horrible ant. Setting up ant in Windows is the worse nightmare a programmer can face =( the hardest part installing ant in windows is setting env variable. iirc only 3 env var "JAVA_HOME","ANT_HOME", and "Path". i'll try to make step by step instruction but may be need some times because currently i dont have fpc rev 16790. ---------------------------------------------------------------------- IndianaJones · 2011-12-28 14:27 Here is the step-by-step instructions for Mac OS X 1. Download sdk and ndk libraries for Mac OS X 2. Configure binutils with the following commands ./configure --target=arm-linux --disable-werror make sudo make install This installation creates the /usr/local/arm-linux/bin directory. 3. a. cd /usr/local/arm-linux/bin     b. sudo mv as as_org 4. Create new "as" file with the following statements with your favorite editor. #!/bin/sh /usr/local/bin/arm-linuas_org -meabi=5 $@ 5. sudo chmod 755 as 6. fpc revision fpc2.5.1 - 16790 {svn -r 16790} 7. Compile new fpc for linux arm sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/usr/local/arm-linux/bin OPT="-dFPC_ARMEL -O- -dFPC_ABI_EABI" 8. Separate the original fpcsrc and the 2.5.1 fpc sources sudo cp -rf packages rtl /usr/local/share/fpcsrc-2.5.1/ {You can create another directory other than fpcsrc, name doesn't matter} 9. In Lazarus, I changed these settings when compiling under linux-arm    a. Tools/IDE Options/Compiler Path/{this is the ppcrossarm compiler}    b. FPC Source Directory {in step 8}    c. Project/Compiler Options/Paths/{android-ndk-r7 directory} 10. Change local.properties sdk.dir to your sdk directory If some of the steps are wrong or want to give some plus information please feel free to share. And Oscar goes to Felipe for additional informations.  Thanks. ---------------------------------------------------------------------- felipemdc · 2011-12-28 20:50 Quote from: IndianaJones on December 28, 2011, 03:27:11 pm2. Configure binutils with the following commands ./configure --target=arm-linux --disable-werror make sudo make install This installation creates the /usr/local/arm-linux/bin directory. So far I was using self installed binutils, but recently I found out that the NDK already includes all binutils you could ever want. Sometimes renaming them to arm-linux-as etc might be necessary or moving them around or symlinking them, but they already code pre- compiled for all platforms for us in the NDK. ---------------------------------------------------------------------- IndianaJones · 2011-12-28 22:40 Good point, i have checked that the NDK toolchains directory consist that utilities. So Have you ever checked out with these toolchains to compile fpc? Or I will control it out later. Thanks. ---------------------------------------------------------------------- felipemdc · 2011-12-28 22:44 Quote from: IndianaJones on December 28, 2011, 11:40:41 pmGood point, i have checked that the NDK toolchains directory consist that utilities. So Have you ever checked out with these toolchains to compile fpc? Or I will control it out later. My Windows instructions already use the binutils from the NDK for the RTL / FCL cross-compilation and also building the LCL example app. The only thing missing was to build the APK, but I had trouble in this part. ---------------------------------------------------------------------- irfanbagus · 2011-12-29 02:15 Quote from: felipemdc on December 28, 2011, 11:44:22 pmQuote from: IndianaJones on December 28, 2011, 11:40:41 pmGood point, i have checked that the NDK toolchains directory consist that utilities. So Have you ever checked out with these toolchains to compile fpc? Or I will control it out later. My Windows instructions already use the binutils from the NDK for the RTL / FCL cross-compilation and also building the LCL example app. The only thing missing was to build the APK, but I had trouble in this part. felipe, could you try this step 1. change "sdk.dir" in file "examples\opengltest\android\local.properties". use slash as path separator ex : sdk.dir=D:/Portable/android-sdk-windows 2. run this command in windows command line (cmd.exe) set Path=D:\Portable\Ant;%Path% set ANT_HOME=D:\Portable\Ant set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_01 cd D:\android-ndk\examples\opengltest\android ant debug ---------------------------------------------------------------------- felipemdc · 2011-12-29 18:02 Quote from: irfanbagus on December 29, 2011, 03:15:32 amfelipe, could you try this step Thanks, but my major problem was not actually configuring in Windows. I don't use Windows at work and also not at home ... My problem was the need to build a snapshot for Windows users which fits into a DVD so that Pascal Magazine readers can use Lazarus to build Android applications. But it is not convenient if it requires a complex set of configurations, because the current DVD comes with a Lazarus which requires only 1 click to start up. But the VM seams an ok solution. But of course one approach doesn't exclude the other, so thanks for informing how to setup ant =) I have already finished the VM, and it also comes with basic accelerometer, GPS and SMS sending support in the example. The only problem now is where to upload it to. It is pretty massive =D 5,2GB ---------------------------------------------------------------------- BlueIcaro · 2011-12-29 19:11 Quote from: felipemdc on December 29, 2011, 07:02:13 pmQuote from: irfanbagus on December 29, 2011, 03:15:32 amfelipe, could you try this step Thanks, but my major problem was not actually configuring in Windows. I don't use Windows at work and also not at home ... My problem was the need to build a snapshot for Windows users which fits into a DVD so that Pascal Magazine readers can use Lazarus to build Android applications. But it is not convenient if it requires a complex set of configurations, because the current DVD comes with a Lazarus which requires only 1 click to start up. But the VM seams an ok solution. But of course one approach doesn't exclude the other, so thanks for informing how to setup ant =) I have already finished the VM, and it also comes with basic accelerometer, GPS and SMS sending support in the example. The only problem now is where to upload it to. It is pretty massive =D 5,2GB I have 24 Gb free on my SkyDrive public folder. I can host it. But How can you send me that big file? /BlueIcaro ---------------------------------------------------------------------- felipemdc · 2011-12-29 19:46 thanks, but for now I am trying sourceforge. But it will take aprox. 24h to finish the upload =D ---------------------------------------------------------------------- felipemdc · 2011-12-30 19:05 Quote from: felipemdc on December 28, 2011, 11:44:22 pmQuote from: IndianaJones on December 28, 2011, 11:40:41 pmGood point, i have checked that the NDK toolchains directory consist that utilities. So Have you ever checked out with these toolchains to compile fpc? Or I will control it out later. My Windows instructions already use the binutils from the NDK for the RTL / FCL cross-compilation and also building the LCL example app. The only thing missing was to build the APK, but I had trouble in this part. Today I did a full build cycle with the Android binutils and yes, they work fine and generate a working APK in the end. ---------------------------------------------------------------------- felipemdc · 2011-12-31 12:49 Ok, it is uploaded: https://sourceforge.net/projects/p- tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/ Instructions here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Int erface/Android#Use_the_ready_Virtual_Box_Image_with_FPC_and_Lazarus But note that it won't be possible to download now, because sourceforge is still copying it to the mirrors. Tomorrow for sure it should be ready for download tomorrow (or maybe later today). Updating svn for lazarus inside the VM might be a good idea, because I added some features since it was created. But it also has some risk, like trunk always has. ---------------------------------------------------------------------- fredycc · 2011-12-31 22:33 Wow thanks felipemdc, I'm downloading files now.  Regards ---------------------------------------------------------------------- BigChimp · 2012-01-01 09:02 Great Felipe, thanks, I'm downloading it now (hope I can adapt it for my Nokia N9 Maemo/Meego/Debian ARM machine - at least beats having to start from scratch)! A question: the Sourceforge ptools site mentions there are tools for remote administration. I saw OpenSSL for Windows CE. Is that what you meant? I'm planning to build a Lazarus tool to manage my router via SSH, that's why I'm asking. Thanks again & feliz ano novo/szczesliwego nowego roku  (Don't understand Polish well enough to be sure my copy/paste action is right - hope so ) ---------------------------------------------------------------------- felipemdc · 2012-01-01 09:58 Quote from: BigChimp on January 01, 2012, 10:02:30 amA question: the Sourceforge ptools site mentions there are tools for remote administration. I saw OpenSSL for Windows CE. Is that what you meant? I have no idea what I was thinking when I wrote that, but I don't think I have ever worked on developing remote administration tools. But if you want to host anything there, sure, no problem, although the lazarus-ccr is also an idea. I use p-tools as a repository for all my stuff which don't fit in other places. Like these Android snapshots, but also some experimental code that I write and stuff like that. QuoteThanks again & feliz ano novo/szczesliwego nowego roku  (Don't understand Polish well enough to be sure my copy/paste action is right - hope so ) No, it was pretty good, just missing some accents: szczęśliwego nowego roku Happy new year =) The forum says you are from netherlands, so you might want to come in the Lazarus Day organized by the Blaise Pascal magazine, it is usually in April. ---------------------------------------------------------------------- BigChimp · 2012-01-01 10:08 Quote from: felipemdc on January 01, 2012, 10:58:04 amI have no idea what I was thinking when I wrote that, but I don't think I have ever worked on developing remote administration tools. But if you want to host anything there, sure, no problem, although the lazarus-ccr is also an idea. Thanks. When I have something nice, I'll definitely try to get it into Lazarus CCR. Too many repositories can be a bad thing  Quote from: felipemdc on January 01, 2012, 10:58:04 amNo, it was pretty good, just missing some accents: szczęśliwego nowego roku Happy new year =) The forum says you are from netherlands, so you might want to come in the Lazarus Day organized by the Blaise Pascal magazine, it is usually in April. Oh yes, those accents.... brrr. I can't understand the difference between the various r's but well as I only know a couple of words I guess it doesn't matter  Thx for the heads up on the Lazarus Day, appreciate it. Gelukkig nieuwjaar ---------------------------------------------------------------------- DelphiFreak · 2012-01-01 18:13 Thank you. I have downloaded it twice and got both time the same error: 7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18 p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,4 CPUs) Processing archive: /home/sam/Downloads/Android Devel VM.hdd.zip Extracting  Android Devel VM.hdd     CRC Failed Sub items Errors: 1 Did someone successfully download the virtualBox? I am runing Mint Linux Version 12. ---------------------------------------------------------------------- felipemdc · 2012-01-01 18:43 Check the MD5. Source forge has a MD5 for the file there. I checked and it is the same as for my local file. Try another uncompresser, something more normal like just "unzip" from the command line. And yes, the Blaise Pascal editor managed to download, so it must work. He was using Windows. ---------------------------------------------------------------------- BigChimp · 2012-01-01 20:07 MD5 sum (a5efbc5c07fecec7f462d05c9408b4f0) matched with what was on Sourceforge. 7zip GUI and 7za.exe on Windows x64 both failed (CRC error). Using infozip's unzip.exe 6.00 seemed to work - probably a bug in 7zip !?!? ---------------------------------------------------------------------- DelphiFreak · 2012-01-02 08:39 Ok, I unzipped the file on a windows machine and it worked. No idea why it's not possible to unzip on linux.(tried also with peazip, claims also crc-failure) Anyway, I could start the virtual-machine now. But when I start lazarus, I get immediately the error message "Compiler "usr/bin/fpc" does not support target arm-linux. ---------------------------------------------------------------------- felipemdc · 2012-01-02 09:01 I compressed with the standard Mac OS X zipper, so I am not using any unusual zipper. Probably those utilities have an old version of the zip library. In the case of peazip I vaguely remember the crc problem in the bug tracker if it uses paszlib. Quote from: DelphiFreak on January 02, 2012, 09:39:04 amAnyway, I could start the virtual-machine now. But when I start lazarus, I get immediately the error message "Compiler "usr/bin/fpc" does not support target arm-linux. Ignore this error, it is false. I don't know why it says that, but it works despite that. ---------------------------------------------------------------------- WayneSherman · 2012-01-02 21:31 Quote from: felipemdc on December 31, 2011, 01:49:25 pmOk, it is uploaded: https://sourceforge.net/projects/p- tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/ Works beautifully.  Thanks much.  It works for me using Qemu/KVM on a headless "funtoo" server and connecting via VNC like this:  (after extracting image and renaming it to remove spaces) Code: [Select]qemu-system-x86_64 \   -name "Android_Devel_VM.hdd" \   -drive file=./Android_Devel_VM.hdd \   -net nic \   -net user \   -m 1024 \   -usbdevice tablet \   -enable-kvm \   -vnc :1 \   -vga vmware \   -snapshot (note the "-snapshot" param is for testing, it prevents permanent changes to the base image.) How do you generate a release version of andriodlcltest/androidlcltest.apk?  Will the APK be smaller with no debug data? Thanks, Wayne Sherman ---------------------------------------------------------------------- WayneSherman · 2012-01-02 22:43 Quote from: Wayne on January 02, 2012, 10:31:47 pmWorks beautifully.  Qemu/KVM... After some more testing in Qemu/KVM, I have seen a little instability, but it looks like it will work for the most part.  I discovered I couldn't run from the image and store changes to it directly so I created a branch/delta file using the image file as the base: Code: [Select]qemu-img create -f qcow2 -b Android_Devel_VM.hdd Android_Devel_VM.delta qemu-system-x86_64 \   -name "Android_Devel_VM" \   -drive file=Android_Devel_VM.delta \   -net nic \   -net user \   -m 1024 \   -usbdevice tablet \   -enable-kvm \   -vnc :1 \   -vga vmware ---------------------------------------------------------------------- epzybook · 2012-01-03 03:55 It seems that it does not support Chinese character in edit field. Maybe because of the input method of Chinese, as we key in 'wen' first,, the edit field will appear 'wen' with underline, then we pick one Chinese character from the list, and then the right Chinese character would show up in the edit field. Lazarus seems like that it does not support this kind of input method,so when we key in 'wen', the 'wen' will be right here, we can't pick Chinese character any more. Maybe it's the reason that  Lazarus treat a string by character one by one, if it can treat a string just like a string, it will be better. ---------------------------------------------------------------------- felipemdc · 2012-01-03 14:18 Quote from: epzybook on January 03, 2012, 04:55:40 amIt seems that it does not support Chinese character in edit field. Which edit field? Running in Android or in the IDE in Linux? ---------------------------------------------------------------------- joseme · 2012-01-03 16:57 I managed to download and install the virtual machine. Lazarus open the example project, when I do modifications and rebuild it, open the terminal windows and issue the command "ant debug" nothing happens. The output is as follows: Code: [Select][pascaldev@localhost android]$ ant debug Buildfile: /home/pascaldev/Programas/lazarus/examples/androidlcl/andro id/build.xml -set-mode-check: -set-debug-files: -set-debug-mode: -debug-obfuscation-check: -setup:      [echo] Gathering info for LCLExample...     [setup] Android SDK Tools Revision 16     [setup] Project Target: Android 2.2     [setup] API level: 8     [setup]     [setup] ------------------     [setup] Resolving library dependencies:     [setup] No library dependencies.     [setup]     [setup] ------------------     [setup] -build-setup:      [echo] Creating output directories if needed... -pre-build: -code-gen:      [echo] ----------      [echo] Handling aidl files...      [aidl] No AIDL files to compile.      [echo] ----------      [echo] Handling RenderScript files... [renderscript] No RenderScript files to compile.      [echo] ----------      [echo] Handling Resources...      [aapt] No changed resources. R.java and Manifest.java untouched. -pre-compile: -compile: -post-compile: -obfuscate: -dex:       [dex] No new compiled code. No need to convert bytecode to dalvik format. -crunch:    [crunch] Crunching PNG Files in source dir: /home/pascaldev/Programas/lazarus/examples/androidlcl/android/res    [crunch] To destination dir: /home/pascaldev/Programas/lazarus/examples/androidlcl/android/bin/res    [crunch] Crunched 0 PNG files to update cache -package-resources:      [aapt] No changed resources or assets. LCLExample.ap_ remains untouched -package: [apkbuilder] No changes. No need to create apk. -do-debug:  [zipalign] No changes. No need to run zip-align on the apk.      [echo] Debug Package: /home/pascaldev/Programas/lazarus/examples/ androidlcl/android/bin/LCLExample-debug.apk debug: [propertyfile] Updating property file: /home/pascaldev/Programas/lazar us/examples/androidlcl/android/bin/build.prop [propertyfile] Updating property file: /home/pascaldev/Programas/lazar us/examples/androidlcl/android/bin/build.prop [propertyfile] Updating property file: /home/pascaldev/Programas/lazar us/examples/androidlcl/android/bin/build.prop [propertyfile] Updating property file: /home/pascaldev/Programas/lazar us/examples/androidlcl/android/bin/build.prop BUILD SUCCESSFUL I do not know why ant does not see changes in the code My expertise in Linux is 0 ---------------------------------------------------------------------- felipemdc · 2012-01-03 17:21 Did you test the APK and really check that it didn't reflect your changes? ---------------------------------------------------------------------- IndianaJones · 2012-01-03 18:42 I know, it is nonsense but can you remove the bin directory (sudo rm -rf bin) and execute the command again. (ant debug) ---------------------------------------------------------------------- joseme · 2012-01-03 22:57 To Felipe: yes I checked the APK and it's unchanged. To Indiana: I will try your idea. Thanks everybody! ---------------------------------------------------------------------- joseme · 2012-01-03 23:32 Nonsense sometimes is the right option. I removed the entire bin directory and everything is OK. Thanks!!! ---------------------------------------------------------------------- epzybook · 2012-01-04 02:59 Quote from: felipemdc on January 03, 2012, 03:18:04 pmQuote from: epzybook on January 03, 2012, 04:55:40 amIt seems that it does not support Chinese character in edit field. Which edit field? Running in Android or in the IDE in Linux? yes, i running in android. ---------------------------------------------------------------------- felipemdc · 2012-01-04 10:04 Quote from: epzybook on January 04, 2012, 03:59:27 amyes, i running in android. Ok, so it is expected. I haven't yet finished KeyPress support, so I am aware of various issues with it. KeyDown/KeyUp are very easy in Android, but KeyPress is very hard and underdocumented. Edit: Try rev 34571 Now I added a new keychar implementation which hopefully should work for chinese. Now the only issue I know with text input is that when longclicking in the virtual keyboard it inputs both the face key and the selected key. No idea why it is inputing the face key too. But probably this doesn't affect chinese input. ---------------------------------------------------------------------- epzybook · 2012-01-05 12:42 Quote from: felipemdc on January 04, 2012, 11:04:50 amQuote from: epzybook on January 04, 2012, 03:59:27 amyes, i running in android. Ok, so it is expected. I haven't yet finished KeyPress support, so I am aware of various issues with it. KeyDown/KeyUp are very easy in Android, but KeyPress is very hard and underdocumented. Edit: Try rev 34571 Now I added a new keychar implementation which hopefully should work for chinese. Now the only issue I know with text input is that when longclicking in the virtual keyboard it inputs both the face key and the selected key. No idea why it is inputing the face key too. But probably this doesn't affect chinese input. Sorry, could you please specifically explain how to 'rev 3451'? Actually I don't know what is 'rev', my English is poor ---------------------------------------------------------------------- BigChimp · 2012-01-05 13:40 Rev=revision, in this case the revision in the Subversion version control system used by FPC and Lazarus... See e.g. the Wiki for documentation on how to use subversion (hint: something like: cd ; svn update; make) ---------------------------------------------------------------------- mdalacu · 2012-01-05 14:15 Thank you, the VM is working just fine. I have also had to delete the bin folder in order to generate a new apk. ---------------------------------------------------------------------- epzybook · 2012-01-06 06:29 Quote from: felipemdc on January 04, 2012, 11:04:50 amOk, so it is expected. I haven't yet finished KeyPress support, so I am aware of various issues with it. KeyDown/KeyUp are very easy in Android, but KeyPress is very hard and underdocumented. Edit: Try rev 34571 Now I added a new keychar implementation which hopefully should work for chinese. Now the only issue I know with text input is that when longclicking in the virtual keyboard it inputs both the face key and the selected key. No idea why it is inputing the face key too. But probably this doesn't affect chinese input. hi,felipemdc, i had rev 34571 version, and rebuild the androidlcl demo, but aslo can not input chinese. ---------------------------------------------------------------------- epzybook · 2012-01-06 07:20 Quote from: BigChimp on January 05, 2012, 02:40:59 pmRev=revision, in this case the revision in the Subversion version control system used by FPC and Lazarus... See e.g. the Wiki for documentation on how to use subversion (hint: something like: cd ; svn update; make) Got it, thank you, but sadly it still can not support Chinese input... ---------------------------------------------------------------------- felipemdc · 2012-01-06 09:41 Hello, Could you give some step-by-step instructions about how to test chinese input in the emulator and also in a real device without chinese input pre-installed? (in this case starting by which input method to download and install) ---------------------------------------------------------------------- epzybook · 2012-01-06 10:40 Quote from: felipemdc on January 06, 2012, 10:41:32 amHello, Could you give some step-by-step instructions about how to test chinese input in the emulator and also in a real device without chinese input pre-installed? (in this case starting by which input method to download and install) Instead of testing in emulator, I just test in real devices which respectively are Samsung Galaxy Tab,Moto Droid Pro,Orange Sanfrancisco, HTC HD2, leading to the same result. Actually when you input English, the Chinese input method is just working like common virtual keyboard, when you input Chinese, it will look like the picture below, as you key in the character 'wo', then a list of Chinese words for selecting will appear, if you select '***(for example a Chinese word)', then '***' will show in the edit field. But now the problem is, when I press '***', nothing happened. ---------------------------------------------------------------------- felipemdc · 2012-01-06 17:44 Did the chinese input come pre-installed in your devices or did you install it from the Android market? If it came pre-installed, then please find an input method which can be tested in the emulator or installed from the market. Otherwise how can I implement support for something which I cannot test? ---------------------------------------------------------------------- epzybook · 2012-01-07 03:44 Quote from: felipemdc on January 06, 2012, 06:44:38 pmDid the chinese input come pre-installed in your devices or did you install it from the Android market? If it came pre-installed, then please find an input method which can be tested in the emulator or installed from the market. Otherwise how can I implement support for something which I cannot test? Sure you can install Chinese input method from the Market, here are some of them: https://market.android.com/details?id=com.baidu.input https://market.android.com/details?id=com.sohu.inputmethod.sogou https://market.android.com/details?id=com.tencent.qqpinyin ---------------------------------------------------------------------- felipemdc · 2012-01-09 14:57 I just tested Baidu and it worked fine for me. ---------------------------------------------------------------------- epzybook · 2012-01-10 06:16 Quote from: felipemdc on January 09, 2012, 03:57:59 pmI just tested Baidu and it worked fine for me. Really, that is great, could you please upload the demo apk file, then I can test on my device, thanks in advance. ---------------------------------------------------------------------- felipemdc · 2012-01-10 10:17 I uploaded it here: http://sourceforge.net/projects/p- tools/files/Android%20LCL%20Example%20Snapshot/ LCLExample-8-jan-2012.apk ---------------------------------------------------------------------- epzybook · 2012-01-10 12:34 Quote from: felipemdc on January 10, 2012, 11:17:16 amI uploaded it here: http://sourceforge.net/projects/p- tools/files/Android%20LCL%20Example%20Snapshot/ LCLExample-8-jan-2012.apk Thank you, it worked on my site this time. ---------------------------------------------------------------------- epzybook · 2012-01-10 14:01 Quote from: felipemdc on January 10, 2012, 11:17:16 amI uploaded it here: http://sourceforge.net/projects/p- tools/files/Android%20LCL%20Example%20Snapshot/ LCLExample-8-jan-2012.apk I still can not make it work, I did it this way: sudo -i root then enter directory of lazarus, svn update -r 34571 make and then enter directory androidlcl, delete all old .apk files, start lazaru, build the project, ant debug, make out the .apk file. Is there anything I miss out in this processing, or any configuration to make it support UTF-8 or Unicode what ever? ---------------------------------------------------------------------- felipemdc · 2012-01-10 14:11 After "svn update" there is no need for "make". You have to rebuild the library, not Lazarus. In your steps there is no library building. Where is the library building? You have to open the androidlcltest.lpi file and build it in Lazarus. That's probably why you had to delete the bin directory in the first place. If you didn't rebuild the shared object then there is really nothing changed. If even then it doesn't work the next thing to test would be doing "svn update" to get the latest instead of limiting it to a particular revision. ---------------------------------------------------------------------- CC · 2012-01-10 19:00 Hi, First of all: it was amazing to see the test app created with Lazarus running on my android handset. Great breakthrough, congrats! I am just starting to explore, which of course means questions: 1. What is the root password? (I need to add languages) 2. Can I just copy the Lazarus dir to an other distro? Sould it work? 3. I was hoping to find an svn client in virtual machine. Is there one known to work with this distro? 4. I know normally svn is for source only, but in this case it seems reasonable to me to put all the required stuff into one directory and make it available via svn. In time everynone learns to setup the enviroment, but it would be helpful to have an easily installable one. 5. Are the paths right? I am unable to recompile the test. After deleting the apk's new ones are not created. This is just the beginning of android story with Lazarus  and I do not mean to rush anything. But I am evaluating if Lazarus will be suitable for a simple project. So, what are the chances for 1.  scrollable windows? 2.  TCP/IP, http communication? (It is basically linux, so it my not be much different) Thx, CC ---------------------------------------------------------------------- felipemdc · 2012-01-10 19:20 Quote from: CC on January 10, 2012, 08:00:36 pm1. What is the root password? (I need to add languages) This info is here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Use_ the_ready_Virtual_Box_Image_with_FPC_and_Lazarus In short it is "root" Quote2. Can I just copy the Lazarus dir to an other distro? Sould it work? If you follow all steps here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Usin g_the_pre-compiled_compiler_in_Linux And configure all build packages for gtk2, and also ant, android ndk, android sdk and everything here: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Comp iling_the_example_LCL_Android_Application Then it should work. Quote3. I was hoping to find an svn client in virtual machine. Is there one known to work with this distro? Svn is already installed in the virtual machine. The entire Lazarus tree there is obtained from svn. Try going to the Lazarus dir and do "svn up" Quote5. Are the paths right? I am unable to recompile the test. After deleting the apk's new ones are not created. Please give exact step-by-step description of what you are trying to do and screenshots of where it goes wrong. And always follow the wiki instructions, for example: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Comp iling_the_example_LCL_Android_Application QuoteThis is just the beginning of android story with Lazarus  and I do not mean to rush anything. But I am evaluating if Lazarus will be suitable for a simple project. So, what are the chances for 1.  scrollable windows? The VM is not the latest code, it is from the time when I made the VM. Do svn update in your Lazarus directory inside the VM and TForm scrolling already works. Quote2.  TCP/IP, http communication? (It is basically linux, so it my not be much different) Try lNet and/or Synapse ---------------------------------------------------------------------- CC · 2012-01-11 14:07 Felipe,  All I had to do was to remove the bin dir before building tha apk as suggested before. Thought I  had tried this before, but apparently not. After updating the source even scrolling is working. Though it reacts  kind of slowly and not as mooth as normaly. Also after the first  srolling the dialog and the second form cannot be made visible  any more. Pushing the buttons has no effect after that. My goal is being able to  display easily scrollable lists showing data from a local/remote database.  Have not tried the network part yet, that is next I will be testing. I have been following your progress with android for some time, so I can appreciate the effort needed to get this far. But  I hope from now it is becoming more and more fun as the results of your work start showing. It is definitely exciting for me.  I was in a bit of a rush, could have found the answers to some  of my question  myself. I will try to be more thorough from now. Thanks for your help. ---------------------------------------------------------------------- felipemdc · 2012-01-11 15:03 Quote from: CC on January 11, 2012, 03:07:21 pmAll I had to do was to remove the bin dir before building tha apk as suggested before. Thought I  had tried this before, but apparently not. After updating the source even scrolling is working. Though it reacts  kind of slowly and not as mooth as normaly. Also after the first  srolling the dialog and the second form cannot be made visible  any more. Pushing the buttons has no effect after that. Yes, the scrolling support is quite initial. I added just the minimal to be able to see what is outside the screen area. A lot of work is necessary. You can open bug reports so that this isn't forgotten. Patches are also welcome. ---------------------------------------------------------------------- epzybook · 2012-01-11 17:00 Quote from: felipemdc on January 10, 2012, 03:11:56 pmAfter "svn update" there is no need for "make". You have to rebuild the library, not Lazarus. In your steps there is no library building. Where is the library building? hi,felipemdc, pls tell me how can i rebuild the library? thanks a lot. ---------------------------------------------------------------------- felipemdc · 2012-01-11 17:53 Quote from: epzybook on January 11, 2012, 06:00:57 pmhi,felipemdc, pls tell me how can i rebuild the library? Please read: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Comp iling_the_example_LCL_Android_Application Building the library is "Step 2 - Build the project using the Lazarus IDE" ---------------------------------------------------------------------- epzybook · 2012-01-12 14:23 Quote from: felipemdc on January 11, 2012, 06:53:06 pmhttp://wiki.laza rus.freepascal.org/Custom_Drawn_Interface/Android#Compiling_the_exampl e_LCL_Android_Application Building the library is "Step 2 - Build the project using the Lazarus IDE" hi,felipemdc, i have done it,thank you so much. ---------------------------------------------------------------------- CC · 2012-01-15 19:13 Quote from: felipemdc on January 11, 2012, 04:03:37 pmQuote from: CC on January 11, 2012, 03:07:21 pmAll I had to do was to remove the bin dir before building tha apk as suggested before. Thought I  had tried this before, but apparently not. After updating the source even scrolling is working. Though it reacts  kind of slowly and not as mooth as normaly. Also after the first  srolling the dialog and the second form cannot be made visible  any more. Pushing the buttons has no effect after that. Yes, the scrolling support is quite initial. I added just the minimal to be able to see what is outside the screen area. A lot of work is necessary. You can open bug reports so that this isn't forgotten. Patches are also welcome. Problem is probably not with scrolling itself. When the screen is scrolled back to its original position everything works fine. I am guessing maybe handling the button click does not take scrolling into account yet. Once I will be familiar enough with the code I will try if I can make  useful patches. Will see how it goes. ---------------------------------------------------------------------- CC · 2012-01-15 20:15 Felipe, could you tell me where the code handling scrolling  on android can be found? Is it possible to have the same code for  android GUI elements and other platforms or did you have to create saparate code branches at some places in the code? ---------------------------------------------------------------------- felipemdc · 2012-01-16 14:22 Quote from: CC on January 15, 2012, 08:13:48 pmProblem is probably not with scrolling itself. When the screen is scrolled back to its original position everything works fine. I am guessing maybe handling the button click does not take scrolling into account yet. ..... could you tell me where the code handling scrolling  on android can be found? Is it possible to have the same code for  android GUI elements and other platforms or did you have to create saparate code branches at some places in the code? You can find all commits which I did to customdrawn in viewcv: http://svn.freepascal.org/cgi- bin/viewvc.cgi/trunk/lcl/interfaces/customdrawn/?root=lazarus&view=log In special for scrolling these are the most important commits: http://svn.freepascal.org/cgi- bin/viewvc.cgi?view=rev&root=lazarus&revision=34523 http://svn.freepascal.org/cgi- bin/viewvc.cgi?view=rev&root=lazarus&revision=34524 http://svn.freepascal.org/cgi- bin/viewvc.cgi?view=rev&root=lazarus&revision=34526 The scrolling was only added as a factor to the drawing, so event handling code is unaware of it. The event handling is here: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/cust omdrawn/customdrawnprivate.pas?view=markup&root=lazarus In these functions: procedure CallbackMouseUp(AWindowHandle: TCDForm; x, y: Integer; Button: TMouseButton; ShiftState: TShiftState = []); procedure CallbackMouseDown(AWindowHandle: TCDForm; x, y: Integer; Button: TMouseButton; ShiftState: TShiftState = []); procedure CallbackMouseMove(AWindowHandle: TCDForm; x, y: Integer; ShiftState: TShiftState = []); You need to change these functions so that they take the scroll into consideration. ---------------------------------------------------------------------- epzybook · 2012-01-17 04:51 Sadly, it is seems not support listbox and memo, does any body build application with listbox or memo successful? ---------------------------------------------------------------------- felipemdc · 2012-01-17 08:17 Quote from: epzybook on January 17, 2012, 05:51:00 amSadly, it is seems not support listbox and memo, does any body build application with listbox or memo successful? Both controls need to be first implemented as lazarus custom drawn controls in the LCL in the unit customdrawncontrols.pas before LCL- CustomDrawn can have them. The memo will just be the TCDEdit control, but with added support for multiple lines. ---------------------------------------------------------------------- felipemdc · 2012-01-18 10:20 Ok, now I commited a new improvement to correctly handle long pressing virtual keyboard keys =) Now I dont know any issues with the keyboard support. The latest commit for this was http://svn.freepascal.org/cgi- bin/viewvc.cgi?view=rev&root=lazarus&revision=34770 Maybe only that the dictionary lookup seams disabled. ---------------------------------------------------------------------- epzybook · 2012-01-18 13:50 Quote from: felipemdc on January 17, 2012, 09:17:38 amQuote from: epzybook on January 17, 2012, 05:51:00 amSadly, it is seems not support listbox and memo, does any body build application with listbox or memo successful? Both controls need to be first implemented as lazarus custom drawn controls in the LCL in the unit customdrawncontrols.pas before LCL- CustomDrawn can have them. The memo will just be the TCDEdit control, but with added support for multiple lines. I have taken a look at customdrawncontrols.pas, the tcdlistview is included, I add tlistview to form1 and use customdrawncontrols.pas in the .pas file, then build to apk file, but it can not run properly in neither emulator nor device, when you press the software icon, it just simply exit. Any idea or suggestion? thanks. ---------------------------------------------------------------------- felipemdc · 2012-01-18 13:55 Quote from: epzybook on January 18, 2012, 02:50:04 pmI have taken a look at customdrawncontrols.pas, the tcdlistview is included, I add tlistview to form1 and use customdrawncontrols.pas in the .pas file, then build to apk file, but it can not run properly in neither emulator nor device, when you press the software icon, it just simply exit. Any idea or suggestion? thanks. That some CD controls crash is something that I am investigating, but it doesn't matter at the moment. The point is that TCDListView is not finished, it is not even yet usable. My suggestion would be to first finish it. Start testing on a desktop widgetset like gtk2, win32 or anything else. Then finish it. Then send me a patch and I will do the rest. The code to draw all controls is in the LCL in customdrawn_common.pas Read also customdrawndrawers.pas ---------------------------------------------------------------------- lyh1 · 2012-04-17 08:25 Does anyone going the eclipse + lazarus path? So we have a template android project and put the pascal part in it, and  eclipse will handle the java side ,code signing and deployment etc... ---------------------------------------------------------------------- felipemdc · 2012-04-17 08:47 Eclipse is not necessary. Packaging and code signing are trivial. Check the wiki: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interf ace/Android#Step_4_-_Creating_the_APK_package ---------------------------------------------------------------------- Leledumbo · 2012-04-17 15:19 QuoteDoes anyone going the eclipse + lazarus path? So we have a template android project and put the pascal part in it, and  eclipse will handle the java side ,code signing and deployment etc...What would the java side do? I've got a template and those nasty packaging mechanism is handled by a makefile and AFAIK a script file has also been created by Felipe (and Jonas?), though it's windows only ATM (i.e. as a batch file), it's simply executing a couple of Android SDK/JDK tools, no need to waste resources for eclipse. ---------------------------------------------------------------------- lyh1 · 2012-04-18 09:13 I said eclipse because the DDMS of it is so handy, the logcat is also much nicer than a terminal window(Filter, pause etc). But now I am facing another problem, after I modified the sample AndroidLCL project and recompile it, it crash after [TCDWidgetSet.DestoryTimer] TimerHandle=45721AE0. Just a blank form there and I have no idea why. ---------------------------------------------------------------------- felipemdc · 2012-04-18 09:15 Please open a new thread showing what exact things you modified. ---------------------------------------------------------------------- rian · 2012-07-22 06:14 about virtual machine... hm can somebody give step by step tutorial, what do you do to create "hello world" application and run it on emulator I actually have no ideas what should i create in file->new so ok i can create a form with some buttons and edits, it's running as usual application, why not running emulator?