How to check Internet Connection in Android App | 2024

Поделиться
HTML-код
  • Опубликовано: 14 ноя 2024

Комментарии • 8

  • @alinaqvi2947
    @alinaqvi2947 3 года назад +2

    Awesome tutorial but i have one question.
    I want to check the internet connection again and again during user use to app.
    And if user turn off connection show error message to turn on connection

    • @andreibichir2510
      @andreibichir2510 2 года назад

      I know it's late, but maybe it still helps you or someone else.
      For this you would need to register a Broadcast Receiver (for it to work over the whole app I suggest to initialize it in the Application class). As it is a lot to explain for a yt comment, here is a link:
      ruclips.net/video/11Oe40o8RJo/видео.html&ab_channel=CodinginFlow
      Good luck!

    • @tibrec8
      @tibrec8 2 года назад

      u should extend live data ....read about live data & internet connectivity

  • @janielee9185
    @janielee9185 2 года назад

    I have a landline phone I only want to use wifi internet on here. Can you please help me?

  • @ansserab2074
    @ansserab2074 Год назад +1

    this is a bad method and not working properly , there are some cases where users are connected to a network, but the network may not have access to the internet. for example : user enabled mobile data, but he or she has is no data balance. the device is on a roaming network, and data roaming has been disabled. some wifi networks ask for sign-in information. In this case, users cannot access the internet until the credentials are provided. so, we should check if the network has access to the internet ....

  • @MaxS-v7x
    @MaxS-v7x 6 месяцев назад

    deprecated already.

  • @Daaaaaaavid
    @Daaaaaaavid 2 года назад +3

    This is a deprecated approach.