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
Virtual monitor on linux ...
by
MarkMLl
[
Today
at 09:53:48 am]
Guide Lines Behavior
by
n7800
[
Today
at 09:37:00 am]
FPHTTPClient and SSL not ...
by
BSaidus
[
Today
at 09:34:05 am]
Understanding Constraints
by
majolika
[
Today
at 09:18:57 am]
C-library problem with in...
by
Thaddy
[
Today
at 09:16:01 am]
Trying to save an Animate...
by
circular
[
Today
at 09:13:10 am]
Lazarus versions...
by
440bx
[
Today
at 08:41:59 am]
How to maximize window us...
by
TRon
[
Today
at 06:42:02 am]
Fpcupdeluxe
by
440bx
[
Today
at 05:52:30 am]
Source Editor - Open Sour...
by
Tony Stone
[
Today
at 05:32:21 am]
Probably more a math prob...
by
zxandris
[
Today
at 04:23:20 am]
TStringGrid draw lines in...
by
dsiders
[
Today
at 04:07:45 am]
problem with zeosdb8 and ...
by
GAN
[
Today
at 03:23:57 am]
[AI][Machine Learning] Te...
by
TRon
[
Today
at 03:18:46 am]
Lazarus Release Candidate...
by
baldzhang
[
Today
at 02:52:51 am]
Does not suggest function...
by
Martin_fr
[
Today
at 12:43:54 am]
LCL Web Native with D2Bri...
by
Soner
[
Today
at 12:36:05 am]
New to internet programmi...
by
dbannon
[January 25, 2025, 11:41:01 pm]
Copying records with dyna...
by
TRon
[January 25, 2025, 11:31:54 pm]
Resolving procedure symbo...
by
TCH
[January 25, 2025, 10:30:14 pm]
Painting on a control - 3...
by
majolika
[January 25, 2025, 07:03:54 pm]
TDBEdit uneditable
by
LemonParty
[January 25, 2025, 03:55:58 pm]
Access violation
by
smallfreak
[January 25, 2025, 03:52:19 pm]
SPARC64: compiling Lazaru...
by
Fred vS
[January 25, 2025, 02:54:09 pm]
Result not being set in c...
by
Martin_fr
[January 25, 2025, 12:44:59 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: jBroadcastReceiver (Read 3036 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