Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
jBroadcastReceiver
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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Resolving procedure symbo...
by
TCH
[
Today
at 03:39:19 am]
[SOLVED] How to add new ...
by
eolandro
[
Today
at 03:39:09 am]
BGRA Controls
by
lainz
[
Today
at 03:22:52 am]
color for selected cells
by
kjteng
[
Today
at 02:50:42 am]
D2Bridge Framework for La...
by
egsuh
[
Today
at 02:37:42 am]
Compile on multiple distr...
by
TRon
[
Today
at 02:05:23 am]
Select cell in listview
by
dsiders
[
Today
at 12:39:56 am]
UK's Online Safety Act
by
Joanna from IRC
[January 20, 2025, 11:48:15 pm]
Preparing FPC 3.2.4, poin...
by
Fred vS
[January 20, 2025, 11:27:29 pm]
SQL update statement and ...
by
silvercoder70
[January 20, 2025, 10:52:49 pm]
Minor Q: HowTo use 'Debug...
by
d7_2_laz
[January 20, 2025, 10:38:03 pm]
Nested declarations insid...
by
PascalDragon
[January 20, 2025, 10:33:14 pm]
GR32 GR_Bindings problem
by
PascalDragon
[January 20, 2025, 10:31:47 pm]
[Solved] A Tip for beginn...
by
silvercoder70
[January 20, 2025, 10:15:43 pm]
Unit's name collides with...
by
TCH
[January 20, 2025, 09:04:50 pm]
using TForm.OnPaint to re...
by
robert rozee
[January 20, 2025, 06:14:18 pm]
Drawing difference betwee...
by
Jonny
[January 20, 2025, 05:05:54 pm]
Random ?
by
Thaddy
[January 20, 2025, 04:43:11 pm]
Memory Safety and Object ...
by
Thaddy
[January 20, 2025, 04:19:13 pm]
Spaces are allowed here ?
by
Thaddy
[January 20, 2025, 04:06:29 pm]
Error 403 downloading wit...
by
Thaddy
[January 20, 2025, 03:09:31 pm]
API on intranet - auth im...
by
MarkMLl
[January 20, 2025, 02:17:27 pm]
Making sense of pparser, ...
by
Thaddy
[January 20, 2025, 01:09:44 pm]
مشكلة في التقارير
by
nouzi
[January 20, 2025, 12:47:27 pm]
Artificial intelligence
by
MarkMLl
[January 20, 2025, 12:31:46 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: jBroadcastReceiver (Read 3030 times)
schumi
New Member
Posts: 45
jBroadcastReceiver
«
on:
April 08, 2024, 10:37:22 pm »
Hi,
I need to replicate this java code for broadcast receiver
Code: Java
[Select]
[+]
[-]
filter
=
new
IntentFilter
(
)
;
filter.
addAction
(
ACTION_BROADCAST_RECEIVER
)
;
filter.
addCategory
(
CATEGORY_BROADCAST_RECEIVER
)
;
registerReceiver
(
receiver, filter
)
;
I try to modify jBroadcastReceiver.java but don't work (I don't know java)
Code: Java
[Select]
[+]
[-]
public
void
RegisterIntentActionFilter
(
String
_intentAction,
String
_intentCategory
)
{
//intentFilter.addDataScheme("http");
//intentFilter.addDataScheme("ftp");
//intentFilter.addAction(BluetoothDevice.ACTION_FOUND);
filter
=
new
IntentFilter
(
)
;
filter.
addAction
(
_intentAction
)
;
if
(
_intentCategory
!=
null
)
{
filter.
addCategory
(
_intentCategory
)
;
}
controls.
activity
.
registerReceiver
(
this
, filter
)
;
//Log.i("receiver","Register ....");
}
Logged
schumi
New Member
Posts: 45
Re: jBroadcastReceiver
«
Reply #1 on:
April 12, 2024, 10:15:59 am »
Hi,
I have find solutions
add to broadcastreceiver.pas
Code: Pascal
[Select]
[+]
[-]
procedure
RegisterIntentActionFilter
(
_intentActionFilter
:
string
;
_intentCategory
:
string
)
;
overload
;
add to jBroadcastReceiver.java
Code: Pascal
[Select]
[+]
[-]
private
IntentFilter filter
=
null
;
public
void RegisterIntentActionFilter
(
String
_intentAction
,
String
_intentCategory
)
{
filter = new IntentFilter(_intentAction);
filter.addCategory(_intentCategory);
controls.activity.registerReceiver(this, filter);
//Log.i("receiver","Register ....");
}
Logged
Guser979
Jr. Member
Posts: 64
Re: jBroadcastReceiver
«
Reply #2 on:
April 12, 2024, 11:25:06 am »
Congratulations. You said you don't know Java. But LAWM ends up making us know a little after so much research.
I think that despite the time we spent on this and all the work to test each change, it is worth keeping LAMW alive.
Logged
schumi
New Member
Posts: 45
Re: jBroadcastReceiver
«
Reply #3 on:
April 12, 2024, 06:42:28 pm »
thanks to copy and paste
Logged
Guser979
Jr. Member
Posts: 64
Re: jBroadcastReceiver
«
Reply #4 on:
April 12, 2024, 10:03:34 pm »
Quote from: schumi on April 12, 2024, 06:42:28 pm
thanks to copy and paste
Copying and pasting is laborious too. That's part of the job. haha ha
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
jBroadcastReceiver
TinyPortal
© 2005-2018