How to display barcode contents with jGridview? lazarus / 43-Android ---------------------------------------------------------------------- Jonvy · 2023-03-24 04:02 Hello all, I want to make an android app to display barcode contents,get the same result as I did in PC(See attachments PC_1.png,PC_2.png,PC_3.png). First line will display position in barcode, 2nd line display barcode content in that positon. It's no problem to do so in PC program.With different length of barcode can be shown dynamic. For android app, I plan to use JGridview, but I don't know how to adjust each cell's width. Such as my attachment,after position 10, it will display as 1 and 0,become 2 lines. Also JGridview has no position bar to move to see more content, difficult to see more contents. Can any one help me how to do this? Maybe jGridview isn't the suitable component? Is there any other component can do this? Best regards, Jonvy ---------------------------------------------------------------------- jmpessoa · 2023-03-25 19:12 Hi, Jovy! What about "jTableLayout"  component.... ??  demo:   "AppTableLayoutDemo1" ---------------------------------------------------------------------- Jonvy · 2023-03-27 14:50 Hi,jmpessoa For jTableLayout, the result is same, can not get scroll. So I want to use jHorizontalScrollView and JGridview together. I did a test for following code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {hint: Pascal files location: ...\AppLAMWProject1\jni }unit unit1; {$mode delphi} interface uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes, SysUtils, AndroidWidget, Laz_And_Controls, gridview;  type   { TAndroidModule1 }   TAndroidModule1 = class(jForm)    Button1: jButton;    HorizontalScrollView1: jHorizontalScrollView;    procedure AndroidModule1Create(Sender: TObject);    procedure AndroidModule1Destroy(Sender: TObject);    procedure Button1Click(Sender: TObject);  private    GridViewBarcode: array[1..100] of jGridView;   public    {public declarations}  end; var  AndroidModule1: TAndroidModule1;  i,iLen:integer;implementation  {$R *.lfm}   { TAndroidModule1 } procedure TAndroidModule1.Button1Click(Sender: TObject);begin end; procedure TAndroidModule1.AndroidModule1Create(Sender: TObject);begin   iLen:=52; //example, 52 chars for testing only   GridViewBarcode[1].Create(HorizontalScrollView1);  GridViewBarcode[1].Visible:=true;  GridViewBarcode[1].ColCount:=1;  GridViewBarcode[1].RowCount:=2;  GridViewBarcode[1].Cells[0,0]:='1';  GridViewBarcode[1].Cells[0,1]:='S1';  GridViewBarcode[1].PosRelativeToParent:=[rpLeft,rpCenterVertical];  GridViewBarcode[1].LayoutParamWidth:=lp96px;  for i:=2 to iLen do       begin         GridViewBarcode[i].Create(HorizontalScrollView1);       GridViewBarcode[i].Visible:=true;         GridViewBarcode[i].ColCount:=1;         GridViewBarcode[i].RowCount:=2;         GridViewBarcode[i].Cells[0,0]:=IntToStr(i);         GridViewBarcode[i].Cells[0,1]:='S'+IntToStr(i);         GridViewBarcode[i].Anchor:=GridViewBarcode[i-1];         GridViewBarcode[i].PosRelativeToAnchor:=[raToRightOf];         GridViewBarcode[i].LayoutParamWidth:=lp96px;         end;  end; procedure TAndroidModule1.AndroidModule1Destroy(Sender: TObject);begin  for i:=1 to iLen do           GridViewBarcode[i].Destroy; end; end. But when I run the code, app will flash, then closed. Is something wrong with my code? ---------------------------------------------------------------------- jmpessoa · 2023-03-27 20:43 Hi, Jonvy! Put here some *.txt data (one bar code by line)  exemple... I will try help you..... ---------------------------------------------------------------------- Jonvy · 2023-03-29 02:12 Ok, I attach some txt here. Each file means one barcode,barcode length is different, pls check it. Jonvy ---------------------------------------------------------------------- jmpessoa · 2023-03-29 19:03 QuoteEach file means one barcode,barcode length is different.... what do you want to reach?    can you draw some draft (paint) ? ---------------------------------------------------------------------- Jonvy · 2023-03-30 08:09 I want to get the same result as I did in PC desktop.See attatchment. Scan different barcode, the Gridview can show each digit of the character in barcode and tell the position. Also I can scroll the Gridview horiontally as the mobile screen can not fill all data. ---------------------------------------------------------------------- Jonvy · 2023-05-11 01:36 Hi all, Since I'm new for Android programming, I get the wrong idea at beginning for thinking about jGridview. I can't sovle this problem with LAMW, so I learned some time for make android app in Android Studio with Java, learned Java language and Android concept. Finally I sovled this problem in Android Studio with Java(See attachment gif photo),use recyclerView. Now I back to this forum, I still don't know how to do with LAMW,if anyone can tell me, it would be better. If I have time, I can also think it myself. Thanks! Jonvy ---------------------------------------------------------------------- Mongkey · 2023-05-11 05:00 Actually you could do it in an easy way, may be you can try create panel as parent and label or text view as child, read your code, let see if it got 14ean system, just do: Panel.create(self); Panel.name:= 'testing'; For i :=0 to 13 do begin //-- create textview/label ('testing'); //--layouting child //--put numbering //--put barcode value by number end;