Jump to content


Photo

Tips for mobile browsers


  • Please log in to reply
13 replies to this topic

#1 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9874 posts

Posted 02 August 2011 - 07:44 PM

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

document.body.addEventListener('touchmove',function(event){
  event.preventDefault();
},false);

  • 0

#2 Dionel Acosta Duarte

Dionel Acosta Duarte

    Advanced Member

  • Members
  • PipPipPipPip
  • 450 posts
  • LocationDominican Republic

Posted 02 August 2011 - 07:59 PM

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />
<meta name="viewport" content="width=device-width" />

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

document.body.addEventListener('touchmove',function(event){
  event.preventDefault();
},false);


Thank you. This is an important aspect of the current applications. It is a big increment of the use of mobile devices and the applications from they.
  • 0

#3 Dionel Acosta Duarte

Dionel Acosta Duarte

    Advanced Member

  • Members
  • PipPipPipPip
  • 450 posts
  • LocationDominican Republic

Posted 02 August 2011 - 08:19 PM

Two questions:

1- Why two times "viewport". Which is the difference between first and second????

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????
  • 0

#4 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9874 posts

Posted 02 August 2011 - 08:24 PM

Two questions:

1- Why two times "viewport". Which is the difference between first and second????

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????


Second "viewport" seems to be unnecessary. It is OK to remove.

BTW, it was Google knowledge. :)
Original source here:

http://garrows.com/?p=337
  • 0

#5 Dionel Acosta Duarte

Dionel Acosta Duarte

    Advanced Member

  • Members
  • PipPipPipPip
  • 450 posts
  • LocationDominican Republic

Posted 02 August 2011 - 08:38 PM

Two questions:

1- Why two times "viewport". Which is the difference between first and second????

2- I test and application in IPhone 4 and the loading image of Safari WebBrowser is showing intermittent after page is loaded like is still doing something or calling something to server. Why????


I reply my self in second question:

There was a UniTimer with the property Enable := True. That was the cause.
  • 0

#6 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9874 posts

Posted 02 August 2011 - 10:18 PM

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

document.body.addEventListener('touchmove',function(event){
  event.preventDefault();
},false);


Do not work under FireFox Android.
  • 0

#7 fjtrooper

fjtrooper

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 207 posts

Posted 10 August 2011 - 11:18 AM

Hello, if you open this mobile prepared web in internet explorer 9 fails in the followed code:

document.body.addEventListener('touchmove',function(event){
event.preventDefault();
},false);



thanks
  • 0

#8 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9874 posts

Posted 10 August 2011 - 08:55 PM

Solution:

if (document.body) {
   document.body.addEventListener('touchmove',function(event){
 	event.preventDefault();
   },false);	
}

  • 0

#9 fjtrooper

fjtrooper

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 207 posts

Posted 11 August 2011 - 12:37 AM

Thanks!!!!! ;-)
  • 0

#10 fjtrooper

fjtrooper

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 207 posts

Posted 11 August 2011 - 07:41 AM

Same error ;-)
  • 0

#11 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9874 posts

Posted 11 August 2011 - 07:58 AM

What is the error code/message?
  • 0

#12 fjtrooper

fjtrooper

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 207 posts

Posted 11 August 2011 - 08:47 AM

Oooopssss!! Sorry!! It works!!! I put the script in the incorrect form!! SORRY!
Now works!!! ;-)
  • 0

#13 vojasoft

vojasoft

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 February 2013 - 11:41 AM

Below meta displays page in a 1/1 scale and also disables browser in-zoom/out-zoom function. It should be added to servermodule.CutsomMeta.
 

<meta content='True' name='HandheldFriendly' />
<meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />

Below script disables moving the page around inside the browser window. Add this to MainForm.Script

document.body.addEventListener('touchmove',function(event){
  event.preventDefault();
},false);

Hi!
Code above does not work on Samsung Android browser.
I appreciate any idea or help.
Thanks in advance.
Voja


  • 0

#14 Javier Bechir

Javier Bechir

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 May 2013 - 04:49 PM

how to do a mobile application with unigui?. Is there any example?


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users