Lazarus

Programming => Operating Systems => Android => Topic started by: tango13 on May 11, 2021, 12:27:52 pm

Title: Filled shapes
Post by: tango13 on May 11, 2021, 12:27:52 pm
Hi everybody,

I just came across LAMW and the possibility to develop for Android with Lazarus, which is simply amazing! So first of all, allow me to send a biiiiig thank you to the developers, keep up this great work!

I just started to learn and to know the environment, so I might ask something trivial: is there a way to draw, in jdrawingview for instance, some filled shapes like rectangles, circles etc.?

Thank you very much.
Title: Re: Filled shapes
Post by: Bart on May 11, 2021, 02:05:19 pm
TShape perhaps?
You can simply drop it on afrom and set it's properties.

Bart
Title: Re: Filled shapes
Post by: jmpessoa on May 11, 2021, 04:14:45 pm

What about "Demos"?

AppDrawingViewDemo1
AppDrawingViewDemo2
AppDrawingInBitmap
AppDrawingInBitmapAndDensity
ColorPicker
AppSurfaceViewDemo1
AppGridColorPickerDemo1

I don't remember about "filled shapes" ...


Title: Re: Filled shapes
Post by: tango13 on May 12, 2021, 09:51:29 am
I'll take a look and let you know.
Thank you.
Ciao
Title: Re: Filled shapes
Post by: tango13 on May 12, 2021, 01:42:47 pm
I'm having problems compiling demos, I always get a "system unit not found" error.
Am I missing something? (obviously yes...  :) )
Thank you.
Title: Re: Filled shapes
Post by: rsu333 on May 12, 2021, 04:33:57 pm
I am  not insulting previous answers but I like to suggest use one more laz4android 2.0.0 [available in laz4apk  [previous version ],  as beginner I am doing same  to learn demos .
Title: Re: Filled shapes
Post by: jmpessoa on May 12, 2021, 05:30:05 pm

Hi. tango13!

How you get your "Lazarus for Android"? 
Title: Re: Filled shapes
Post by: tango13 on May 12, 2021, 06:48:59 pm
With LAMW Manager (on Windows 10) which, by the way, is just great!
Thank you.
Title: Re: Filled shapes
Post by: jmpessoa on May 12, 2021, 06:57:35 pm

@tango13

Can you create a new LAMW project and put the "*.lpi" file here?
Title: Re: Filled shapes
Post by: tango13 on May 13, 2021, 09:14:00 am
Thanks for your suggestion, it worked and now at least I can compile the code.
However, I still get an error while building the apk, the error is "Error: \path\to\file\Controls.java:2675: error: package R does not exist".
Can I try anything else?
Thanks a lot!
Title: Re: Filled shapes
Post by: jmpessoa on May 13, 2021, 03:37:12 pm

@Tango13

Can you do some test?

Please, change the "Controls.java" line 2675:
[LAMW folder "......\android_wizard\smartdesigner\java"]

old:
Code: Pascal  [Select][+][-]
  1.   Class<?> res = R.drawable.class;
  2.  

to

Code: Pascal  [Select][+][-]
  1.  Class<?> res = android.R.drawable.class;
  2.  
Title: Re: Filled shapes
Post by: tango13 on May 13, 2021, 07:04:22 pm
Ok, it seems that we are moving forward  :)
On the lines  Class<?> res = R.drawable.class; your suggestion made the error disappear.
However, there are more lines with the same error, lines like
Code: Pascal  [Select][+][-]
  1.  dw = drawableToBitmap (this.controls.activity.getResources().getDrawable(R.drawable.ic_launcher));
If I make the same modification I get a "cannot find symbol" error.

Oh, and I forgot to mention that I get errors also in jCommons.java, in lines like
return  R.color.accent;
The error is the same "package R does not exist".
Thank you.
Title: Re: Filled shapes
Post by: jmpessoa on May 13, 2021, 11:22:25 pm
Well, if you got error here:

Code: Pascal  [Select][+][-]
  1. dw = drawableToBitmap (this.controls.activity.getResources().getDrawable(R.drawable.ic_launcher));
  2.  

then your project is  messy!

So, please,  create a NEW project!!!!
TinyPortal © 2005-2018