Broadcast Receiver - Part 1, An Introduction

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

ความคิดเห็น • 88

  • @noumanmayo2601
    @noumanmayo2601 8 ปีที่แล้ว +4

    its not work =/

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  8 ปีที่แล้ว +5

      +NOUMAN MAYO You are perfectly right... And actually at 4:29 a teaser text appears at the bottom of the screen and also a suggested video card appears at the same time.. I am glad that some one has highlighted this... I was wonder whether everyone lost this minute details.... To give you a head start, it is because the targetSDK is 23 and to make it work you need to have run time permissions enabled in the app... Make your target ask 22 and it will start working... Also to learn more about permissions visit my permissions video series.. best of luck

    • @harismasood9714
      @harismasood9714 7 ปีที่แล้ว

      Thanks, same issue encountered by me, but now i have solved it. thanks a lot but still I have problem how to deal with all kind of permission in android latest version like nougat or marshmallow

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      I hope this is still useful to you: th-cam.com/video/YwpYy9VcRp4/w-d-xo.html

  • @androidjava8841
    @androidjava8841 7 ปีที่แล้ว +4

    There was a time when "Slidenerd" was the best. then topped by "Prabeesh R K". Now , you have topped them all. Brilliant work Sir.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      +android java Wow!!! Didn't expect this...thanks a lot.. Keep visiting... Help spread the word about channel by sharing the videos with like minded people...

  • @ninad1902
    @ninad1902 ปีที่แล้ว

    4:24 How to send an sms if I am not using an emulator? I am using a physical device instead of an emulator for application development.

  • @juliemoore728
    @juliemoore728 7 ปีที่แล้ว

    You are amazing! Thank you for covering technical terminology and demonstrating the concepts in cool apps.

  • @salahuddinbangash5908
    @salahuddinbangash5908 8 ปีที่แล้ว +2

    I am going to watch all your videos. this one was awesome too.

  • @baaliben8267
    @baaliben8267 2 ปีที่แล้ว

    Is there any event for add/edit/delete in Contact List?

  • @ankurshinde3424
    @ankurshinde3424 5 ปีที่แล้ว

    Good video sir, Explain everything . Your tutorials are best

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  5 ปีที่แล้ว

      Hey Thanks.. Glad that you liked the videos. Feel free to explore other content on channel - visit playlist section. Hope you have subscribed.

  • @Muhammadusman-sj6yz
    @Muhammadusman-sj6yz 5 ปีที่แล้ว

    my teacher give me a task like that..when car rach upto 60km per hour speed .calls,text or emails should respond automatically with a custom text.what should i learn now first broad cast or services bcz it depends uon both topics

  • @setaremaghari6080
    @setaremaghari6080 7 ปีที่แล้ว

    your videos are one of the best ones

  • @kathiravant1668
    @kathiravant1668 3 ปีที่แล้ว

    Thank you for the explanation.Very well explained.

  • @mithuns8410
    @mithuns8410 8 ปีที่แล้ว +2

    Million thanks saved my day!!!

  • @Muhammadusman-sj6yz
    @Muhammadusman-sj6yz 5 ปีที่แล้ว

    hello code tutor which things i should learn first services or broad cast receiver

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  5 ปีที่แล้ว

      Both are equally important

    • @Muhammadusman-sj6yz
      @Muhammadusman-sj6yz 5 ปีที่แล้ว

      @@Codetutor-DemystifyCoding m not talking about important. I mean to say which should I learn first then I will learn the second.so which series of your tutorial I should start right now. Services or broadcast.

  • @HyperActive94
    @HyperActive94 4 ปีที่แล้ว

    your explanations are good sir tyvm

  • @bimalsirg
    @bimalsirg 7 ปีที่แล้ว

    hi sir, any link of your website in text form of same what you speak in this tutorial.?.. nice video

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      I don't have a website. However you can find it in my book www.wileyindia.com/composing-mobile-apps-learn-explore-apply-using-android.html If you want to buy a e-book on mobile you can download it from Amazon Kindle app.

  • @jawadahmed2520
    @jawadahmed2520 3 ปีที่แล้ว

    are we registering our listener with android operating system . since , android is the one generating these events . am i right?

  • @erickramones2167
    @erickramones2167 5 ปีที่แล้ว

    My android studio emulator is too slow. Do you do something to make yours faster?

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  5 ปีที่แล้ว

      Nothing in particular. Have a good configuration machine. That's the only solution.

    • @erickramones2167
      @erickramones2167 5 ปีที่แล้ว

      @@Codetutor-DemystifyCoding okay, thanks.

  • @ashlydhani1793
    @ashlydhani1793 6 ปีที่แล้ว

    when i send the message the toast is not appearing however im just receiving the text message itself in the phone not the app

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  6 ปีที่แล้ว

      Check Android version of the device and emulator. Is is more than Marshmallow, because you need to have Run time permissions if you want to read SMS. Go through the Permissions in Android for more understanding. th-cam.com/video/YwpYy9VcRp4/w-d-xo.html

  • @joaquinalanalvidrezsoto5054
    @joaquinalanalvidrezsoto5054 7 ปีที่แล้ว

    Excellent explanation man.

  • @YashBhoobuns
    @YashBhoobuns 8 ปีที่แล้ว +1

    Very good video , love it man

  • @mantoshkumar-rg4nu
    @mantoshkumar-rg4nu 7 ปีที่แล้ว

    Hi Anil,your explanation is awesome and what ever you are taking steps ,same steps followed by me ,but My toast is not showing any thing ,and target sdk 22 also,in this case what should i do?please help me?

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Thanks.. glad that you liked the content. Please check your code. The Github link to the source code is given below the video. Please download it and do comparison. The main reason why this doesn't work above sdk 22 is because of run time permissions that have been introduced from 23 onwards. Please visit th-cam.com/play/PLfuE3hOAeWhbnto2o_b65rN_kE96x1XWG.html for details on Run time permissions.

  • @rupeshbasude6545
    @rupeshbasude6545 6 ปีที่แล้ว

    how do I run the time and get the time in the background even app is closed?

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  6 ปีที่แล้ว

      There is no way of keeping a timer if app is not up and running. At max you can hope to run the app in background. You can use a Service for it but there is no guarantee that Android won't kill that Service. So you can use Foreground Service but once again Android doesn't recommend using it and it too can get killed by Android platform. To be clear keeping an app running forever is considered bad practice (it will drain the battery). Try to avoid it at any cost and if you have to, then be ready to pay ultimate price for it - getting your app uninstalled by consumers (Consumers don't like to run apps which drain battery and consume memory )

    • @rupeshbasude6545
      @rupeshbasude6545 6 ปีที่แล้ว

      Can we do this by using an alarm manager ? Actually I want to send the data to sqlite to server at the given time in activity.

  • @shankervennam508
    @shankervennam508 7 ปีที่แล้ว

    Plz upload the video for Services with Broadcast receiver?

  • @junigates
    @junigates 6 ปีที่แล้ว +1

    fantastic way to teach thanks a lot bro

  • @MM-qq6xp
    @MM-qq6xp 4 ปีที่แล้ว

    Great content. Just subscribed!!!

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  4 ปีที่แล้ว

      Thanks. If you like any content share it with friends and peers. It may help them too.

  • @andrechristianto7131
    @andrechristianto7131 6 ปีที่แล้ว +1

    Thx for consistent of good work sir

  • @eduardorabanal2803
    @eduardorabanal2803 5 ปีที่แล้ว

    great video as always

  • @suryajeetsingh
    @suryajeetsingh 7 ปีที่แล้ว

    brother you are good, keep doing this

  • @rikyahmad7580
    @rikyahmad7580 7 ปีที่แล้ว

    I have problem in android 6.0 or above, the broadcast not running if close the app.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Is this concerning to the code used in this demo?

    • @rikyahmad7580
      @rikyahmad7580 7 ปีที่แล้ว

      yes, i registering broadcast in manifest

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Android 6.0 is SDK version 23. This code would not work on 23 and above. Actually in the video you see a banner at
      4:29 that says this would not work on Marshmallow (6.0) and above. The reason being you need to implement the Run time permissions. You can reduce the target sdk to 22 and it will work. Or another option is implement Run time permissions in the app. To understand Runtime permissions I suggest you go through this video series: th-cam.com/play/PLfuE3hOAeWhbnto2o_b65rN_kE96x1XWG.html

    • @rikyahmad7580
      @rikyahmad7580 7 ปีที่แล้ว

      is the broadcast receiver also need permissions to run?
      do you have any source code to make clear this problems.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Broadcast Receiver doesn't need permission to run, but to listen to SMS - on which our current BR is based on - it need's permission. I suggest you have a look at complete series on Broadcast Receivers and Permissions in Android. Everything will be clear to you. Best of luck.

  • @MandeepKaur-dy9jo
    @MandeepKaur-dy9jo 7 ปีที่แล้ว +1

    This is not working on android Phone...how to use this app on phone??

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว +1

      Did you write your own code or just downloaded from Github link I had given?

    • @priyagupta6703
      @priyagupta6703 7 ปีที่แล้ว

      I have write my own code but did not getting toast also add all permission

  • @vegeto3327
    @vegeto3327 7 ปีที่แล้ว

    sir , can we use intent.getaction to trigge a broadcastreciever

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      No.. That's not how a broadcast receiver is made to get triggered. It is always through Implicit Intents and ACTION plays significant part in it and not the way you have interpreted it. I suggest you watch the complete playlist (th-cam.com/play/PLfuE3hOAeWha9AWKnQTKP3YeZWfO1yamc.html) to understand how this is done.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      If you are new to Implicit intents I suggest you have a loot at th-cam.com/play/PLfuE3hOAeWhZeu45GgdO74y0TkxKqB77d.html

  • @Akash-kq8lm
    @Akash-kq8lm 7 ปีที่แล้ว

    thank you so much..keep good work going :)

  • @ajeethkumarkandasamy5305
    @ajeethkumarkandasamy5305 7 ปีที่แล้ว

    Nice sir,Thanks.How to read the sms like otp?

  • @jamalshah8154
    @jamalshah8154 8 ปีที่แล้ว

    From where we can get the source code of these tutorials?

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  8 ปีที่แล้ว

      +Jamal Shah see the description section below the video... I have given Github link to the source code where it is appropriate

  • @muhammadadeel1107
    @muhammadadeel1107 7 ปีที่แล้ว

    This is not the case for real devices. A big percentage of mobile devices kill the app when removed from recent tasks. And puts app in stop state. Broadcast receivers are no longer able to receive any broadcasts. Until user manually launches the app from its icon. But i want to have a way. If you can help to get out of stop state if app is removed from recent tasks. Broadcast receivers dead. I dont want such behavior. Plz help me sir.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว +1

      Broadcast Receivers not getting triggered (in spite of registering them in manifest file) is new to me. One reason could be because of Run time permissions introduced from Marshmallow Onwards. If you implement run time permissions then it works. What is the targetVersion? On which device did you observe this behaviour? Have you personally seen this behavior on any specific devices? I would like to know more.

  • @ramesh09239
    @ramesh09239 7 ปีที่แล้ว

    how to unregister the broadcast receiver when app closed

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      +Ramesh kumar that's the discussion point in next video. th-cam.com/video/U6R8bwsPEbs/w-d-xo.html. You can use this in the first activity of your app to register or unregister the BR. O
      There are other variations as well to get this done. I suggest you look at Stackoverflow. It's a very common scenario.

  • @TahirKhan-vp6pz
    @TahirKhan-vp6pz 6 ปีที่แล้ว

    well explained by you , thanks ir

  • @amitray769
    @amitray769 4 ปีที่แล้ว

    Nice video sir. I didn't get the last part. what is the problem with the broadcast receiver when it reads and receive the SMS as you said?
    Why will it always get trigger?

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  4 ปีที่แล้ว

      If you have used Android phone, you might have come across pop ups where apps asks for a permissions like using camera, reading contacts. Android has this concept of permissions. I have explained permissions separately in another series - th-cam.com/video/YwpYy9VcRp4/w-d-xo.html
      Coming back to this, since in this case Broadcast Receiver is supposed to read incoming SMSes, we need to have a permission for that. That's what I am talking about there.
      As long as broadcast receiver is registered, it will get triggered. There is a way to unregister it as well. I have explained that in remaining part of the series. Please do check out the remaining videos in the series.

  • @noumanmayo2601
    @noumanmayo2601 8 ปีที่แล้ว

    check code plz

  • @vinodkamble216
    @vinodkamble216 7 ปีที่แล้ว

    great work

  • @mohamedhima96
    @mohamedhima96 7 ปีที่แล้ว +1

    Becarfull:
    Your app's target API level is 23, that is android M (6.0). In android M there are huge changes related to user-permissions. Here is nice article explaining the changes.

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Thanks for commenting. Actually at 4:29 a teaser text appears at the bottom of the screen and also a suggested video card about Android permissions appears at the same time highlighting exactly what you have commented . I have covered Android permissions in detailed manner in this video series: th-cam.com/video/YwpYy9VcRp4/w-d-xo.html

  • @rupaprajapati6129
    @rupaprajapati6129 5 ปีที่แล้ว

    My toast message is not showing

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  5 ปีที่แล้ว

      There are some issues related to Android SDK version. I have talked about them and commented about them in comment section of this and future videos of this series. Please go through the complete series.

  • @ikelloydyana4275
    @ikelloydyana4275 2 ปีที่แล้ว

    woww🥰 can you help me with my broadcastreceiver error

  • @spandanaspandu6712
    @spandanaspandu6712 6 ปีที่แล้ว

    Pls make a video on firebaseMessaging

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  6 ปีที่แล้ว

      Thanks for commenting. Right now this is not there in scheme of things I am doing. But definitely some time in future.

  • @kirk-patrickbrown866
    @kirk-patrickbrown866 7 ปีที่แล้ว

    good tutorial

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  7 ปีที่แล้ว

      Hey thanks.. Glad that you found the content useful. Please visit the playlist section of the channel to see what other content I have on channel. Hope you have subscribed.

  • @jayaseelan1968
    @jayaseelan1968 8 ปีที่แล้ว +1

    it is very very use full CodeTuter

    • @Codetutor-DemystifyCoding
      @Codetutor-DemystifyCoding  8 ปีที่แล้ว

      +Jaya Seelan glad that you found it useful... Subscribe to get notified when I public next video