Debugging web app on ipad without Mac - ipad

I'm tasked with fixing a bug on the mobile version of a project I just came on (and still learning my way around it). Its a heavy use 24/7 kinda job, so not keen on the trial and error guess/upload/test style of debugging.The bug is that almost none of the controls, particularly tabs, respond to user "clicks" on the ipad. The app was developed in asp.net MVC4 and I work on windows 7 in vs2012.
We are not a mac shop, but still need to support the Ipad and phone.
This is probably a simple question: but my searching keeps taking me
here: iOS6 - removed console log for IPad - how to use web inspector on windows?
and here: Accessing iOS Safari Web Inspector from Windows Machine.
I need a way to gather actually diagnostics, like what would be available in web inspector, without having to acquire a mac.

Use weinre. It runs a webserver that that can repond to a bookmarklet or <script> to run a remote inspector.
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.
Get NodeJS, NPM, and a webkit-based desktop browser to run it.
Homepage: https://people.apache.org/~pmuellr/weinre/
Docs: https://people.apache.org/~pmuellr/weinre/docs/latest/
To install with yarn:
yarn add --dev weinre
then because it's no longer maintained, you may get TypeError: mime.lookup is not a function when you try to use it, then you have to edit node_modules/connect/lib/middleware/static.js and change require('mime') to require('mime-types') on line 21 (thanks). Then start with
yarn run weinre
If you now open the url showed there, you'll see the bookmarklet you can use etc. (Note: If using this from other computers, you may have to open local firewall ports, and if debugging a https site you may have to add a reverse proxy with cors headers.)

Related

How to load javascript globally on a web-based Rhomobile application

We are looking at transferring our web-based app from Naurtech CETerm to Rhomobile. We can change javascript functions/meta tags to use the methods of Rhomobile instead of CETerm, but due to the poor hardware performance of our devices the slow down caused by the overhead of loading jQuery and other files is significant. (Prior to this we had no requirement for jQuery, although it would have been nice to have it). We also now need the rhoapi javascript which is significant.
Is there a way to include these "framework" javascript files in the Rhomobile container app and have them available to all pages loaded without them needing to be re-parsed on each page load?
It is currently a web based app loaded using something like the following in our rhoconfig.txt file as opposed to a local file:
start_path = 'http://xxxxxx.co.uk/login.php'
My current understanding is that this means the app/layout.erb file cannot be used to solve this problem?
Thanks
More than RhoMobile Suite (and it's RhoElements enterprise device framework) you can take a look at Zebra Technologies' Enterprise Browser that is intended to be used as a stand-alone industrial browser, targeting Windows Mobile/Windows CE and Android devices manufactured by Motorola Solutions (now Zebra Technologies).
On "not too old" Windows CE/ Windows Mobile devices Zebra's Enterprise Browser uses a webkit derived HTML5 capable renderer engine so, to answer your question, you can use HTML5 application cache to download the JavaScript libraries only if there's an update, in this way you can remove any network delay.
I've seen some project using giant JavaScript files (well above 1MB compressed) on old WinCE 6.0 devices, the startup time is clearly the biggest problem, with the risk to look at a white page for 5-7s. This can be alleviated with an async loader and a splash screen. It's not going to make your page faster, but the user will know what is going on.
You can find more information about Enterprise Browser on Zebra Technologies developer website, the Launchpad, inside Enterprise Browser area.
If you build your custom RhoMobile web-app container with the idea to use in server pages, local resources, you can hit some issues around cross-site scripting prevention policies.

troubleshoot asp.net web app on iOS

I have a web app with asp.net mvc 5 on running on iis 7.5. I have a photo upload page that I made with DropZone (a javascript ajax upload plugin). In my asp.net controller during certain errors, I return an httpstatuscode of 500 with a status description with a descriptive error. DropZone then displays this descriptive error. Everything works as it should on desktop devices, however when used on an iOS device it displays a generic "Internal Server Error" message.
I'm lost at how to troubleshoot this issue. I've placed javascript alerts throughout my javascript code to try and figure out what the issue is but that didn't reveal anything helpful. I've tried using the MIHTool ipad app and the HttpWatchBasic ipad app to try and set breakpoints but that was not helpful either.
Is there a way to remotely debug an asp.net web app from an iPad? (I have visual studio 2013 premium) Or does anyone have any ideas what may be causing a different status code to be sent?
UPDATE: It appears that iOS devices ignore any custom xhr.statusText and uses the standard default statusText (i.e. code 500 is Internal Server Error). As a work around (which I hate doing, but since this is primarily for use on company iPads I didn't have much choice) I've returned a different 500 class code for each possible exception and then in the javascript code check the status code and assign my own custom error message in the javascript code.
Quickest and easiest way to see the actual exception is to turn off custom errors in your Web.config - you'll then be able to view the actual stacktrace on the iPad.
If you'd like to be able to debug the exception, you should be able to trigger it by accessing the site from the iPad by hitting your windows development machine while running in the debugger. You'll need to configure IIS express to allow remote connections (editing application host.config), adding a urlacl, and opening the Windows firewall if necessary. There are numerous guides in setting this up online.
If you want to actually debug the JS in mobile Safari, this is possible from the Mac version of Safari - see http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787 for details.

How to call Java EE SOAP or REST services from mobile platform. etc Dxtreme, Jquery Mobile, Icenium

I want to develop mobile apps based on HTML, JS. It must work on any device etc iphone, ipad, android and windows phone...
I must use JAVA EE on server side. First I choosed Dxtreme. after I learned dxtreme, it is possible REST Service using ASP.NET Web API. But it is inpossible on Java EE. following error :
But call along #POST, #PUT and #DELETE methods throws error
"XMLHttpRequest cannot load http://www.restserver/Service/item. Origin
http://www.localhost:51140 is not allowed by Access-Control-Allow-Origin".
I believe there must be something that people must be using SOAP or REST Service on Mobile.
Which mobile framework is it possible ?
Please help me.
Thanks.
have You read About Phonegap?U can use phonegap to build application that can work around different Mobile platform.Its uses HTML5,CSS3,Javascript.Hope this helps you......
Generally, people access web services using RESTful interfaces on the server end. You can create that with ASP.NET Web API and many other server side frameworks of course. Your error, I'm guessing, but not sure, is from your client application. If I'm correct, you are probably running some simulator or the app within a browser client, and not one of the mobile framework simulators, and are running into the problem where the browser restricts your access to services on systems other than the site your started with. I.e. if you got to myboringwebpage.com and try to look up something on api.twitter.com within the app, the browser will stop you unless you add certain things to your web server/page telling the browser that that is OK. Look up "CORS". With Icenium, if you use the browser development environment "Mist" you will get those issues. If you use the Windows environment "Graphite" there is no such restriction. If you use the Intel HTML5 XDK at http://html5m.com/, it runs some process to get around those issues, while running a simulator in a browser. If you end up building PhoneGap apps, which you can using Icenium, appery.io, Intel HTML5 XDK, PhoneGap Build and others, the built app, installed on the phone, will not be restricted as an in-browser "app" would. However, I had problems with the Intel framework's XHR code handling all the different methods. Sorry this probably doesn't cover everything you need - you'll have to live and learn a lot of this.

help with troubleshooting a jQuery UI Tabs problem on iPad

I would be grateful for some pointers on how to troubleshoot this problem. Quick summary of the situation:
I have a large document (200K) divided into five main sections of inequal length, each of which corresponds to a jQuery UI tab.
The page works perfectly in Safari for Windows, Safari for Macintosh, Opera, Firefox, Chrome, and IE.
The page used to work on the iPad too but it no longer does, and it's the iPad that has changed, not the page.
On the iPad, the tab-content is now getting cut off. E.g. one of the pages is a glossary that runs from A-Z and the page cuts off at the letter -H-. It used to scroll all the way to -Z-. For some reason, iPad Safari is not giving each Tab the full amount of vertical space it needs for its content.
I've looked at the jQuery UI code for the show tabs and it appears to be changing CSS classes hide/show, but I'm no ninja javascript coder. How do I begin to figure out what's wrong on the iPad when my page works as expected on every other browser?
EDIT: The page seems to be working fine on the iPad2. It could be a caching issue and the page might stop working at some point even on the iPad2--I could only test at the Apple store. But I believe the markup and coding and jQuery ui are essentially OK, and it's a iPad Safari issue.
I can't trouble-shoot myself without the code, but the by far best way to trouble-shoot situations like this is to use a tool called Weinre. Obviously if one browser (the iPad's) is having trouble, you need to troubleshoot directly with it. That's difficult since the iPad doesn't have developer tools, but Weinre can actually give you (most of) that, over the network.
Follow the instructions here, but at the least you need to provide a ~/.weinre/server.properties that contains this:
boundHost: -all-
httpPort: 8081
reuseAddr: true
readTimeout: 1
deathTimeout: 5
That will tell weinre to listen on every IP on the port 8081. Start Weinre (via the OS X runner or with java -jar weinre.jar on the command line.
Then you add a special script tag in the main page:
<script src="http://YOUR_IP_NUMBER:8081/target/target-script-min.js"></script>
After this you start Safari or Chrome and go to http://localhost:8081/client/. If everything went as planned you will see the Weinre interface, which is a subset of the WebKit developer tools.
Now connect to your development machine with the iPad or simulator. If the script tag is correct Weinre makes a connection to the iPad and you have a fairly large subset of WebKit's developer tools at your disposal for trouble shooting. Good luck!
I'm sure this isn't the answer you're hoping for, but it sounds like a bug that should be reported to Apple.
You have a page that works perfectly on every other browser and I think its in Apple's best interest that it works on the iPad as well.
There might be other pages out there that used to work, but now don't, so I would consider this bug to be pretty high priority.

Silverlight Test without opening browser

Is there any way to run Silverlight tests without opening the browser? It takes some time to open the browser. if you are doing TDD, you may not like it.
I don´t think so.
for Silverlights Sandbox has to be astablished to test apainst and the sandbox does life in the browser , I can´t see a way to achiev this.
Regards Ren
You can test the Out Of Browser (OOB) version of your application instead. To do this, add a call to Application.Install() within your application, run it, and then in Visual Studio debug the Silverlight project itself rather than the ASP.NET project.
Once installed, you can also run the OOB version of the application from the command-line using "sllauncher.exe". To get the right parameters for sllauncher, look at the properties of the shortcut the installer creates for your app.
Even though you can use the sllauncher.exe - it still runs in using an IEFrame - hence effectively still uses a browser to host the SL sandbox. Sure, you won't see the browser in the regular sense.

Resources