Recent

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

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #60 on: December 24, 2011, 03:26:30 pm »

Hi Felipe,
I have tested with the revision 34384 and it works normal now except with a simple deficients.
Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #61 on: December 24, 2011, 07:26:27 pm »
I have tested with the revision 34384 and it works normal now except with a simple deficients.

Yes, I see that the text drawing buffer bitmap is a little bit too small in the X axis. But it uses the size send by the Android Text API... looks like it lies. Good to know that everywhere it seams to get the same factor of wrongness. I think I'll just add a +5 pixels factor in the width or something like that.

About TCDEdit there is still some stuff to be fixed, although I already fixed 1 bug these last days.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #62 on: December 25, 2011, 12:03:00 pm »
Hello, Could you retest and send a new screenshot? I added a factor (I think 3 pixels for DPI 125), and made it adjust to the font size, so the factor will be slightly larger in your device I think.

I also found and fixed another TCDEdit bug, but there are still some issues. But it is surely improving.

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #63 on: December 25, 2011, 02:33:57 pm »

Tested with the 34403, looks cool.  :D
P.S. Keyboard doesnt work in the Edit field again.

wcleyton

  • Jr. Member
  • **
  • Posts: 80
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #64 on: January 20, 2012, 01:31:11 pm »
Hi,

 I'm trying to compile the example. When I install the emulator, the following error appears:

Code: [Select]
D/AndroidRuntime(  300): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime(  300): CheckJNI is ON
D/AndroidRuntime(  300): --- registering native functions ---
D/dalvikvm(  255): GC_EXPLICIT freed 81 objects / 4496 bytes in 133ms
D/PackageParser(   59): Scanning package: /data/app/vmdl62149.tmp
D/PackageManager(   59): Scanning package com.pascal.lcltest
I/PackageManager(   59): /data/app/com.pascal.lcltest-1.apk changed; unpacking
D/PackageManager(   59): Caching shared lib lib/armeabi/liblclapp.so
D/installd(   35): DexInv: --- BEGIN '/data/app/com.pascal.lcltest-1.apk' ---
D/dalvikvm(  307): DexOpt: load 68ms, verify 75ms, opt 4ms
D/installd(   35): DexInv: --- END '/data/app/com.pascal.lcltest-1.apk' (success
) ---
D/PackageManager(   59):   Activities: com.pascal.lcltest.LCLActivity
I/ActivityManager(   59): Force stopping package com.pascal.lcltest uid=10036
I/installd(   35): move /data/dalvik-cache/data@app@com.pascal.lcltest-1.apk@cla
sses.dex -> /data/dalvik-cache/data@app@com.pascal.lcltest-1.apk@classes.dex
D/PackageManager(   59): New package installed in /data/app/com.pascal.lcltest-1
.apk
D/dalvikvm(   59): GC_EXPLICIT freed 7186 objects / 432496 bytes in 210ms
D/AndroidRuntime(  300): Shutting down VM
D/jdwp    (  300): adbd disconnected
I/dalvikvm(  300): JNI: AttachCurrentThread (from ???.???)
I/AndroidRuntime(  300): NOTE: attach of thread 'Binder Thread #3' failed
W/RecognitionManagerService(   59): no available voice recognition services foun
d
D/dalvikvm(  274): GC_EXPLICIT freed 752 objects / 54528 bytes in 147ms
D/dalvikvm(  255): GC_EXPLICIT freed 88 objects / 8104 bytes in 201ms
I/ActivityManager(   59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.lcltes
t/.LCLActivity }
I/ActivityManager(   59): Start proc com.pascal.lcltest for activity com.pascal.
lcltest/.LCLActivity: pid=311 uid=10036 gids={}
I/lclapp  (  311): Trying to load liblclapp.so
D/dalvikvm(  311): Trying to load lib /data/data/com.pascal.lcltest/lib/liblclap
p.so 0x44ede248
I/dalvikvm(  311): Unable to dlopen(/data/data/com.pascal.lcltest/lib/liblclapp.
so): Cannot load library: link_image[1995]: failed to link liblclapp.so
I/dalvikvm(  311):
E/lclapp  (  311): WARNING: Could not load liblclapp.so
W/System.err(  311): java.lang.UnsatisfiedLinkError: Library lclapp not found
W/System.err(  311):    at java.lang.Runtime.loadLibrary(Runtime.java:461)
W/System.err(  311):    at java.lang.System.loadLibrary(System.java:557)
W/System.err(  311):    at com.pascal.lcltest.LCLActivity.<clinit>(LCLActivity.j
ava:594)
W/System.err(  311):    at java.lang.Class.newInstanceImpl(Native Method)
W/System.err(  311):    at java.lang.Class.newInstance(Class.java:1429)
W/System.err(  311):    at android.app.Instrumentation.newActivity(Instrumentati
on.java:1021)
W/System.err(  311):    at android.app.ActivityThread.performLaunchActivity(Acti
vityThread.java:2577)
W/System.err(  311):    at android.app.ActivityThread.handleLaunchActivity(Activ
ityThread.java:2679)
W/System.err(  311):    at android.app.ActivityThread.access$2300(ActivityThread
.java:125)
W/System.err(  311):    at android.app.ActivityThread$H.handleMessage(ActivityTh
read.java:2033)
W/System.err(  311):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  311):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  311):    at android.app.ActivityThread.main(ActivityThread.java:4
627)
W/System.err(  311):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  311):    at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err(  311):    at com.android.internal.os.ZygoteInit$MethodAndArgsCalle
r.run(ZygoteInit.java:868)
W/System.err(  311):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.ja
va:626)
W/System.err(  311):    at dalvik.system.NativeStart.main(Native Method)
W/dalvikvm(  311): No implementation found for native Lcom/pascal/lcltest/LCLAct
ivity;.LCLOnCreate (Lcom/pascal/lcltest/LCLActivity;)I
D/AndroidRuntime(  311): Shutting down VM
W/dalvikvm(  311): threadid=1: thread exiting with uncaught exception (group=0x4
001d800)
E/AndroidRuntime(  311): FATAL EXCEPTION: main
E/AndroidRuntime(  311): java.lang.UnsatisfiedLinkError: LCLOnCreate
E/AndroidRuntime(  311):        at com.pascal.lcltest.LCLActivity.LCLOnCreate(Na
tive Method)
E/AndroidRuntime(  311):        at com.pascal.lcltest.LCLActivity.onCreate(LCLAc
tivity.java:203)
E/AndroidRuntime(  311):        at android.app.Instrumentation.callActivityOnCre
ate(Instrumentation.java:1047)
E/AndroidRuntime(  311):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2627)
E/AndroidRuntime(  311):        at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2679)
E/AndroidRuntime(  311):        at android.app.ActivityThread.access$2300(Activi
tyThread.java:125)
E/AndroidRuntime(  311):        at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:2033)
E/AndroidRuntime(  311):        at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime(  311):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  311):        at android.app.ActivityThread.main(ActivityThrea
d.java:4627)
E/AndroidRuntime(  311):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(  311):        at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime(  311):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  311):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:626)
E/AndroidRuntime(  311):        at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager(   59):   Force finishing activity com.pascal.lcltest/.LCLActi
vity
W/ActivityManager(   59): Activity pause timeout for HistoryRecord{44ff5d70 com.
pascal.lcltest/.LCLActivity}
I/Process (  311): Sending signal. PID: 311 SIG: 9
I/ActivityManager(   59): Process com.pascal.lcltest (pid 311) has died.
W/InputManagerService(   59): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy@45063ab0
W/ActivityManager(   59): Activity destroy timeout for HistoryRecord{44ff5d70 co
m.pascal.lcltest/.LCLActivity}
D/SntpClient(   59): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
D/SntpClient(   59): request time failed: java.net.SocketException: Address fami
ly not supported by protocol

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #65 on: January 20, 2012, 02:07:04 pm »
Please start a new thread about this, this one is getting messy. Repeat your previous post and also describe step-by-step what you are doing to build the project and how you configured your build environment.

woma1

  • Newbie
  • Posts: 3
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #66 on: January 22, 2012, 02:04:08 pm »
Hi.

I have several questions:

1. Is it possible to build in Lazarus under Windows apps for Android? On the "http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android" Although it is described, but the documentation is quite incomplete.

2. If the point 1, the answer is Yes, then if someone could create a complete and detailed documentation?

3. Whether and how can I customize other controls Lazarus for use in applications for Android. I mean mainly the control of access to data. Maybe someone in this issue will create a detailed documentation?

The text translated by Google!

DUDUS

BlueIcaro

  • Hero Member
  • *****
  • Posts: 792
    • Blog personal
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #67 on: January 22, 2012, 03:28:51 pm »
Hi.

I have several questions:

1. Is it possible to build in Lazarus under Windows apps for Android? On the "http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android" Although it is described, but the documentation is quite incomplete.
(...)
DUDUS

I think, for the moment, the best solution is download the virtual machine that builded Felipe. It's a virtual machine of a lunux distro, with every thing you need to start.

I downloaded it and works fine in windows.

In this issue you have all information: http://www.lazarus.freepascal.org/index.php/topic,15616.0.html
/BlueIcaro
« Last Edit: January 22, 2012, 03:30:57 pm by BlueIcaro »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #68 on: January 22, 2012, 03:55:15 pm »
1. Is it possible to build in Lazarus under Windows apps for Android?

Yes.

Quote
2. If the point 1, the answer is Yes, then if someone could create a complete and detailed documentation?

If you have special requirements which are not fullfilled by what is already provided (like the Linux pre-compiled compiler or the Linux VM Image) then maybe you should try a bounty:

http://wiki.lazarus.freepascal.org/Bounties

Quote
3. Whether and how can I customize other controls Lazarus for use in applications for Android. I mean mainly the control of access to data. Maybe someone in this issue will create a detailed documentation?

Which controls exactly? But in general, LCL for Android is exactly identical to the LCL for any other platform. Customizations are mostly unnecessary. Data base access is documented here:

http://wiki.lazarus.freepascal.org/Databases

http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial

The Lazarus book in english also covers a lot of information about database programming in Lazarus / FPC.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #69 on: January 22, 2012, 09:19:27 pm »
Hi Felipe,

There are a plan for  TCDTreeView and TCDToolBar on "Custom Drawn",
my question is about future
requirement for porting for android.... this is True?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #70 on: January 22, 2012, 09:27:52 pm »
There are a plan for  TCDTreeView and TCDToolBar on "Custom Drawn",
my question is about future
requirement for porting for android.... this is True?

TTreeView is custom drawn by nature and descends from TCustomControl. So it does not require a TCD* control to work. TToolbar is also a descendent from TCustomControl, but I don't know if it requires a widgetset implementation or not. Maybe they even already work in Android, one needs to test. And if they don't work one needs to investigate which LCL features they require which are missing.
« Last Edit: January 22, 2012, 09:33:46 pm by felipemdc »

woma1

  • Newbie
  • Posts: 3
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #71 on: January 23, 2012, 06:37:53 pm »
Hi

I program in Delphi for many years, and are unlikely to need additional documentation. Specifically I'm interested how can I use in Android application:
TDatasource;
TDBGrid;
TSQLite3Connection;
TSQLQuery;

DUDUS

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #72 on: January 23, 2012, 07:27:10 pm »
I program in Delphi for many years, and are unlikely to need additional documentation. Specifically I'm interested how can I use in Android application:
TDatasource;
TSQLite3Connection;
TSQLQuery;

Those are non-visual controls. They will work out of the box and there is nothing specific about Android in their usage in Pascal, but there is 1 thing special about the linking: you need to get a cross-compiled sqlite library and place it in an appropriate version for the linker to find. Sqlite does not come pre-installed in Android. If you want to know how to use them then you should read the wiki database articles which I previously linked or the Lazarus book and when you have more specific questions post in the Database section of this forum.
« Last Edit: January 23, 2012, 07:29:36 pm by felipemdc »

wcleyton

  • Jr. Member
  • **
  • Posts: 80
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #73 on: January 23, 2012, 08:02:28 pm »
Hi,

 You can change the font color of the Label?

 I changed the color of the label to red. Only when running on the emulator, it was black.

 Note: I re-compiled and installed again the example in the emulator. Even added a few more buttons to make sure it was updating the compilation.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL-CustomDrawn substitutes LCL-Android
« Reply #74 on: January 23, 2012, 08:36:34 pm »
Indeed text color is missing, please open a bug report. It should be easy to add.

 

TinyPortal © 2005-2018