Create an Android App from a Responsive website Easy.
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>
<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>
.png)

Your tips are helpful in creating an android app from responsive website. If any one looking for responsive Web Development Miami, visit firstimageus.com.
ReplyDeleteKnowledgeable information shared by you about creating an Android App from a Responsive website. theportwebdesign.com is the best Web design company in Maine .
ReplyDelete