Showing posts with label mobile. Show all posts
Showing posts with label mobile. Show all posts

Jul 23, 2015

Javascript redirect for mobile devices

The best method to redirect for mobile that I found is following:


<script type="text/javascript">
if (screen.width < 1081) {
 var ref = document.referrer;
 var urls = new Array("http://www.mymainsite.com","http://m.mymobilesite.com");
 var n = ref.match(urls[0]);
 var m = ref.match(urls[1]);
 if ((m!==null) || (n!==null)) {
 stop;
 }
 else if (ref=='') {
 var r = confirm("Small Display is Detected.\nClick \"OK\" for MOBILE SITE.");
 if (r==true) {
  window.location = "http://m.mymobilesite.com";
  }
  else {
  stop ;
 }
 }
 else
 {
 window.location = "http://m.mymobilesite.com";
 } 
}
</script>

Feb 25, 2014

Math library in Java ME

Math.round() is not available in J2ME.
So, it's hard to round a double.

May 30, 2012

Which is the best?

I need a framework for develop desktop/mobile apps. And I don't know how to choose:

Sencha or JQMobile / jQuery Touch?

http://cfc.kizzx2.com/index.php/sencha-touch-vs-jquery-mobile-a-first-look/