Testing a website for mobile? - asp.net-mvc

I got a ASP.NET MVC website that is working fine in most desktop browers, now I need to make a version for mobile and my though is to use CSS Media Queries for this but I have no clue on how to test the page during development? Is there any desktop application that can be used like a mobile browser?

If all you want to do is test the media queries firing on certain viewport widths simply reduce the width of your browser. You can watch the UI change as different media queries fire.
You can also use browser plugins to define and set viewport resolutions. I use "Resize Window" for Chrome.
There is an Android emulator out there that you can download and run on the desktop, but this is mostly used for testing device specific features.
When it comes down to it the best way to test mobile websites is on the devices you are targeting.

you can try with
if (Request.Browser.IsMobileDevice == true)
{
....
}

To test your website you can use Chrome, there is a nice features included in it. You can change the user-agent and, then, emulate à resolution of an Ipad, Iphone or any smartphone.
It's pretty usefull to test responsive design and stuff :)
Well, in addition, be carefull it's only "simulation" it never remplace some real tests but it's nice for conception and pre-production process !
Here is a link about the change user agent feature of chrome : http://googlesystem.blogspot.fr/2011/12/changing-user-agent-new-google-chrome.html

I would suggest 3 tools that can help you:
Adobe Shadow http://labs.adobe.com/technologies/shadow: It lets you sync up the website you're viewing on your desktop browser to your mobile through the Adobe Shadow App, and you can use Chrome's dev tools on the mobile site through this method.
Remote Debugging with Chrome on Androids https://developers.google.com/chrome/mobile/docs/debugging: like Adobe Shadow you can debug and test your site through the chrome dev tools. However, you'll need an Android phone running on ICS.
Lastly, if you have the Xcode - you can use the iPhone simulator to view your sites. It is very accurate, you don't get the realtime debugging like you would with the previous two, but you can test your site on the fly after each update.

Related

Testing app by installing it on different devices?

For testing browsers in different OS and different browser(versions), we can use browserstack. Is there anything similar thing, so that we can select device and install the app from app store and test?
You can try Ripple Emulator Chrome Extension
Ripple Emulator at Chrome Web Store
Was using it previously and it did a quite a nice job. Obviously its not as good as browserstack, but definitely helps a lot checking different sizes of screens and some of other page behaviour.

What options for web site development for iPad are available?

I'm developing a site one of the targets of which is iPad.
What options do I have to debug client side (DOM inspector, style viewer/editor, javascript console, network analyzer - all thing every major desktop browser has) when viewing the site from iPad?
I'm not looking for some kind firebug lite, or anything that makes me to debug site from iPad itself. (This would be too tedious.) Instead, what I'm after is some sort of remote debugger for mobile Safary, allowing me to work with sites opened on iPad from a desktop machine, or an iPad emulator with same capabilities. I know there is the emulator that comes in bundle with official SDK, but does it have such means?
It's the first time I'm facing the problem, so not to blame!
This is what I'm aware of:
weinre (But does it really work?)
Check out BugSense and their HTML5 (javascript) installation

Which browser has most similar engine to iPad WebKit? (SVG, CSS)

I need to check rendering of a large sum of HTML5 "widgets" that will be shown in an iPad WebKit. Which desktop browser gives me the most similar renering experience? My widgets mostly consist of SVGs positioned with CSS3 and some CSS masking.
Is it Safari on a Mac?
EDIT: The desktop OS is not a concern, I can pick whatever I want for this...
EDIT: What particularly interrests me is if desktop Safari is closer to iOS Safari than Chrome is. They are both based on WebKit, but I see a lot of tiny rendering differences between Chrome and iOS Safari.
How about mobile Safari on the iPad Simulator?
Unfortunately, the iPad Simulator is Mac-only. If you can't test on that, Apple recommends using Safari and changing your user agent string to the iPad's user agent string. You can find instructions from Apple here.
Try real Safari. It uses Webkit and since you're on windows, you can't download the iPad simulator.
On the desktop, anything that uses WebKit is going to give you a similar rendering experience especially with regards to more technical things like SVGs. Unfortunately, there are still browser-specific quirks that you won't be able to notice without actually testing it on either the simulator or a real device.

How to test a web application on an iPad and other tablets without buying them?

Is there a trustworthy way to test iPad compatibility of a web application without buying the device itself? What about other tablets, do they provide any emulators?
If you have a Mac, just register with Apple (for free) and download the iOS SDK. It includes a program called 'iOS Simulator', which you can launch directly without knowing anything about Xcode/etc and includes Mobile Safari just like a real iPad. Since WebKit is exposed to iPad programmers for use in their programs, I'd expect the simulation to render identically to the real thing and, in practise, have never noticed any differences.
The iOS Developer Centre is here. Sadly, I have no experience of other tablets.
This is past mid-2012, now there are plugins or settings for User-Agent that "emulate" the connections for ipad (ios4 & ios5). Well it tricks the server into thinking that it is a different device.
For example, using Chrome, press F12 and click on settings (bottom right) and one of the tabs allows you to emulate the different devices.
safari - http://www.dummies.com/how-to/content/how-to-activate-user-agent-switcher-in-safari.html
FF needs plugin: https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/
IE8 - http://www.howtogeek.com/howto/18450/change-the-user-agent-string-in-internet-explorer-8/
IE9/10 - anyone can help?

Asp.net MVC2 with iPad

I have just come across the Mobile application toolkit which enables me to expose my web app built on Asp.NET MVC 2 on an iPhone and other mobile devices. However how would I expose my site on an iPad?
Are there any toolkits out there?
JD
Well, what I do is just using a Framework. I used to use jQTouch but now I'm using jQueryMobile as it works better in Android and Opera Mobile (to use with Nokias or any mobile device) much better that the last time I use jQTouch (before Jonathan took over the project).
if a user is using an iPad or any other desktop browser, I sent the user to my desktop views, if using any other iDevice, Android or Opera Mobile, I set the user to use jQueryMobile Views.
It's quite easy to accomplish this with MVC2, the controllers are the same, methods are the same, you just redirect to a different view.
I choose to should my web application in desktop mode in the iPad cause I add some meta to it and that works fantasticaly fine in the iPad, you could also use any Framework or develop a new html5 view to work with the iPad if you don't want to mess up what you have already.
You need to rememer that in an iPad, there is no "hover" effect, and a click is a tap, though Mobile Safari does a pretty good job on click events, you could create a new set of views that use this new techniques, as well, the full set of Safari CSS3 and other bonus, such as geolocation, browser database, etc
more under Apple Technical Note: Preparing Your Web Content for iPad
I hope this helps, if you need more, please more precise question

Resources