Warning: count(): Parameter must be an array or an object that implements Countable in /customers/b/0/d/joethemes.com/httpd.www/wp-includes/post-template.php on line 284

Create an Android App from a Responsive website Easy.

 In Articles
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>

Recent Posts
Showing 2 comments

Leave a Comment