- This topic has 8 replies, 3 voices, and was last updated 10 years, 8 months ago by Brandon.
-
AuthorPosts
-
Mike FelkerParticipantMobiOne is amazing for creating apps, but can it be used to create full mobile websites?
I would not need to deploy to android or IOS, but I would need to figure out the code to auto-send users to the mobile site if they are using a phone (tablets should just use the main site since they are much larger).
Thanks for any help.
Mike
Mike FelkerParticipantThe answer is YES and NO.
I uploaded the files in the www folder to my web server and navigated to it using my PC. It seemed to work fine. I then used my Android phone to navigate to it using my mobile browser. On the Android, however, although the page does come up, none of the buttons work at all. The map control does not work either.
It did work on my iPad, however. Strange.
Is there any way to have all the controls actually work on android phones so that I could use MobiOne as a mobile website builder? I have other software, but MobiOne works better than any of the others.
If you want to try it out on your mobile device and see if it works, let me know if it does or not:
http://www.tampabaybusiness.org/tb3app/TB3App.html
Mike
Mike FelkerParticipantNow I’m really confused. I tried my own link above from my Android phone and it worked fine. Weird.
Anyway, assuming it does indeed work for all devices, how would my website auto detect a cell phone versus a tablet versus a computer and route the user to the mobile phone version only?
BrandonMemberI have done several mobile sites with M1 without any probelms.
I used soemthing like this:
function detectmob() {
if(window.innerWidth <= 800 ) {
//go to mobile url
}
}I no longer do webapps though, due to the various problems with iOS.
Mike FelkerParticipantfunction detectmob() {
if(window.innerWidth <= 800 ) {
//go to mobile url
}
}Where do I add this on my web page? Before or after the [head], or is this inside the app?
Mike
BrandonMemberIts not the one I actually use. Here is what I use, right before the closing head tag (</head>):
http://detectmobilebrowsers.com/Click the Javascript to download the code
Mike FelkerParticipantI found a great way to do this – very VERY close to what you suggested:
Place this in the HEADER section of your website landing page:
<script type="text/javascript"> <!-- if (screen.width <= 699) { document.location = "YOUR-MOBILE-SITE.com"; } //--> </script>
Mike
shahinMemberI start a web browser in my app and the newly build page wants to close itself with window.close(), this works in a normal desktop browser, but it does not close in MobiOne. Any idea how a page can close itself when initiated in app?
BrandonMemberIf this is a native app I believe the best way is the PhoneGap API:
NOTE: This is from the PhoneGap docs and has not been tested by me
var ref = window.open('http://apache.org', '_blank', 'location=no');//open your browser window ref.close(); //call when you want to close the window opened with above code A full example closing the page after 5 seconds: var ref = window.open('http://apache.org', '_blank', 'location=yes'); // close InAppBrowser after 5 seconds setTimeout(function() { ref.close(); }, 5000);
-
AuthorPosts