ASP.NET how to debug mobile version? - asp.net

I am working with a platform on ASP.net that does not have a native mobile version.
I am tasked with debugging a problem that is only for mobile users however searching the codebase for "mobile" or "useragent" does not return anything meaningful that I can use to reverse engineer to find the root problem. It appears that the only mobile checks on the platform are from jQuery regex checks against the useragent and are very very minimal checks to disable a button and not set any global or local variables.
I have tried using Chrome's Mobile Simulator but it seems that only changes the screen resolution rather than simulate a real mobile device. I have also tried modifying the user agent using browser extensions to no avail.
How can I force my desktop browser to load the mobile version of the website for debugging?
Where does ASP.NET determine the device type at?

Related

Wordpress - How to detect an iPad tablet

So I have created a website in Wordpress to market a mobile app service that I provide. Once a user signs up on the website, I want to detect the device that they are on and send them to the appropriate app store to install the app to make it a seamless transaction for them. So far, I have been using a javascript library called MobileDetect that is based on a PHP MobileDetect project. It is basically based on deciphering the useragent string to determine the device. This has been working fine for awhile, but recently with iOS 13, I can no longer detect an iPad because Apple has changed the useragent because they don't want mobile versions of websites popping up automatically on iPad Pro, they would prefer full desktop versions of the webite to appear. So if a user signs up on a Android or an Amazon Fire device, I can still send them to the appropriate app store. But I am not able to distinguish between whether they sign up on a computer or an iPad as MobileDetect now sees them as both the same.
How can I detect an iPad running iOS 13 so that I can send them to Apple's App Store to download my app after they sign up???

Mobile Browser emulator where Request.Browser.IsMobileDevice=True?

I'm currently testing an ASP.NET Web Application on the "Opera Mobile" emulator.
I've got the following code for testing purposes:
Response.Write(Request.Browser.IsMobileDevice)
This is returning False
Are there emulators which act exactly like a mobile browser, so that this would return True?
It would be a bit of a pain if I have to release the application each time so that I can access it on my actual mobile phone.
I don´t recommend you to use IsMobileDevice directly, because his db is not update. Microsoft launched mdbf, but now it´s abandoned.
You could override it using WURFL or 51degrees. But if you don´t need browser capabilities and you only need to know if it´s mobile device then you can use this script.
You might consider using this component:
https://github.com/51Degrees/dotNET-Device-Detection
It detects mobile browsers far more reliable than the built in detection in .NET

Is it possible to upload a picture through a web browser from a mobile device?

This question has been asked before, but not this year - there is no concrete consensus and I know this is a hot topic. In addition, technology changes rather quickly, and the other questions seem to relate to only using the <input type="file>. I am looking for a more verbose modern way to handle these requests. Although I have been developing in ASP.NET C# MVC3, I have been looking into weather ASP.NET MVC4 Mobile will support mobile file upload. From what I have read, it does not, or it has not been covered in the new release notes.
http://www.asp.net/vnext/overview/whitepapers/whats-new
http://www.asp.net/mvc/tutorials/mvc-4/aspnet-mvc-4-mobile-features
From the research I have done jQuery-Mobile seems rather gimmicky.
http://www.parorrey.com/blog/jquery-mobile/file-input-field-uploading-using-jquery-mobile-framework-form-submission-with-ajax-disabled/
http://forum.jquery.com/topic/jquery-mobile-seems-to-clobber-ability-to-upload-files-via-forms
An example that was posted did not work on my iPhone, as the <input type="file" still existed and was therefore grayed out as inaccessible.
http://filamentgroup.com/examples/jquery-custom-file-input/
Another suggestion I have come across involves forcing the user to email the photo to a user-specific email which doesn't really appeal to me or the customers I deal with - this approach also seems like it could be vulnerable to security breaches.
IS there a way to do this that I have overlooked? How can I show a file dialog on a mobile device?
The Safari browser does not support file uploads. You can see this by visiting many of the mobile sites in the actual browser BUT the actual apps will allow this.
So if you are making a mobile web app that you wish to deploy as a native app, you can use phonegap as a layer to do this.
http://docs.phonegap.com/en/1.4.1/phonegap_file_file.md.html#FileTransfer
Also, it is supported in:
Android
BlackBerry WebWorks (OS 5.0 and higher)
iOS
Windows Phone 7 ( Mango )
I use jquery mobile in a production app and it works just fine. I don't do file upload with it; however, that isn't jquery mobile's job anyhow. JqueryUI has issues with its dialog and file upload as well. There are a number of scripts that help with that. I use ajaxfileupload: http://www.phpletter.com/Our-Projects/AjaxFileUpload/ there are better ones out there now though.
I digress. As far as mobile is concerned it is more useful to have camera features involved rather than pure fileupload. No one knows where they store things on their phones, which is part of the problem. For that case you may want to try phonegap. Try this: http://wiki.phonegap.com/w/page/18270855/Image%20Upload%20using%20JQuery%20and%20Python
Yes we can upload picture through mobile,
Face book is a live example for this.
It works for me on Android.
You can see how facebook does it here: https://m.facebook.com/home.php?refsrc=http%3A%2F%2Fm.facebook.com%2F&refid=8&_rdr
<input type="file" name="file1" data-sigil="photo-input" />
Try going to www.tinypic.com and uploading a photo. I can test on iPhone tonight.
This works fine on Android 2.2+. You can upload photos from your gallery or use the camera to take a new picture for uploading. Any other apps that expose similar behaviour like sound recorders, the camcorder and music apps will typically offer alternatives. If you have a good filesystem app installed this will normally allow you to upload arbitrary files.
On iOS, you have to use an app to upload files. Since this is such a glaring omission in this age of web apps, it is very likely this feature will be added in the next major release of iOS although that is likely a few months away still.
Try this:
<input type="file" accept="image/*;capture=camera">
This should be supported in most mobile browsers and should offer the user a chance to choose a local file (image) or one some modern devices even allow them to capture one in the process.
Hope this helps!
Use Phonegap to bridge the gap between client side libraries and native applications. While the client side libraries give a good handle and easy way to set UI things up, you can use the capability of phonegap to perform device specific operations like camera, scanning, call etc.
Mobile browsers in Android (pre 2.2 it seems) and iOS do not allow file system access. And when it does on Android 2.2+ it isn't full access - it is filtered via apps that hit the FS like Gallery or Music.

How to use ASP.NET Web for Windows phone

I want to create an ASP.NET web site. I have not been using ASP.NET for quite a while and I need help. As you know already there is an IE9 mobile browser for Windows phone, I have these questions:
1) Which version of ASP.NET is supported by the IE 9 mobile browser in Windows phone? I means all the output of html is ok.
2) Can all controls in all versions of ASP.NET be used for the IE9 mobile browser?
3) What di I need to set in the Declaration part < !Doctype.......> in my ASP.NET pages ? Will ASP.NET output it according for IE9 MObile Browser?
4) Does the Div control work ? Will this work Div.html = "........html ...."
5) What should not be used from ASP.NET for the IE 9 mobile browser?
6) How do I make the fontsize bigger or which fontsize is best for Wp screen?
------- Update
I have ASP.NET V1.1 with JQuery ( not the latest) , My Windows phone 7 HD7 can not work with the JQuery? Does JQuery have diff version for mobile than ASP.NET?
Any info on what version of Html spit out by ASP.NET V1.1,2.0, to the ASP.NET 4.0??
Using Plain HTML wont help much on the server for many server tasks.
Any resource link on how to build aspnet for windows phone 7 would be appreciated.
See the Web Development for Windows Phone details on MSDN as it provides specific guidance on developing for the phone and details of what is not supported on the phone (but is in the full version of IE9).
The phone uses the same code base for the rendering and javascript engine as the desktop version of IE9 does so most things should work.
If you're build a site specifically targetting the phone you will probably see better results if using jQueryMobile rather than the full version but be sure to test fully.
I'd recommend building a HTML 5 site rather than any (X)HTML 4 variation. The browser supports a lot of the newer functionality and you'll get a cleaner layout as well as backwards compatibility for other devices.
You'll also find lots of useful relevant articles at http://blogs.msdn.com/b/iemobile/ and http://windowsteamblog.com/windows_phone/b/wpdev/archive/tags/ie9/
ASP.NET is a server side technology so it is not related or constrained by the client devices which access to it, you can use Windows based computers, ITab, Max, Linux, Android, Windows Phone 7, Blackberry phones... to connect to the web site and in any case all the server side processing is performed on the web server (or other back end app servers depending on configuration), on the clients will only arrive html to be rendered and this could contain javascript to be executed locally.
in general modern mobile browsers are very good, I had the best experience with Android devices on mobile devices, which run some kind of Chrome compatible browser, iPhones and iPads run safari, also available for PC and Mac.
if you test your application from a PC with multiple browsers like Chrome, Safari and IE and everything works fine, it will most likely work fine, in general JavaScript abstraction libraries are used to write fully cross browser and cross platform javascript, one of the most popular is JQuery.
I am convinced that the version of IE9 (or similar one, it's not 100% the same IE9 of desktops) included in Windows Phone is probably advanced enough to support all HTML 4 tags and probably has a very advanced Javascript engine as well.
To detect from the server which user agent (device, browser) is connected and render different content or format layout with specific style sheets, check this question here in SO:
how to detect a mobile phone in a web application

Designing issue in JQuery mobile with asp.net

I am creating mobile application in asp.net webform targeting IPhone, Android and blackberry. I am using JQuery-Mobile for the same.
Below is my first page I have developed with jquery-mobile.
I don't have iphone, android and blackberry. So my questions are:
Best Simulator I can use on windows XP/ Windows Server 2008 for Iphone, Andriod and Blackberry
Also, when I am running the application on the browser it is looking wierd. I mean textbox size, buttons. Is this the way it looks on normal webpage or it's my faulty design?
As I am developing application in asp.net, do I need to install latest browser which support HTML5 and CSS3 because below browser is IE7.
An old IE is not the best choice to test the capabilities of a HTML5+javascript framework...
For daily basis it's quite ok to use Firefox or any WebKit based browser (chrome, safari ...)
Emulators are very helpful, but to be sure your product works well you will probably need to give it a try on an actual device. I have already seen some reports of problems that show up only when working with the real device.
A team that I do some JQM stuff for has bought a cheap old ipod touch for testing. It's the most demanding apple product you can get. It has the oldest browser, causes most problems and is the slowest. Best choice! :)
Emulator for Android
Simulators for Blackberry
I'm sure Apple has one too - but I think you need to register as a iOS developer before you can get your hands on it. I believe using third-party iOS emulators is against Apple's policy.

Resources