NetTalk Central

Author Topic: Not detecting mobile  (Read 4503 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Not detecting mobile
« on: December 11, 2011, 09:17:59 AM »
I am using Chrome to resize my screen. In my settings I have various checkboxes (Mobile) checked and unchecked so I can change what is shown on the browses for example depending on whether it is a mobile device.

I thought that if you resized the screen in Chrome to a smartphone it automatically changed the screen view of the app. it does not. Even adding _menu_=1 does not change anything.

Is this a restriction at the moment? I am sure I did once run my app and it changed. Am not quite sure where to check now as I suspect I have changed a master setting somewhere.

BTW if I run the app on a mobile phone (Blackberry) that does not seem to work either. I have set my Blackberry Bold 9700 up so it can run the app using Jave etc.

Will sit down and re read the "book" again but thought this was automatic even though in it's infancy.

Thanks.

John

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Not detecting mobile
« Reply #1 on: December 11, 2011, 10:18:08 AM »
John,

If I'm not mistaken the desktop/mobile decision is made when the session starts. You can resize your screen all you want after that, but that doesn't change the mode.

Use ?_mobile_=1 to switch to mobile mode "on the fly".

Peter

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Not detecting mobile
« Reply #2 on: December 11, 2011, 11:30:58 AM »
Hey John,

If I am understanding you correctly, you are using the Google Chrome browser on a desktop/laptop to view a NetTalk web app.  Then resizing Crome's browser window to imitate a mobile device.  

This tactic will not trigger the automatic change between desktop to mobile mode.  For example, if I am using a laptop with a 15 inch screen and I open a Chrome browser on it.  Then resize the Chrome window to resemble a 4 inch screen.  The actual screen size is still 15 inches.  What Bruce does (PLEASE correct me if I'm wrong Bruce), is set the NetTalk web app to mobile mode, then resize the Chrome browse to resemble a small screen.  

This is what I do, I have my handy dandy Android phone next to me and point it's browser to the appropriate IP address.  I can then look at my web app in mobile mode on a real device.

Don
« Last Edit: December 11, 2011, 12:13:18 PM by DonRidley »
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Not detecting mobile
« Reply #3 on: December 11, 2011, 02:15:14 PM »
I am 99.999% sure that NetTalk uses the UserAgent string that is passed to it from the Browser itself to ascertain whether the device is a mobile one or not.

Chrome on the desktop will send a totally different UserAgent from, say, a Webkit based browser on an iPhone.

I think the newer Blackberry browsers are Webkit based also, but must send a different UserAgent which doesn't get picked up by NetTalk as a mobile device, which is why you may be experiencing the issues as above.  I believe that there is a code embed point where NetTalkHandler does the browser detection thingy, and you can add more browser detection code to try and identify these other devices.

I have a Mac development machine on my network also, and use the iPhone emulator on that to test the mobile version of WebApps I am developing on my Windows machine.

You could probably try using http://iphonetester.com/ to test sites on a Windows machine.

Here is another Firefox add on which may help: http://techie-buzz.com/tips-and-tricks/emulate-mobile-browser-in-firefox.html


DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Not detecting mobile
« Reply #4 on: December 11, 2011, 03:21:50 PM »
I am 99.999% sure that NetTalk uses the UserAgent string that is passed to it from the Browser itself to ascertain whether the device is a mobile one or not.

I think you are 100 % right..  ;D
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Not detecting mobile
« Reply #5 on: December 11, 2011, 10:22:47 PM »
yes, for now, mostly the User-Agent (and the _mobile_ setting.)

resizing a desktop window, or using the _menu_ setting, has no effect.

there have been some recent updates here, so make sure you're on a recent build. If it still doesn't put your phone in mobile mode automatically please post the User-Agent string (from the web server window) here.

cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Not detecting mobile
« Reply #6 on: December 12, 2011, 01:10:24 AM »
Thanks. Trouble is my Blackberry although pretty new seems so slow and does not always work (Blackberry software I think) and my partners HTC is playing up so not got a reliable test phone. Working on it though.

Thanks

John