Create an Android App from a Responsive website Easy.

21:22:00 2 Comments

The below code will help you create a Android app from your responsive website.Please copy this HTML code to the index file of your cordova project and then build the project.Change logo in your cordova project with your respective logos.

<head>
    <title>Home</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // device APIs are available
    //
    function onDeviceReady() {
        // Register the event listener
        document.addEventListener("backbutton", onBackKeyDown, false);
    }

    // Handle the back button
    //
    function onBackKeyDown() {

magic();
    }


function magic (){

    $("#button").click(function(event){    
        //var h = document.getElementById("myIFrame").contentWindow.history;
       
        //h.back();
     
        $("#myIFrame").attr('src', window.history.back());
    });

}

    </script>
  </head>





<script
  src="https://code.jquery.com/jquery-3.1.1.js"
  integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA="
  crossorigin="anonymous"></script>
<iframe id="myIFrame" src="http://yourwebsite.com" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;" scrolling="yes" frameborder="0" allowTransparency="true"></iframe>

<script>

</script>

Joel

Joel Fernandes,I am a Very Smart,Innovative Creative and One of the Best Webdevelopers.I am an expert in Webdevelopment.My other interest include Cars and Vehicles.My desire is to be the best and serve you with the best information I have .I will always share all my tips and tricks on this website and provide you with the best themes so that your life may be simpler.Keep visiting www.joelwebsites.com for the best website related ,tips and tricks and news.Meet me on FaceBook

2 comments:

  1. Your tips are helpful in creating an android app from responsive website. If any one looking for responsive Web Development Miami, visit firstimageus.com.

    ReplyDelete
  2. Knowledgeable information shared by you about creating an Android App from a Responsive website. theportwebdesign.com is the best Web design company in Maine .

    ReplyDelete