Broadcasts & Broadcast Receivers - Android Basics 2023

  Рет қаралды 46,524

Philipp Lackner

Philipp Lackner

Жыл бұрын

In this video you'll learn what broadcasts are in Android and how you can receive and send them.
⭐ Learn all the professional technologies applied in the industry
⭐ 100% money back guarantee for 30 days
⭐ Become an industry-ready Android developer now:
pl-coding.com/premium-courses...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose...
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
Follow me on Instagram for insights into my live as an Android developer:
/ _philipplackner_
Subscribe to my FREE newsletter for regular Android, Kotlin & Architecture advice!
pl-coding.com/newsletter

Пікірлер: 57
@HoveredCubeOfficial
@HoveredCubeOfficial Жыл бұрын
You're videos are just so high quality that I feel like I have to pay for them! how ever I'm in a country that I can't donate you but I watch the adds till the last second! Oh and also I have a video request! PLEASE PLEASE PLEASE Make a tutorial video about how to enable V P N mode in Kotlin! there no videos explaining it and the documents are so confusing!
@HoveredCubeOfficial
@HoveredCubeOfficial Жыл бұрын
So would u consider making a short tutorial about it please?
@theg4meover988
@theg4meover988 Жыл бұрын
Awesome series ! Keep it coming please.
@mircodev
@mircodev Жыл бұрын
Thanks a lot. Nice that you also again address the more niche topics.
@bmartin7226
@bmartin7226 Жыл бұрын
Thank you for these videos, it helps a lot!
@BlackSkyCrew
@BlackSkyCrew Жыл бұрын
You're enjoy me everyday with such a qualite video lessons! Thanks bro! I'm also have Germany roots...
@jarvis2913
@jarvis2913 Жыл бұрын
Very nice series for learning basic android things.
@psytoolkit
@psytoolkit 9 ай бұрын
Thanks, your videos make my life easier and I can focus on the main aims of my apps
@thenomadicstranger2079
@thenomadicstranger2079 Жыл бұрын
I hope you cover goAsync in upcoming videos with proper examples. It would be amazing if you could cover ANR cases in background and foreground cases.
@martinseal1987
@martinseal1987 Жыл бұрын
I'm really enjoying these, they're things I know but your helping me categorise them in my mind, would you consider roughly explaining small code changes for audio users,
@alirezafaraji
@alirezafaraji Жыл бұрын
Another amazing video. thanks for all the effort
@ahmedelbehiry1638
@ahmedelbehiry1638 7 ай бұрын
thank you,its amazing explanation
@volodymyrandrushko3945
@volodymyrandrushko3945 11 ай бұрын
Man I love your channel
@francoisrochefort5759
@francoisrochefort5759 Жыл бұрын
Excellent
@gaelbams7020
@gaelbams7020 10 ай бұрын
Thanks for sharing it help a lot!
@PhilippLackner
@PhilippLackner 10 ай бұрын
Glad it was helpful!
@fiedler65
@fiedler65 10 ай бұрын
This implementation for the AirPlaneModeReceiver may be more natural and straightforward. class AirPlaneModeReceiver: BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { if (intent?.action == Intent.ACTION_AIRPLANE_MODE_CHANGED) { if (intent.hasExtra("state")) { val isTurnedOn = intent.getBooleanExtra("state", false) println("Is airplane mode enabled? ${isTurnedOn}") } else { println("No state extra found in the intent") } } } }
@mahmuduulkarimlincoln7932
@mahmuduulkarimlincoln7932 6 ай бұрын
thanks dost
@everythingjdm8057
@everythingjdm8057 4 ай бұрын
l learned everything from you
@jimmyturner5921
@jimmyturner5921 Жыл бұрын
bro, there's a topic I've struggled for a long time to implement. Please, if you would make a series on implementing a custom assistant from overriding VoiceInteractionServices. I'd SERIOUSLY much appreciate it
@fadillahazhar8791
@fadillahazhar8791 5 ай бұрын
interesting abangkuh
@Radiokot42
@Radiokot42 11 ай бұрын
Could you please suggest how an activity can communicate with a receiver? What if we want our UI or viewmodel to react to a message rather than just logging it? I couldn't manage to find a "native" solution, so ended up adding a static event subject to the receiver's companion object and subscribing my activity to it.
@bepositive3385
@bepositive3385 8 ай бұрын
hello thanks for all tutorial, but please make tutorial about implementing webrtc in android studio, hope u read this
@kacpergrabiec
@kacpergrabiec Жыл бұрын
Can you make a video about NFC tag reader?
@PaweSzymanski-gk7po
@PaweSzymanski-gk7po 6 ай бұрын
Isn't it better to register and unregister dynamic receivers in onResume and onPause? In the previous video discussing lifecycle methods, you mentioned that the onDestroy method might sometimes not be called.
@Rexuses
@Rexuses Жыл бұрын
Can broadcast receivers be used in situations such as internet disconnection? What should I use to check internet situation? Also thanks for these videos :)
@ahmadelmourabi7603
@ahmadelmourabi7603 Жыл бұрын
Thanks very interesting and useful. Is it possible register to incoming phone call and our application receive the calling number as parameter please? It will very interesting that our application receive the calling number when is ringing and find and display the client record automatically? Have nice time
@engineerOne
@engineerOne Жыл бұрын
Your content is ❤ (3😅)
@user-ny2mv7qx2p
@user-ny2mv7qx2p Жыл бұрын
Hello. Do you find copilot useful for Android development?
@kivan26
@kivan26 Жыл бұрын
What do you think about using broadcasts and broadcast receivers inside same app, compared to using singleton Rx Observable or Coroutine Flow that are used in multiple places? Apart from obviouse API differences, are there any general reasons why should we stick with broadcasts and broadcast receivers in such situation?
@PhilippLackner
@PhilippLackner Жыл бұрын
How does a broadcast compare with a flow? If you mean channels, then you lose the whole reactivity and flexibility by using a broadcast
@kivan26
@kivan26 Жыл бұрын
@@PhilippLackner Ok, I get that, but are there any reasons for using broadcasts within same app, instead of Channels, Rx Observables and so?
@ivanvega9100
@ivanvega9100 Жыл бұрын
Great video!!, just one question, if the onReceive method is from a different class, how can the ui react to that action?
@rileyfarro6801
@rileyfarro6801 Жыл бұрын
I am kinda thinking the same thing because he said in the first part that you can pause your music player app when an app received a phone call action.
@PhilippLackner
@PhilippLackner Жыл бұрын
A music player is not the UI, it's just the service that plays the music. You can pass other active classes of your app to the broadcast receiver and update them. That either works with Hilt or manually assignment
@Srinu1109
@Srinu1109 11 ай бұрын
I have doubt like how do we update the UI from the receviers. If it is possible with viewmodel i have a question passing a viewmodel instance to broadcast receiver is a good way?
@Radiokot42
@Radiokot42 11 ай бұрын
I couldn't manage to find a "native" solution, so ended up adding a static event subject to the receiver's companion object and subscribing my activity (or viewmodel) to it.
@fernandogoncalves1891
@fernandogoncalves1891 Ай бұрын
How can we use data from BroadcastReceiver in composable UI?. Thanks
@yt-1161
@yt-1161 Ай бұрын
Is there a book that you can recommend ?
@neerajverma9226
@neerajverma9226 3 ай бұрын
How to use hilt inside broadcast reciever
@lindaporsius
@lindaporsius Жыл бұрын
How do you check if an app that can receive an broadcast is open?
@abada-s
@abada-s Жыл бұрын
Why do you check if the action is a specific action ? doesn't the intent filter do the same job!
@PhilippLackner
@PhilippLackner Жыл бұрын
As long as it's only used for this one action yes
@andy_lamax
@andy_lamax Жыл бұрын
Nice content Phillip. Although I am not really sure if Broadcast receivers should be considered as an Android Basic concept
@PhilippLackner
@PhilippLackner Жыл бұрын
Why not? It's a core concept about how apps communicate with each other
@hossamqandel5303
@hossamqandel5303 Жыл бұрын
I am little confiused, I can see you used the intent action in the airPlane brodcast class, why you set this action again to the intentFilter inside the register? Also one more thing.. in your note application you made getNote() not suspended but you made getAllNotes() are suspended Why? Both of them are returning data from room Sorry for grammer mistakes
@JJHaz
@JJHaz 8 ай бұрын
to getAllNodes, you execute a task with a fewer seconds, from Room Local Database for example. Suspend fun refers to call it function into a Coroutine, for example in your viewModel, you need to call this function into viewModelScope.launch{}. Whatever getNote, can be non suspend fun, but instead of that, you shoul to be return Flow, and works same if you define that : suspend fun getNote() : NoteEntity Boths works similar, but generally Flow is expected when you call a list that have changes along the time or running of the app, reacts, to actions, it mutates. Suspend fun refers, when you create a coroutine that gives some work, and it;s no frequently to mutate. Does Work right. Suspend fun with no returns -> Procedure, fun with returns -> Works and return Type. also suspend can be used to return.
@user-mu9gz2pl2v
@user-mu9gz2pl2v 8 ай бұрын
Please make this more beginner friendly so we can understand from the scratch, Thank you for such video
@gerdsfargen6687
@gerdsfargen6687 Ай бұрын
Would you like some baby food with that?
@Op_Shisode
@Op_Shisode Ай бұрын
Yes
@danyahsan3958
@danyahsan3958 9 ай бұрын
way more complex and long
@Adam0001
@Adam0001 Жыл бұрын
I like this series ❤️ Keep great work up 🔥 Next video Content Provider 🫣
@lindaporsius
@lindaporsius Жыл бұрын
What would be a usecase?
@PhilippLackner
@PhilippLackner Жыл бұрын
Did you watch the video?😅
@sobhan4679
@sobhan4679 7 ай бұрын
Please translate persian
@FunkyEnvironment
@FunkyEnvironment Жыл бұрын
Boss form indian I need help i have App idea but not knowledge how to build can you help me how i can sell my idea to another
@Darkwolf9280
@Darkwolf9280 2 ай бұрын
Can we collaborate?
Foreground Services - Android Basics 2023
22:22
Philipp Lackner
Рет қаралды 70 М.
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 72 М.
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 23 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 99 МЛН
Intents & Intent Filters - Android Basics 2023
25:36
Philipp Lackner
Рет қаралды 64 М.
3 Clean Code Hacks I Bet You Didn't Know (Kotlin & Android)
12:30
Philipp Lackner
Рет қаралды 26 М.
receiver is missing RECEIVER EXPORTED or RECEIVER NOT EXPORTED flag for unprotected broadcasts - FIX
4:01
MobileMasters: Android & iOS Development Unleashed
Рет қаралды 1,4 М.
What is the Context? - Android Basics 2023
11:22
Philipp Lackner
Рет қаралды 51 М.
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 26 М.
WorkManager - Android Basics 2023
34:22
Philipp Lackner
Рет қаралды 51 М.
What's new in Android development tools
43:40
Android Developers
Рет қаралды 33 М.
Broadcast Receivers | Full Explanation
21:34
Mafia Codes
Рет қаралды 22 М.
Looking Into a REAL Codebase - Beyond the Basics
10:12
Tech With Tim
Рет қаралды 23 М.
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00