How do I get the users current location in a Windows 8 app?

There are instances whilst developing Windows 8 applications in HTML5 when you discover there are two ways to do the same thing. Geolocation is one of those examples. You can either do it the same way you would in a browser like IE9 or Chrome or you could do it the WinJS way. By providing…

0

How do you test the touch / on-screen keyboard inside the simulator?

I got asked this question on email last week. The simulator, for those that don’t know, is a way to test your Windows 8 application on simulated hardware. You can, for example, simulate a higher resolution or Pixel density than your actual machine. Amongst other things it also allows you to simulate touch events. To…

1

How do I ask the user to add my application to the lock screen?

For background task with timers to launch you must ensure that your app is added to the lock screen. You can request to be added as a lock screen application by adding the following code to your project: var Background = Windows.ApplicationModel.Background; var promise = Background.BackgroundExecutionManager.requestAccessAsync().then( function(result) { switch (result) { case Background.BackgroundAccessStatus.denied: // Background…

0

How do I change the “This app can’t share” message?

If you build a windows 8 application and don’t implement sharing on a specific page, when a user presses the Windows 8 share charm the default text that is displayed says “This app can’t share” it maybe the case that other pages can share or that you plan to add sharing into a future version…

1

How do I add video elements to a WinJS.UI.ListView

If you create a WinJS.UI.ListView and add interactive content to it, by default you will not be be able to interact with it. So with a video element you will not be able to press the play button or change the volume. If you want to enable this behaviour all you have to do is…

1

Update from the Windows 8 Camps

I’m just coming to the end of another Windows 8 boot camp in London. I had a few interesting questions and so I thought I’d document some of them here. Remember if you want to come to one of our Windows 8 Camps then all of the dates and registration details can be found here….

0

The need for speed?

IT Pro Portal ran a story the other week– HTML5 Mobile Performance Lags Way Behind Laptops. In it, Darren Allan points to a new set of benchmarks showing that HTML5 runs up to 6 to 10 times slower than on a current laptop. The conclusion is that this will limit the ability of developers to…

0

Error.stack

In the statically typed code world I used to inhabit Call stacks were often used to diagnose the root cause of events. I wasn’t aware that JavaScript had a similar (albeit non ECMA5) way of performing error stack interrogation. It’s called Error.stack It makes bugs -particularly those ones that are deep inside of anonymous functions…

0

Reading Minified JavaScript

If you have viewed source on any website in the last few years then you will have certainly seen Minified JavaScript. This is JavaScript where all of the whitespace and unnecessary characters have been removed. Developers do this because it reduces the size of JavaScript files and makes sites load faster. I thought it might…

1

Request Animation Frame is your friend

If you are writing anything in JavaScript that animate then you are probably more than familiar with setInterval and setTimeout. These are both useful tools to create timing loops. However, when it comes to creating animations they are both pretty inefficient. I you use a timer period of less than 16.7ms to draw animations then…

0