Recent

Author Topic: LCL-CustomDrawn substitutes LCL-Android  (Read 83885 times)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #45 on: December 19, 2011, 03:08:13 pm »
1> First screen rotation does not execute unless I click the screen. very wierd.

I fixed this in rev 34280 by changing from SurfaceView to View.

2> The secondary form seams to adjust its DPI correctly but not width, but the log doesnt show anything wrong.

I fixed this in rev 34281

Ok, so now missing stuff are:

1> Implement form scrolling
2> Fix TCDEdit (it has a number of bugs)
« Last Edit: December 19, 2011, 03:32:23 pm by felipemdc »

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #46 on: December 19, 2011, 06:41:17 pm »

I have tested the last release, here is the adb logcat output.

D/dalvikvm( 2425): GC_EXPLICIT freed 22K, 49% free 2774K/5379K, external 1625K/2137K, paused 55ms
W/KeyCharacterMap(  156): No keyboard for id 131074
W/KeyCharacterMap(  156): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
V/RenderScript_jni(  177): surfaceCreated
V/RenderScript_jni(  177): surfaceChanged
D/dalvikvm( 2593): GC_EXPLICIT freed 12K, 49% free 3729K/7175K, external 1625K/2137K, paused 235ms
I/ActivityManager(   92): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.lcltest/.LCLActivity } from pid 177
I/ActivityManager(   92): Start proc com.pascal.lcltest for activity com.pascal.lcltest/.LCLActivity: pid=2946 uid=10072 gids={}
I/lclapp  ( 2946): Trying to load liblclapp.so
D/dalvikvm( 2946): Trying to load lib /data/data/com.pascal.lcltest/lib/liblclapp.so 0x405145e0
I/lclapp  ( 2946): [TCDWSCustomCheckBox.GetPreferredSize] Width=21 Height=15
I/lclapp  ( 2946): [FORMS.PP] ExceptionOccurred
I/lclapp  ( 2946):   Sender=EIntOverflow
I/lclapp  ( 2946):   Exception=Arithmetic overflow
I/lclapp  ( 2946):   Stack trace:
I/lclapp  ( 2946):   $8096B1C8
I/lclapp  ( 2946): TApplication.HandleException Arithmetic overflow
I/lclapp  ( 2946):   Stack trace:
I/lclapp  ( 2946):   $8096B1C8
I/ActivityManager(   92): Process com.pascal.lcltest (pid 2946) has died.
V/RenderScript_jni(  177): surfaceDestroyed
W/InputManagerService(   92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@409a5340
V/RenderScript_jni(  177): surfaceCreated
V/RenderScript_jni(  177): surfaceChanged
W/InputManagerService(   92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40a544f8

P.S. How can I get androidlcl svn instead of getting lazarus svn?


felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #47 on: December 19, 2011, 07:28:09 pm »
I have tested the last release, here is the adb logcat output.

release? What do you mean? Which revision are you using exactly?

Quote
P.S. How can I get androidlcl svn instead of getting lazarus svn?

They are the same thing. Note that you need to update the entire Lazarus tree, because the example changes sometimes too, not only the lcl.

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #48 on: December 19, 2011, 08:57:04 pm »

I mean revision(feel a little bit sleepy)  %) here is the revision info.

Path: lazarus
URL: http://svn.freepascal.org/svn/lazarus/trunk
Repository Root: http://svn.freepascal.org/svn/lazarus
Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f
Revision: 34286
Node Kind: directory
Schedule: normal
Last Changed Author: mattias
Last Changed Rev: 34286
Last Changed Date: 2011-12-19 19:15:44 +0200 (Mon, 19 Dec 2011)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #49 on: December 19, 2011, 09:16:11 pm »
Could you add -dVerboseCDWinAPI to the package LCL and rebuild it and show what the log shows then? Strange, in my Wildfire and in the emulator I don't get this error.

herux

  • Full Member
  • ***
  • Posts: 102
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #50 on: December 20, 2011, 04:15:51 am »
hello felipe,
I've just update lazarus from svn. but I still get the same error as yesterday week. I got the following error logs, can you tell me what cause this to happen?

Code: [Select]
12-20 10:00:31.609: I/ActivityManager(164): Start proc com.pascal.lcltest for activity com.pascal.lcltest/.LCLActivity: pid=5272 uid=10074 gids={}
12-20 10:00:31.619: I/AndroidRuntime(5264): NOTE: attach of thread 'Binder Thread #3' failed
12-20 10:00:31.739: I/lclapp(5272): Trying to load liblclapp.so
12-20 10:00:32.149: I/ggheart(623): onStop
12-20 10:00:32.149: I/lclapp(5272): JNI_OnLoad called
12-20 10:00:32.149: I/lclapp(5272): Reading our Activity Class
12-20 10:00:32.149: I/lclapp(5272): JNI_OnLoad finished
12-20 10:00:32.159: I/ApplicationPackageManager(5272): cscCountry is not German : XSE
12-20 10:00:32.179: I/lclapp(5272): LCLOnCreate called by LCLActivity.onCreate
12-20 10:00:32.179: I/lclapp(5272): [FORMS.PP] ExceptionOccurred
12-20 10:00:32.179: I/lclapp(5272):   Sender=ERangeError
12-20 10:00:32.179: I/lclapp(5272):   Exception=Range check error
12-20 10:00:32.179: I/lclapp(5272):   Stack trace:
12-20 10:00:32.179: I/lclapp(5272):   $810E4F0C
12-20 10:00:32.179: I/lclapp(5272): TApplication.HandleException Range check error
12-20 10:00:32.179: I/lclapp(5272):   Stack trace:
12-20 10:00:32.179: I/lclapp(5272):   $810E4F0C
12-20 10:00:32.239: I/ActivityManager(164): Process com.pascal.lcltest (pid 5272) has died.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #51 on: December 20, 2011, 04:46:23 am »
I've just update lazarus from svn. but I still get the same error as yesterday week. I got the following error logs, can you tell me what cause this to happen?

Which compiler are you using? Did you add range checking to your LCL compilation? Do you have local modifications? Try svn diff to check this.

herux

  • Full Member
  • ***
  • Posts: 102
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #52 on: December 20, 2011, 05:52:09 am »
Quote
Which compiler are you using?

Using 2.5.1 :

Free Pascal Compiler version 2.5.1 [2011/01/19] for arm
Copyright (c) 1993-2010 by Florian Klaempfl
/home/herux/Documents/fpc-2.5.1.arm-linux/lib/fpc/2.5.1/ppcrossarm

Quote
Did you add range checking to your LCL compilation?

you mean -Cr ? no

Quote
Do you have local modifications?

no. but I will see it and try again.

thanks

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #53 on: December 20, 2011, 08:22:08 am »
In this case could you add -dVerboseCDWinAPI -dVerboseCDDrawing to the package LCL and rebuild it and show what the log shows then? It looks like it crashes inside onCreate.

Which device do you use?

Could you test in the emulator?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #54 on: December 20, 2011, 10:26:31 am »
I just tested in Nexus One Android 2.2 and it works normally ... probably you guys are having a configuration problem. Maybe forgot to build the library too, built only via ant.

To help solve this puzzle I attached a snapshot of the LCL Example APK here: https://sourceforge.net/projects/p-tools/files/Android%20LCL%20Example%20Snapshot/?

It would be good to know if it works. If it doesnt then we really have a bug, maybe specific to a particular device. If it works, it is a build environment configuration issue.

herux

  • Full Member
  • ***
  • Posts: 102
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #55 on: December 20, 2011, 11:52:26 am »
I have downloaded your apk, and yes it work on my emulator android 2.2 and on my device Samsung GIO android 2.3.

I add -dVerboseCDWinAPI -dVerboseCDDrawing, like you said
and here is the error log, still the same .. happened in my emulator or device
Code: [Select]
12-20 17:37:46.939: I/lclapp(6756): Trying to load liblclapp.so
12-20 17:37:47.129: I/PowerManagerService(164): Light Animator Finished curIntValue=20
12-20 17:37:47.369: I/lclapp(6756): JNI_OnLoad called
12-20 17:37:47.369: I/lclapp(6756): Reading our Activity Class
12-20 17:37:47.369: I/lclapp(6756): JNI_OnLoad finished
12-20 17:37:47.369: I/ApplicationPackageManager(6756): cscCountry is not German : XSE
12-20 17:37:47.379: I/lclapp(6756): LCLOnCreate called by LCLActivity.onCreate
12-20 17:37:47.379: I/lclapp(6756): [FORMS.PP] ExceptionOccurred
12-20 17:37:47.379: I/lclapp(6756):   Sender=ERangeError
12-20 17:37:47.379: I/lclapp(6756):   Exception=Range check error
12-20 17:37:47.379: I/lclapp(6756):   Stack trace:
12-20 17:37:47.379: I/lclapp(6756):   $810E5340
12-20 17:37:47.379: I/lclapp(6756): TApplication.HandleException Range check error
12-20 17:37:47.379: I/lclapp(6756):   Stack trace:
12-20 17:37:47.379: I/lclapp(6756):   $810E5340
12-20 17:37:47.429: I/ActivityManager(164): Process com.pascal.lcltest (pid 6756) has died.

I build an APK using eclipse.
Maybe you need to know, I use FreePascal 2.6 for Ubuntu 11.10 x64, but using 2.5.1 for arm. does this matter?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #56 on: December 20, 2011, 12:54:42 pm »
I build an APK using eclipse.

Don't use Eclipse, instead use the instructions here:

http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Compiling_the_example_LCL_Android_Application

Follow all steps.

Quote
Maybe you need to know, I use FreePascal 2.6 for Ubuntu 11.10 x64, but using 2.5.1 for arm. does this matter?

No, multiple compilers can live together if they target different architectures.

herux

  • Full Member
  • ***
  • Posts: 102
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #57 on: December 20, 2011, 05:37:41 pm »
I built it with ant and error still the same.


IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #58 on: December 20, 2011, 08:19:56 pm »

I compiled the app with these -dVerboseCDWinAPI -dVerboseCDDrawing parameters. An here is the output of the adb logcat output.

V/RenderScript_jni(  177): surfaceCreated
V/RenderScript_jni(  177): surfaceChanged
I/ActivityManager(   92): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.lcltest/.LCLActivity } from pid 177
I/ActivityManager(   92): Start proc com.pascal.lcltest for activity com.pascal.lcltest/.LCLActivity: pid=5453 uid=10072 gids={}
I/lclapp  ( 5453): Trying to load liblclapp.so
D/dalvikvm( 5453): Trying to load lib /data/data/com.pascal.lcltest/lib/liblclapp.so 0x40513f40
I/lclapp  ( 5453): :>[WinAPI GetDC] hWnd: 0
I/lclapp  ( 5453): :>[WinAPI GetDeviceCaps] DC 446AC020
I/lclapp  ( 5453): [WinAPI SetProp win=TCDNonNativeForm str=WinControl data=44667AD0
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44667F60
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=446682C0
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44668620
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44669070
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44668990
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44669400
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44669F80
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=4466A2E0
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=4466A640
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=44668D20
I/lclapp  ( 5453): [WinAPI SetProp win=TCDWinControl str=WinControl data=446697B0
I/lclapp  ( 5453): :>[WinAPI GetDC] hWnd: 4462E8A0
I/lclapp  ( 5453): :<[WinAPI GetDC] Result: 446AC020
I/lclapp  ( 5453): [TCDWidgetSet.CreateFontIndirectEx]  LongFontName: default
I/lclapp  ( 5453): :>[TCDWidgetSet.SelectObject] DC=446AC020 GDIObj=44644F60
I/lclapp  ( 5453): :<[TCDWidgetSet.SelectObject] Result=0 ObjectType=
I/lclapp  ( 5453): [TCDWidgetSet.SetTextColor]  DC: 446AC020 Color: 80000012
I/lclapp  ( 5453): [TCDWSCustomCheckBox.GetPreferredSize] Width=21 Height=15
I/lclapp  ( 5453): :>[WinAPI GetDC] hWnd: 446449A0
I/lclapp  ( 5453): :<[WinAPI GetDC] Result: 446AC020
I/lclapp  ( 5453): :>[TCDWidgetSet.SelectObject] DC=446AC020 GDIObj=44644F60
I/lclapp  ( 5453): :<[TCDWidgetSet.SelectObject] Result=0 ObjectType=
I/lclapp  ( 5453): [FORMS.PP] ExceptionOccurred
I/lclapp  ( 5453):   Sender=EIntOverflow
I/lclapp  ( 5453):   Exception=Arithmetic overflow
I/lclapp  ( 5453):   Stack trace:
I/lclapp  ( 5453):   $8096DE44
I/lclapp  ( 5453): TApplication.HandleException Arithmetic overflow
I/lclapp  ( 5453):   Stack trace:
I/lclapp  ( 5453):   $8096DE44
Press Cancel to kill the program. lpCaption=app_process uType=17 lpText=Arithmetic overflow.
I/lclapp  ( 5453): Trace:> [WinAPI DeleteObject] GDIObject: 44644F60
I/lclapp  ( 5453): Trace:< [WinAPI DeleteObject] Result=True ObjectType=Font
I/ActivityManager(   92): Process com.pascal.lcltest (pid 5453) has died.
W/WindowManager(   92): Rebuild removed 5 windows but added 4
W/InputManagerService(   92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4062e808

Here are some additional info:
Path: lazarus
URL: http://svn.freepascal.org/svn/lazarus/trunk
Repository Root: http://svn.freepascal.org/svn/lazarus
Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f
Revision: 34328
Node Kind: directory
Schedule: normal
Last Changed Author: juha
Last Changed Rev: 34328
Last Changed Date: 2011-12-20 19:45:13 +0200 (Tue, 20 Dec 2011)
--------------------------------------------------------------------------------------------------
Path: fpc2.5.1
URL: http://svn.freepascal.org/svn/fpc/trunk
Repository Root: http://svn.freepascal.org/svn/fpc
Repository UUID: 3ad0048d-3df7-0310-abae-a5850022a9f2
Revision: 16790
Node Kind: directory
Schedule: normal
Last Changed Author: jonas
Last Changed Rev: 16786
Last Changed Date: 2011-01-19 16:50:17 +0200 (Wed, 19 Jan 2011)
--------------------------------------------------------------------------------------------------
Android Version
2.3.6
--------------------------------------------------------------------------------------------------
NDK-R7 / Android-14


felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #59 on: December 20, 2011, 10:33:10 pm »
For both of you:

Try to get the address of the place where the exception happens. I Google a bit and it seams that this should do it:

[felipe@localhost android]$ ~/Programas/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-addr2line -f -e libs/armeabi/liblclapp.so 8096DE44

But in my tests it didn't work. Probably our addresses are different, no idea.

You need to rebuild the project with debug info, I'll add a debug build mode in svn.

To herux:

You didn't rebuild the shared object in Lazarus, or didn't do it correctly or it failed to write the .so file or something like that. It is impossible that you will rebuild the LCL with -dVerboseCDWinAPI and it won't show debug info because it uses WinAPIs in the library initialization.

To IndianaJones:

Does my APK work in your device?
« Last Edit: December 20, 2011, 10:59:44 pm by felipemdc »

 

TinyPortal © 2005-2018