Recent

Author Topic: Virtual Machine + Lazarus + Android  (Read 57284 times)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Virtual Machine + Lazarus + Android
« Reply #30 on: January 02, 2012, 10:01:50 am »
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.

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.

Ignore this error, it is false. I don't know why it says that, but it works despite that.
« Last Edit: January 02, 2012, 10:03:21 am by felipemdc »

WayneSherman

  • Jr. Member
  • **
  • Posts: 58
Re: Virtual Machine + Lazarus + Android
« Reply #31 on: January 02, 2012, 10:31:47 pm »
Ok, 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

  • Jr. Member
  • **
  • Posts: 58
Re: Virtual Machine + Lazarus + Android
« Reply #32 on: January 02, 2012, 11:43:31 pm »
Works 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

  • New Member
  • *
  • Posts: 14
Re: Virtual Machine + Lazarus + Android
« Reply #33 on: January 03, 2012, 04:55:40 am »
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.
« Last Edit: January 03, 2012, 05:58:10 am by epzybook »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Virtual Machine + Lazarus + Android
« Reply #34 on: January 03, 2012, 03:18:04 pm »
It seems that it does not support Chinese character in edit field.

Which edit field? Running in Android or in the IDE in Linux?

joseme

  • Full Member
  • ***
  • Posts: 128
    • Logosoft sistemas
Re: Virtual Machine + Lazarus + Android
« Reply #35 on: January 03, 2012, 05:57:29 pm »
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/android/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/lazarus/examples/androidlcl/android/bin/build.prop
[propertyfile] Updating property file: /home/pascaldev/Programas/lazarus/examples/androidlcl/android/bin/build.prop
[propertyfile] Updating property file: /home/pascaldev/Programas/lazarus/examples/androidlcl/android/bin/build.prop
[propertyfile] Updating property file: /home/pascaldev/Programas/lazarus/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 :)
un aporte a la comunidad:
http://pascalylazarus.blogspot.com/

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Virtual Machine + Lazarus + Android
« Reply #36 on: January 03, 2012, 06:21:25 pm »
Did you test the APK and really check that it didn't reflect your changes?

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: Virtual Machine + Lazarus + Android
« Reply #37 on: January 03, 2012, 07:42:23 pm »

I know, it is nonsense but can you remove the bin directory (sudo rm -rf bin) and execute the command again. (ant debug)

joseme

  • Full Member
  • ***
  • Posts: 128
    • Logosoft sistemas
Re: Virtual Machine + Lazarus + Android
« Reply #38 on: January 03, 2012, 11:57:22 pm »
To Felipe: yes I checked the APK and it's unchanged.
To Indiana: I will try your idea.
Thanks everybody!
un aporte a la comunidad:
http://pascalylazarus.blogspot.com/

joseme

  • Full Member
  • ***
  • Posts: 128
    • Logosoft sistemas
Re: Virtual Machine + Lazarus + Android
« Reply #39 on: January 04, 2012, 12:32:29 am »
Nonsense sometimes is the right option. I removed the entire bin directory and everything is OK. Thanks!!!
un aporte a la comunidad:
http://pascalylazarus.blogspot.com/

epzybook

  • New Member
  • *
  • Posts: 14
Re: Virtual Machine + Lazarus + Android
« Reply #40 on: January 04, 2012, 03:59:27 am »
It 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

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Virtual Machine + Lazarus + Android
« Reply #41 on: January 04, 2012, 11:04:50 am »
yes, 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.
« Last Edit: January 04, 2012, 12:24:04 pm by felipemdc »

epzybook

  • New Member
  • *
  • Posts: 14
Re: Virtual Machine + Lazarus + Android
« Reply #42 on: January 05, 2012, 01:42:37 pm »
yes, 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

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Virtual Machine + Lazarus + Android
« Reply #43 on: January 05, 2012, 02:40:59 pm »
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 <lazarusdir>; svn update; make)
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

mdalacu

  • Full Member
  • ***
  • Posts: 199
    • dmSimpleApps
Re: Virtual Machine + Lazarus + Android
« Reply #44 on: January 05, 2012, 03:15:19 pm »
Thank you, the VM is working just fine. I have also had to delete the bin folder in order to generate a new apk.