mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 08:17:54 +01:00
lcl android example: Moves downloading the HTML page to the second form
git-svn-id: trunk@37617 -
This commit is contained in:
parent
b00191ac66
commit
e4785e16cb
@ -35,7 +35,7 @@
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<Libraries Value="/home/felipe/Programas/android-ndk-r5/platforms/android-8/arch-arm/usr/lib/;/home/felipe/Programas/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/lib/gcc/arm-eabi/4.4.0/"/>
|
||||
<Libraries Value="/home/felipe/Programas/android-ndk-r5/platforms/android-8/arch-arm/usr/lib;/home/felipe/Programas/android-ndk-r5/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/lib/gcc/arm-eabi/4.4.0"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
@ -59,6 +59,7 @@
|
||||
<CustomOptions Value="-dANDROID -Xd -CpARMV6"/>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
<LCLWidgetType Value="customdrawn"/>
|
||||
</CompilerOptions>
|
||||
</Item2>
|
||||
<Item3 Name="Windows-Release">
|
||||
@ -72,7 +73,7 @@
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<Libraries Value="C:/Programas/android-ndk-r7b/platforms/android-8/arch-arm/usr/lib"/>
|
||||
<Libraries Value="C:/Programas/android-ndk-r7b/platforms/android-8/arch-arm/usr/lib/"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
@ -99,6 +100,7 @@
|
||||
<CustomOptions Value="-dANDROID -Xd -CpARMV6"/>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
<LCLWidgetType Value="customdrawn"/>
|
||||
</CompilerOptions>
|
||||
</Item3>
|
||||
</BuildModes>
|
||||
@ -139,6 +141,7 @@
|
||||
<Filename Value="secondform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form2"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="secondform"/>
|
||||
</Unit3>
|
||||
@ -178,6 +181,7 @@
|
||||
<CustomOptions Value="-dANDROID -Xd -CpARMV6"/>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
<LCLWidgetType Value="customdrawn"/>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
|
||||
@ -43,9 +43,9 @@ object Form1: TForm1
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 72
|
||||
Height = 21
|
||||
Height = 17
|
||||
Top = 40
|
||||
Width = 94
|
||||
Width = 71
|
||||
Caption = 'CheckBox1'
|
||||
TabOrder = 3
|
||||
end
|
||||
@ -69,9 +69,9 @@ object Form1: TForm1
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 24
|
||||
Height = 18
|
||||
Height = 14
|
||||
Top = 226
|
||||
Width = 43
|
||||
Width = 32
|
||||
Caption = 'Label1'
|
||||
Font.Color = clBlue
|
||||
ParentColor = False
|
||||
@ -92,7 +92,7 @@ object Form1: TForm1
|
||||
Top = 128
|
||||
Width = 140
|
||||
AutoSize = False
|
||||
ItemHeight = 0
|
||||
ItemHeight = 13
|
||||
Items.Strings = (
|
||||
'Item1'
|
||||
'Item2'
|
||||
|
||||
@ -168,7 +168,6 @@ end;
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
sqliteDLL : Pointer;
|
||||
lStr: string;
|
||||
begin
|
||||
(* sqliteDLL:=DlOpen('/system/lib/libsqlite.so',RTLD_LAZY);
|
||||
DebugLn(IntToHex(PtrUInt(sqliteDLL), 8));
|
||||
@ -177,7 +176,6 @@ begin
|
||||
DebugLn('Button1Click');
|
||||
ProgressBar1.Position := ProgressBar1.Position + 10;
|
||||
DebugLn('Cliboard.AsText='+ClipBoard.AsText);
|
||||
lStr := LoadHTMLPageViaJNI('http://w3mentor.com/');
|
||||
//ClipBoard.AsText:='Button1Clicked';
|
||||
// OpenDocument('/mnt/sdcard/dcim/100MEDIA/IMAG0008.jpg');
|
||||
// OpenDocument('/mnt/sdcard/emaillog.txt');
|
||||
@ -364,14 +362,14 @@ begin
|
||||
'org/apache/http/client/methods/HttpGet');
|
||||
javaClass_URI := javaEnvRef^^.FindClass(javaEnvRef,
|
||||
'java/net/URI');
|
||||
javaClass_HttpResponse := javaEnvRef^^.FindClass(javaEnvRef,
|
||||
'org/apache/http/HttpResponse');
|
||||
javaClass_HttpEntity := javaEnvRef^^.FindClass(javaEnvRef,
|
||||
'org/apache/http/HttpEntity');
|
||||
javaClass_InputStreamReader := javaEnvRef^^.FindClass(javaEnvRef,
|
||||
'java/io/InputStreamReader');
|
||||
javaClass_BufferedReader := javaEnvRef^^.FindClass(javaEnvRef,
|
||||
'java/io/BufferedReader');
|
||||
javaClass_HttpResponse := javaEnvRef^^.FindClass(
|
||||
javaEnvRef, 'org/apache/http/HttpResponse');
|
||||
javaClass_HttpEntity := javaEnvRef^^.FindClass(
|
||||
javaEnvRef, 'org/apache/http/HttpEntity');
|
||||
javaClass_InputStreamReader := javaEnvRef^^.FindClass(
|
||||
javaEnvRef, 'java/io/InputStreamReader');
|
||||
javaClass_BufferedReader := javaEnvRef^^.FindClass(
|
||||
javaEnvRef, 'java/io/BufferedReader');
|
||||
|
||||
// Now all Method IDs
|
||||
DebugLn(':LoadHTMLPageViaJNI 1');
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
object Form2: TForm2
|
||||
Left = 236
|
||||
Left = 138
|
||||
Height = 259
|
||||
Top = 137
|
||||
Top = 247
|
||||
Width = 320
|
||||
Caption = 'Form2'
|
||||
ClientHeight = 259
|
||||
ClientWidth = 320
|
||||
LCLVersion = '0.9.31'
|
||||
LCLVersion = '1.1'
|
||||
object Button1: TButton
|
||||
Left = 8
|
||||
Height = 25
|
||||
@ -18,7 +18,7 @@ object Form2: TForm2
|
||||
end
|
||||
object textDest: TEdit
|
||||
Left = 8
|
||||
Height = 25
|
||||
Height = 21
|
||||
Top = 56
|
||||
Width = 80
|
||||
OnExit = textDestExit
|
||||
@ -31,7 +31,7 @@ object Form2: TForm2
|
||||
object Image1: TImage
|
||||
Left = 102
|
||||
Height = 138
|
||||
Top = 32
|
||||
Top = 64
|
||||
Width = 210
|
||||
Picture.Data = {
|
||||
07545069786D617044DA00002F2A2058504D202A2F0A73746174696320636861
|
||||
@ -1786,7 +1786,7 @@ object Form2: TForm2
|
||||
object btnStartAccel: TButton
|
||||
Left = 8
|
||||
Height = 25
|
||||
Top = 194
|
||||
Top = 216
|
||||
Width = 112
|
||||
Caption = 'Read Accel.'
|
||||
OnClick = btnStartAccelClick
|
||||
@ -1794,16 +1794,16 @@ object Form2: TForm2
|
||||
end
|
||||
object labelSensorData: TLabel
|
||||
Left = 8
|
||||
Height = 18
|
||||
Height = 14
|
||||
Top = 168
|
||||
Width = 81
|
||||
Width = 60
|
||||
Caption = 'Sensor Data'
|
||||
ParentColor = False
|
||||
end
|
||||
object btnStopAccel: TButton
|
||||
Left = 128
|
||||
Height = 25
|
||||
Top = 194
|
||||
Top = 216
|
||||
Width = 91
|
||||
Caption = 'Stop Accel.'
|
||||
OnClick = btnStopAccelClick
|
||||
@ -1812,7 +1812,7 @@ object Form2: TForm2
|
||||
object btnGetPos: TButton
|
||||
Left = 224
|
||||
Height = 25
|
||||
Top = 194
|
||||
Top = 216
|
||||
Width = 88
|
||||
Caption = 'Get Position'
|
||||
OnClick = btnGetPosClick
|
||||
@ -1820,15 +1820,15 @@ object Form2: TForm2
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 10
|
||||
Height = 18
|
||||
Height = 14
|
||||
Top = 88
|
||||
Width = 63
|
||||
Width = 50
|
||||
Caption = 'SMS Text:'
|
||||
ParentColor = False
|
||||
end
|
||||
object textBody: TEdit
|
||||
Left = 8
|
||||
Height = 25
|
||||
Height = 21
|
||||
Top = 104
|
||||
Width = 80
|
||||
TabOrder = 5
|
||||
@ -1845,10 +1845,19 @@ object Form2: TForm2
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 8
|
||||
Height = 18
|
||||
Height = 14
|
||||
Top = 32
|
||||
Width = 53
|
||||
Width = 38
|
||||
Caption = 'Number'
|
||||
ParentColor = False
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 102
|
||||
Height = 25
|
||||
Top = 32
|
||||
Width = 203
|
||||
Caption = 'Load HTML page'
|
||||
OnClick = Button2Click
|
||||
TabOrder = 7
|
||||
end
|
||||
end
|
||||
|
||||
@ -18,6 +18,7 @@ type
|
||||
btnStopAccel: TButton;
|
||||
btnGetPos: TButton;
|
||||
btnSendSMS: TButton;
|
||||
Button2: TButton;
|
||||
textDest: TEdit;
|
||||
textBody: TEdit;
|
||||
Image1: TImage;
|
||||
@ -29,6 +30,7 @@ type
|
||||
procedure btnStartAccelClick(Sender: TObject);
|
||||
procedure btnStopAccelClick(Sender: TObject);
|
||||
procedure btnGetPosClick(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure textDestExit(Sender: TObject);
|
||||
procedure textDestKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure textDestKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
@ -48,7 +50,7 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
uses TypInfo;
|
||||
uses TypInfo, mainform;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
@ -88,6 +90,13 @@ begin
|
||||
PositionInfo.OnPositionRetrieved := @HandlePositionRetrieved;
|
||||
end;
|
||||
|
||||
procedure TForm2.Button2Click(Sender: TObject);
|
||||
var
|
||||
lStr: string;
|
||||
begin
|
||||
lStr := Form1.LoadHTMLPageViaJNI('http://magnifier.sourceforge.net/');
|
||||
end;
|
||||
|
||||
procedure TForm2.textDestExit(Sender: TObject);
|
||||
begin
|
||||
DebugLn('[Edit1Exit]');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user