No Internet Connection Dialog || Convert Website Into Android App Part 12 || Android Studio

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

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

  • @mskhan2167
    @mskhan2167 3 года назад

    Tnx Apu 🥰

  • @saurabhtulsyan4855
    @saurabhtulsyan4855 3 года назад

    Thank you so much specially for last code as no one on you tube mentioned that solution.

  • @flexybyte
    @flexybyte 4 года назад

    Thankyou for very nice and easy tutorial

  • @Zakirhossain-sk3nz
    @Zakirhossain-sk3nz 4 года назад

    Thanks a lot ..it is working

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

    Apu loading chinno ta kivabe remove korbo

  • @tanveerimtiaz4486
    @tanveerimtiaz4486 4 года назад

    you are the great... realy i like u and love u so much

  • @samtec3932
    @samtec3932 4 года назад

    I am your new subscriber. All your videos are excellent. I learn a lot by watching them. I want to ask you if you can make a video explaining how to show a video on the full screen with its respective controls in a webview and that allows you to rotate the screen. I tried to do it but when you open your tube my app stops, why do you think? .

    • @AppsGamesDev
      @AppsGamesDev  4 года назад

      Follow this video: ruclips.net/video/xyv3Nh1fQso/видео.html
      after that, you will be able to find out the App crash Reason.

  • @MilyasID
    @MilyasID 4 года назад

    Good job. But i still cant share to media social. Please make video how to enable share . Webview. Android studio. Thakns

  • @manthanpatel6220
    @manthanpatel6220 3 года назад

    Hello
    Excellent video.. Everything works well including Retry Button but problem is occurring in my app i.e. when I open a product is refresh to homepage.
    Please help

  • @letmetop7763
    @letmetop7763 4 года назад

    Valuable Code, Thank you so much!! :)

  • @Padeepz
    @Padeepz 4 года назад

    Hi I've made a webview app for my wordpress website I'm using Adsense in my website . The Problem is that the ads are showing in my webview app. Is there any Way to Stop adsense ads in my app, I Want to Continue using adsense for destop tables & mobile browers and just want to stop ads in app Alone so that i will intergate Admob to it Can you help

    • @AppsGamesDev
      @AppsGamesDev  4 года назад

      1. It depends on how your AdSense code is added to your WordPress site.If you added the code in your theme .php files, you may use the wp_is_mobile() to detect the users’ browser and decide whether to show or not show the AdSense ads.If you added the code to your sidebar as text, you may try the widget logic plugin to control whether you will show a widget depending on the true or false of a piece of PHP code.If you added the code by using 3rd party plugins, you will need to check whether these plugins have an option to control when and whether to show the code.Note that if you are using some caching plugins such as WP Super Cache, you will need to configure the plugins to cache mobile and normal views differently. For your reference, in WP super cache, it is called “Mobile device support”.2. there are some plugins you may try which will block your Adsense ads detecting user agent as webview.3. Or do manually modifying code in-app as well as website. you have to place = public static final String WEBVIEW_USER_AGENT =”webview”; in app and then write the code in your website PHP to detect the user agent. whenever user agent will be detected as webview your ads will be disabled.Thank you.

    • @Padeepz
      @Padeepz 4 года назад

      ​@@AppsGamesDev can you please make a video on it so that it will be very helpful

    • @AppsGamesDev
      @AppsGamesDev  4 года назад

      Ok, I will make a video on it. Stay tuned.

  • @cuervito692
    @cuervito692 4 года назад

    Hi friend, thanks for the tutorials, they are great.
    Ask: how can I enable just the retry button and remove the swipRefreshlayout?

    • @AppsGamesDev
      @AppsGamesDev  4 года назад +1

      Do you want to remove SwipeRefreshlayout from your App or only from the no internet connection page?

    • @cuervito692
      @cuervito692 4 года назад

      @@AppsGamesDev Hi friend, I want to remove SwipeRefreshlayout from the app and just use the RETRY button on the page without internet connection.

    • @AppsGamesDev
      @AppsGamesDev  4 года назад +1

      So, you have to first delete swipeRefresh Layout from activity_main.xml. So, the whole code will be in the activity_main.xml is:


      And also delete the code about swipeRefreshLayout from MainActivity.java.
      So, the full code of the MainActivity.java are the following:
      package com.ss.tweetpost;
      import androidx.appcompat.app.AppCompatActivity;
      import android.net.ConnectivityManager;
      import android.net.NetworkInfo;
      import android.os.Bundle;
      import android.os.Handler;
      import android.view.View;
      import android.webkit.WebResourceError;
      import android.webkit.WebResourceRequest;
      import android.webkit.WebSettings;
      import android.webkit.WebView;
      import android.webkit.WebViewClient;
      import android.widget.Button;
      import android.widget.RelativeLayout;
      import android.content.Context;
      public class MainActivity extends AppCompatActivity {
      private WebView web;
      String webUrl = "tweettools.trickssoftware.com/";
      RelativeLayout relativeLayout;
      Button NointernetBtn;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      web = (WebView) findViewById(R.id.myweb);
      web.loadUrl(webUrl);
      WebSettings mywebsettings = web.getSettings();
      mywebsettings.setJavaScriptEnabled(true);
      web.setWebViewClient(new WebViewClient(){
      @Override
      public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
      internetcheck();
      super.onReceivedError(view, request, error);
      }
      });
      //improve webview performance
      web.getSettings().setLoadsImagesAutomatically(true);
      web.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
      web.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
      web.getSettings().setAppCacheEnabled(true);
      web.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
      mywebsettings.setDomStorageEnabled(true);
      mywebsettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
      mywebsettings.setUseWideViewPort(true);
      mywebsettings.setSavePassword(true);
      mywebsettings.setSaveFormData(true);
      mywebsettings.setEnableSmoothTransition(true);
      web.loadUrl(webUrl);
      //pull to refresh
      //internet connection check
      NointernetBtn = (Button) findViewById(R.id.btnRetry);
      relativeLayout = (RelativeLayout) findViewById(R.id.nointernet);
      internetcheck();
      NointernetBtn.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
      internetcheck();
      }
      });
      }
      @Override
      public void onBackPressed() {
      if(web.canGoBack()){
      web.goBack();
      }
      else {
      super.onBackPressed();
      }
      }
      public void internetcheck(){
      ConnectivityManager connectivityManager = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
      NetworkInfo mobiledata = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
      NetworkInfo wifi = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
      if(mobiledata.isConnected()){
      web.setVisibility(View.VISIBLE);
      relativeLayout.setVisibility(View.GONE);
      web.reload();
      }
      else if(wifi.isConnected()){
      web.setVisibility(View.VISIBLE);
      relativeLayout.setVisibility(View.GONE);
      web.reload();
      }
      else{
      web.setVisibility(View.GONE);
      relativeLayout.setVisibility(View.VISIBLE);
      }
      }
      }
      Here is the full code I have given, you have to only replace the package name with your package name. Hope your problem will be solved.Thank you.

    • @cuervito692
      @cuervito692 4 года назад

      ​@@AppsGamesDev You are the best, it worked wonderfully, thanks to you I finished my first web view. keep it up brother. My respect for you

    • @AppsGamesDev
      @AppsGamesDev  4 года назад +1

      You are most welcome.

  • @tanveerimtiaz4486
    @tanveerimtiaz4486 4 года назад +1

    plz create the new video Force your users to update your app with using Firebase

  • @nahidulmollah
    @nahidulmollah 4 года назад

    আমার একটা হেল্প করতে পারবেন

  • @MousamKumarMedh
    @MousamKumarMedh 3 года назад

    For few milliseconds the site get visible

  • @birkan4955
    @birkan4955 4 года назад

    all source code one link please