Page 1 of 1

How can I detect if my app is running in webpreview mode?

Posted: Thu May 31, 2012 9:32 pm
by Claudio

Hi,
I would like to know if there is a way to detect if the app is running in webpreview and/or in a device (android/iphone) and if is in debug mode or not.

Thanks


How can I detect if my app is running in webpreview mode?

Posted: Thu May 31, 2012 11:39 pm
by maxkatz

What do you mean by webpreview mode..? Are you referring to the phone frame that you see when testing..?


How can I detect if my app is running in webpreview mode?

Posted: Fri Jun 01, 2012 8:10 am
by Claudio

Yes, sorry if I was not clear.
I need a way to detect if the app is running inside a device or in the desktop browser.

This because I use the BarCode Scanner Service and when the app runs inside the browser, obviously it does not work.
So I want implement a workround to detect such situation and skip the service call and return a fake value so I can continue to test the app.


How can I detect if my app is running in webpreview mode?

Posted: Fri Jun 01, 2012 4:01 pm
by maxkatz

You can try to invoke the barcode scanner and if it returns an error (or undefined), you are running in a web browser.


How can I detect if my app is running in webpreview mode?

Posted: Tue Jun 26, 2012 9:25 pm
by Claudio

Just for you know, I used the "echo" option on the barcode scan service when I test and debug my App inside the browser.
Obviously I switch off the echo mode when I deploy the app on the device