Wednesday , November 22 2017
Home ­­» Android ­­» Convert any website into an Android application with Android Studio
website into Android application

Convert any website into an Android application with Android Studio

Now you can create an Android app for your website within minutes. With Android studio, you can automatically convert any web site into Android application. Just we have to follow some steps.

Every startup company, Business, Firm, and all organizations have their websites. Without website, there is no business firm or company. But maximum people are using internet on their mobile and the android is a very popular operating system now-a-days, and many people addicted to phone so everyone has android phone. Because of this reason, every startup company, Business, Firm, and all organizations are starting mobile application development.

There are varieties of mobiles with different operating system. But commonly every organization starts mobile application development with Android OS. Because which is very popular and maximum users have an Android phone.

The following steps will help you to convert any website into an Android application with Android Studio:

Step- 1: Open Android Studio :

website_to_android_app

Step- 2: Create new project :

website_to_android_app

Step- 3: Configure your new project :

website_to_android_app

Step- 4: Select the form factors your app will run on :

website_to_android_app

Step- 5: Select activity :

website_to_android_app

Step- 6:  Click on Finish :

website_to_android_app

Step- 7: Paste given code in project files :

website to android_app

See also : How to connect USB Mouse and Keyboard to android device

File : activity_main.xml

(Path: Technoscripts\app\src\main\res\layout\activity_main.xml)

 

File : strings.xml

(File Path : Technoscripts\app\src\main\res\values\strings.xml)

File : MainActivity.java

(File Path : Technoscripts\app\src\main\java\com\rahul\technoscripts\MainActivity.java)

File : AndroidManifest.xml

Video Tutorial

Note : To convert any website into an android app, we required that website responsive.

See also : Android 6.0 Marshmallow: Top features

 

Download Above Android Studio Project

About Rahul Mahadik

Rahul Mahdik is the Founder/Owner of TechnoScripts and also currently working with a leading web development company as a Software Developer. He received his Master’s degree in Computer Engineering from University of Pune. He is passionate about technical blogging, learn and explore new things and almost versatile in terms of programming across various languages & frameworks such as Java, Android, PHP, MySQL, WordPress,Bootstrap, HTML5, CSS3, Java Scripts, jQuery, Grails-Groovy and more.

Check Also

Google Opinion Rewards

Earn Money From ‘Google Opinion Rewards’ App By Answering Quick Surveys

Yes, you can Earn Google Play credit with Google Opinion Rewards App By Answering Quick …

141 comments

  1. It’s really helpful for beginners.Video tutorial helped me to visualize things exactly.Thanks..

  2. i add this link but its showing blank page?

    https://student.uog.edu.pk/Login.aspx

  3. Hello,

    Thanks for this article, is there an document like this for ios aswell? 🙂

    Best wishes

  4. My website have option to upload file as like as jpg, png, doc,pdf. but upload button do not works. how i can fix that? thanks in advance.

  5. Dear Mr. Rahul,
    Thanks for Good post.I am beginner and i can able to design sample project but i need to add menu at the top
    1. About us
    2. Feedback
    3. Share

    If possible please help me for adding Menu and also i want to remove Loader and instead of that i want to put our logo.

    Waiting for kind help

  6. Hello,

    When we update our mobile web page, application doesn’t get updated pages, how can we force application to load new pages?

    Best wishes

  7. Hello people

    I have a tel: and mailto: link on the webpage. Can you help me that the app will open the phone or the mail app when i click on the link?

  8. unfortunate has stoped. how can i solve this

    • Check if permissions are declared in AndroidManifest.xml file for INTERNET and ACCESS_NETWORK_STATE.

      Also get the stack trace of exception, so that we can help you resolve the problem.

  9. in this App One Problem If I Click On Ads In My App Like Adsense It Will Be open on new window but it opened in app.

    Plzz Tell How SOlve

    I Want Ads Open In New Window Without App. Only Site Link Open In my App Others Site Link Open With Out App .

    • You have to override method of webview

      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
      if (Uri.parse(url).getHost().equals(“www.example.com”)) {
      // This is my web site, so do not override; let my WebView load the page
      return false;
      }
      // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
      startActivity(intent);
      return true;
      }

      this may help you.

    • Sorry, its already overridden, you have to change the definition of method by the above definition.

  10. When pressing back button it closes the application, i want to get back to the last page i just visited…
    please reply with a solution thanks 🙂

    • For history of visits you have to override onKeyDown method of activity and write below code in it.

      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event)
      {
      if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) {
      myWebView.goBack();
      return true;
      }
      return super.onKeyDown(keyCode, event);
      }

      also you can try to add all visiting urls in an ArrayList and then in onKeyDown method, you can visit the last url that user visited and remove it.

    • Hi every one…

      I copied above code in my Activity.java file but i am geeting a error CAN NOT RESOLVE ERROR SYMBOL “myWebView”.

      Thanks in advance…

  11. Thank you for the article !
    It helped a lot!

  12. Hi Rahul, thanks for this very helpful article. Howerver, my site contains a lot of pdf links. Clicking any of this link does nothing. Is there a workaround for this (aside from using google docs)? I’ve read that webviews don’t display pdfs.

    • You have to override

      public boolean shouldOverrideUrlLoading(WebView view, String url) {

      This method of webview and check if url contains pdf file and write necessary code for it, such as pdf downloader code.

  13. Hello Raul as a full menu web in this great example that you published

  14. Bro I am getting a error in making android app of my site of some gradle .
    My site is – https://compressionking.blogspot.com

    My be bcoz of template so can you provide me a android responsive template or separate template for only android.

    Reply soon plz.

  15. hi all my question is how can I create a web flyout thanks

  16. Thanks bro
    you are really a good man

    — i again done it but getting 61 errors–

    details for making app

    site link :-

    http://compressionking.blogspot.com/

    package – com.gaurav.compressionking

    email id – [email protected]

    thanks do it fast i am waiting Nirranjan bro……..

  17. hello as he managed to create the side menu of the web there is an option for that thanks

  18. This brings me to this very interesting can be published in the play store thanks

  19. Olá Rahul Mahadik…Tudo blz por ai….Olha estalei na minha maquina windows 8.1 foi tudo perfeito…mas na hora que compilo pede pra mim desabilitar o VT-x da BIOS..fiz isso mais continua pedindo para desabilitar….
    fico aguardando ajuda.

  20. how to open file PDF in this application??
    i cant open file pdfd
    please help me.

    • please help me.
      in my aplication can’t open file PDF.
      HOW the sollution ?

    • Use below code after initialising WebView

      webView.setWebViewClient(new WebViewClient() {
      public boolean shouldOverrideUrlLoading (WebView view, String url) {
      if (url.endsWith(“.pdf”)) {
      startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
      // if want to download pdf manually create AsyncTask here
      // and download file
      return true;
      }
      return false;
      }
      });

      • Use below code after initialising WebView
        how to initialising ???

        please help me step by step 🙁

        • I added this code in the file what?

          AndroidManifest.xml or MainActivity.java or strings.xml or activity_main.xml or what?

          • where i can paste this code??

            webView.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading (WebView view, String url) {
            if (url.endsWith(“.pdf”)) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
            // if want to download pdf manually create AsyncTask here
            // and download file
            return true;
            }
            return false;
            }
            });

          • Your onCreate() method of MainActivity.java should look like

            @Override
            protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            webView = (WebView) findViewById(R.id.webView);
            progressBar = (ProgressBar) findViewById(R.id.progressBar);
            layoutProgress = (LinearLayout) findViewById(R.id.layoutProgress);
            webView.setVisibility(View.GONE);
            WebSettings settings = webView.getSettings();
            settings.setJavaScriptEnabled(true);
            settings.setBuiltInZoomControls(true);
            settings.setSupportZoom(true);
            settings.setDisplayZoomControls(false);
            webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (url.endsWith(“.pdf”)) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
            } else {
            view.loadUrl(url);
            }
            return true;
            }

            @Override
            public void onPageFinished(WebView view, String url) {
            webView.setVisibility(View.VISIBLE);
            layoutProgress.setVisibility(View.GONE);
            progressBar.setIndeterminate(false);
            super.onPageFinished(view, url);

            }

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
            layoutProgress.setVisibility(View.VISIBLE);
            progressBar.setIndeterminate(true);
            super.onPageStarted(view, url, favicon);
            }
            });
            if(isOnline()) {
            webView.loadUrl(“http://www.technoscripts.com/”);
            } else {
            String summary = “No Internet Connection”;
            webView.loadData(summary, “text/html”, null);
            toast(“No Internet Connection.”);
            }
            }

            and it’ll solve the problem.

        • oh my GOD, can not.

          may be you can give me your email i sent to you my code (mainactivity.java)?

          • webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
            }

            @Override
            public void onPageFinished(WebView view, String url) {
            webView.setVisibility(View.VISIBLE);
            layoutProgress.setVisibility(View.GONE);
            progressBar.setIndeterminate(false);
            super.onPageFinished(view, url);

            }

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
            layoutProgress.setVisibility(View.VISIBLE);
            progressBar.setIndeterminate(true);
            super.onPageStarted(view, url, favicon);
            }
            });

          • if(isOnline()) {
            webView.loadUrl(“http://www.smartorderlaundry.esy.es/”);
            } else {
            String summary = “No Internet Connection”;
            webView.loadData(summary, “text/html”, null);
            toast(“No Internet Connection.”);
            }
            }
            private void toast(String message) {
            Toast.makeText(this, message, Toast.LENGTH_LONG).show();
            }

          • Hello someone has the android code studio 2.1.2..Para convert any website into an Android app ..

          • [email protected]

            Mail me MainActivity.java file and I’ll send you updated code for it.

          • please check your email, very thanks 🙁

  21. Daniel has the code android studio 2.1.2..Para convert any website into an Android app ..

  22. wen my phone screen rotated website strat from beginning. and how I put tow web link in one apps becouse my obsite remain many link when I click other link is open whit browser

  23. hi.when phone screen rotated webside star from home page. how can slove it.when I can use many link at mywebapps. problen when my website open a different link not given it apps cording it open whit browser. how can slove do it.

  24. loding webpage very slow

  25. hello, can i use this method to create notifications from the website to smartphone?

  26. when i click on phone number im getting this error

    Web page not available

    The web page at tel:00000000 could not be loaded because:

    net::ERR_UNKNOWN_URL_SCHEME

    and also

    Web page not available

    The web page atmailto:aaaaaaaaaa.r%40ssss.comcould not be loaded because:

    net::ERR_UNKNOWN_URL_SCHEME

    please help me out

  27. Bro.. I created an app.. Back button not working.. aAnd also i am getting errors when i use the code you have mentioned above.. Please help me bro

  28. does push notification work by this method?

  29. hello, i have streaming website
    i succses to make your tutorial but my player can’t work well. ( jwplayer )

  30. How to show notification

  31. Hello my name is Toplica. I have problem with app for android. Problem is in relation with WebView, I using the wix CMS tehnology but on my app when it open workin some strange. Dont opened full content hoow have aplication. Can U help me to solve that problem? I using your code on this site.

  32. I would like to know how to covert offline website to an Android App..
    [email protected]

  33. Clicking the device back button closes the app instead of going back to previous page

  34. Dear Rahul Mahadik,
    Thank you so much for this full explanation. To be quite honest I have tried every single step, but is not working with me. Now with your busy life, can I ask if you can do it for me?

    Thanks
    George

  35. my websites have some pop up ads and its messing with app when the ads open the apps shows nothing is thier any way to stop popups inside the app?

  36. Why The Checkbox JSON from database not Work,
    I use 1. Checkbox Country 2. Checkbox State
    if choose Checbox Country , Checkbox State Cant View the Data

    Help me sir

  37. hello sir all the above code id like webView progressBar etc.. cannot resolve ..whats happening in me..sir please tell me

    • now its fine it can resolve but cannot run

      Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
      C:\Users\user\Desktop\android project\CrimeHack\app\src\main\res\layout\activity_main.xml
      Error:(41) Error parsing XML: no element found
      C:\Users\user\Desktop\android project\CrimeHack\app\build\intermediates\res\merged\debug\layout\activity_main.xml
      Error:(41) Error parsing XML: no element found
      Error:Execution failed for task ‘:app:processDebugResources’.
      > com.android.ide.common.process.ProcessException: Failed to execute aapt
      Information:BUILD FAILED
      Information:Total time: 25.452 secs
      Information:3 errors
      Information:0 warnings
      Information:See complete output in console

    • See video tutorial and follow steps..

  38. (R.id.layoutProgress)

    here what is R? is it any user created short cut?… am an exact beginner in android os… so please explane me…
    but I have idea about java programming

  39. Please help me to make android app from my html files

  40. hi.when phone screen rotated webside star from home page. how can slove it.when I can use many link at mywebapps. problen when my website open a different link not given it apps cording it open whit browser. how can slove do it.

  41. Hi there,
    is’t possible to make a downloadable MP3 link after converting the website? I do have Mp3 link on my website and I want to activate it on the mobile, people can download the file?

    My regards
    George

  42. Hi. Really great tutorial.

    I hava a problem with a webview signin. Could you tell any solution how to react to login and logout and keep user signed in between application starts?

    • Web View is just a widget which is used to display. It cannot by itself remember data across sessions (if the activity is killed).
      Use CookieManager and CookieSyncManager to store such data.
      CookieManager.getInstance().setAcceptCookie(true);

  43. Error:(4, 60) No resource found that matches the given name (at ‘title’ with value ‘@string/action_settings’).

    http://prntscr.com/dqypp9

    What to DO
    http://prntscr.com/dqypzx

  44. the app closes when the back button is pressed.. what should i do..

  45. How to set listview in listview

  46. How Can i hide Progress Bar Loading ?

  47. Hello

    shouldOverrideUrlLoading Its deprecated, can u update code?

    I´m use android studio 2.2.3

  48. Your tutorial is great, but as mentioned before, when I rotate phone it goes to the first page…
    Can you help?

  49. how can i add back button functionality for my app. when i press back button my app closed directly instead of going on last page please advise

    thanks

  50. I liked it a lot more I would like to add a few more things is it possible? Like for example to make a phone call that they click on the phone number on the site is possible and what would be the codes and the? Permits would help me a lot

  51. How To Add AdMob ad codes in it.

  52. Great my bro. i was struggling for my website for many days thanks to help me make my android app.

  53. Can i convert an adsense enabled website to an app?

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest