Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
how to android https request with jHttpClient without lazarus
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 05:15:06 pm]
What was your first compu...
by
BodgerBen
[
Today
at 05:09:39 pm]
solution for installing F...
by
Cascade
[
Today
at 04:16:40 pm]
Locate current record aft...
by
1HuntnMan
[
Today
at 03:52:59 pm]
StrToDateTime problems
by
cdbc
[
Today
at 03:10:28 pm]
Drag and Drop Files; onDr...
by
Hansaplast
[
Today
at 02:40:25 pm]
How to set the Excel cell...
by
wp
[
Today
at 02:10:13 pm]
RPNCalc in Lazarus
by
Thaddy
[
Today
at 01:31:40 pm]
set zero values not to b...
by
Thaddy
[
Today
at 01:18:38 pm]
How to forward a Class in...
by
zamtmn
[
Today
at 01:12:55 pm]
Fantasy Worldbuilder; Pro...
by
Dzandaa
[
Today
at 12:39:06 pm]
[SOLVED] Transparent back...
by
wp
[
Today
at 11:19:10 am]
Why does FPC behave this ...
by
Thaddy
[
Today
at 10:39:31 am]
Parametrized Access SQL Q...
by
Zvoni
[
Today
at 09:45:53 am]
BS PanelTrans - transform...
by
Xenno
[
Today
at 05:54:55 am]
PngDrop: Reduce the size ...
by
ALLIGATOR
[
Today
at 04:05:04 am]
RTTIPropertyGrid expand
by
jamie
[
Today
at 03:17:43 am]
Sum GNU Anti Reversi 8x8 ...
by
Boleeman
[
Today
at 12:42:53 am]
Picture Process with BGRA...
by
circular
[January 12, 2026, 08:05:53 pm]
[SOLVED] Average color
by
LeP
[January 12, 2026, 06:51:24 pm]
HELP Why the WriteRowHeig...
by
wp
[January 12, 2026, 06:22:24 pm]
building a Calculator usi...
by
Dzandaa
[January 12, 2026, 03:51:20 pm]
How can Lazarus implement...
by
Tommi
[January 12, 2026, 03:46:47 pm]
how to relay a button cli...
by
srvaldez
[January 12, 2026, 01:15:46 pm]
what was your first pasca...
by
BSaidus
[January 12, 2026, 01:01:32 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: how to android https request with jHttpClient without lazarus (Read 615 times)
Key-Real
Sr. Member
Posts: 395
how to android https request with jHttpClient without lazarus
«
on:
May 29, 2025, 04:08:45 pm »
Hi,
i wanna:
jHttpClient.Get(...)
without using lazarus, using android_native_app_glue.
how to setup jHttpClient?
Logged
Demo Scene
,
FlyTracker
,
FPC for PlayStation 1
,
my Repos
Key-Real
Sr. Member
Posts: 395
Re: how to android https request with jHttpClient without lazarus
«
Reply #1 on:
May 29, 2025, 04:32:37 pm »
to clarify:
Code: Pascal
[Select]
[+]
[-]
var
jHttpClient1
:
jHttpClient
;
App
:
jApp
;
env
:
PJNIEnv
;
vm
:
jni
.
PJavaVM
;
activityObj
:
pointer
;
res
:
jint
;
begin
vm
:
=
Tandroid_app
(
theapp
^
)
.
activity
^
.
vm
;
activityObj
:
=
Tandroid_app
(
theapp
^
)
.
activity
^
.
clazz
;
res
:
=
vm
^^
.
AttachCurrentThread
(
vm
,
@
env
,
nil
)
;
if
res <>
0
then
logv
(
'Failed to attach thread to JVM'
)
else
logv
(
'Attached to JVM, env ready'
)
;
if
env
=
nil
then
logv
(
'env is NIL!'
)
;
if
activityObj
=
nil
then
logv
(
'activityObj is NIL!'
)
;
App
:
=
jApp
.
Create
(
nil
)
;
logv
(
'jApp.Create success'
)
;
App
.
Init
(
And_jni
.
PJNIEnv
(
env
)
,
activityObj
,
activityObj
,
nil
,
nil
)
;
<
----
IT CRASH HERE !!!
logv
(
'jApp.Init success'
)
;
jHttpClient1
:
=
jHttpClient
.
Create
(
app
)
;
logv
(
'jHttpClient.Create success'
)
;
jHttpClient1
.
Init
;
logv
(
'jHttpClient.Init success'
)
;
ss
:
=
jHttpClient1
.
Get
(
'https://world.openfoodfacts.net/api/v2/product/4029764001807'
)
;
logv
(
'fetched'
)
;
logv
(
pchar
(
ss
)
)
;
Logged
Demo Scene
,
FlyTracker
,
FPC for PlayStation 1
,
my Repos
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
how to android https request with jHttpClient without lazarus
TinyPortal
© 2005-2018