How To: Compress Files In WinRT

Monday, December 31, 2012

Windows Store apps are aligned with PLM philosophy (Only active application will use device resources), and because of this most Windows Store apps needs to save their data locally until the next application execution. Windows Store apps can also use the Roaming folder to save files and settings that will be sync with the user Windows Live account, when saving settings or files to Roaming folder you need to make sure those files are not too big so Windows 8 will be able to sync the Roaming folder quickly. One option is to use Compression using: ...

How To: Keep Windows 8 Device Screen On While User Away

Thursday, December 27, 2012

While working with a customer on GPS system for Windows Store app, an important question raised: How we can prevent from Windows to turn off the screen due to user inactivity? Normally, a Windows 8 device will dim the display (and eventually turn it off) to save battery life when the user is away. Now for our system we need to keep the display on at all times, to do that call requestActive function to notify Windows that the app requires the display to remain on. Windows automatically deactivates your app's active display requests when...

Why Background Audio Isn’t Working?

Using HTML 5 we can play audio very easily in your Windows Store app, all you need to do is setting an audio element specify the object properties and that’s it. var audioElement= document.createElement('audio'); audioElement.setAttribute("id", "audtag"); audioElement.setAttribute("controls", "true"); audioElement.setAttribute("src", fileToPlay); audioElement.setAttribute("autoplay", "true"); audioElement.load(); What if you want to keep playing this audio even if the user has switch to another application? In order to to that you’ll need to use “Background Audio” ability. First you need to declare the “Background Tasks” in your app package manifest file. Then you need to add the “msAudioCategory” attribute to the audio element: audtag.setAttribute("msAudioCategory", "BackgroundCapableMedia"); Now if you...

Link To Windows Store App From Web Sites

Tuesday, December 25, 2012

While working on Windows Store app for a customer he asked me – how I can promote my app on that company web site, I said this is very simple all you need to do is adding a Windows Store protocol link and once the user will click on that link (Only if his using Windows 8), the app page will appear in Windows Store app. Windows Store protocol link So, how do I add a link to my Windows Store app? src or href => ms-windows-store following by the Package Family Name ...

Creating Windows Store App Using PhoneGap (Cordova)

Sunday, December 2, 2012

There is new PhoneGap release called – Cordova or PhoneGap 2.2.0 that supports WinRT features, in this post I’ll demonstrate some of the basics of PhoneGap for Windows Store apps. Download Demo Project What is PhoneGap? PhoneGap is a free and open source framework that allows you to create mobile apps using standardized web APIs for the platforms you care about. This means that using PhoneGap in your Windows Store app can also be used by other Mobile OS such as iOS, Android, Windows Phone 7, Blackberry and more....

Windows Store App – Resize Image (JavaScript)

Wednesday, October 31, 2012

In this post I’ll demonstrate how to change picture size using JavaScript while constraining the image proportions. Resize image functionality can be used in several scenarios in Windows Store app, for example: if your app allow the user to download images from the web you might want to resize the image to reduce space usage. Also if you whish to share this image using Roaming Storage you need to make sure the image size is small enough so the Roaming sync will not failed. The first steps for this demo is using FileOpenPicker to allow the user...

Windows 8 Metro – Code Behind

Tuesday, October 9, 2012

When I develop Windows 8 Metro App I usually use Windows Store app samples to see code examples features but sometimes you want more… For example I really want to know how “Mail” metro app works: How getting access to other email account, sending email and more. So in order to to that I had to gain access to “Mail” metro app… Let’s start the Hack: Problem: WindowsApps folder is blocked and by default you can’t open this folder. Solution: First open Windows Explorer and navigate into “C:\Program Files\”, locate “WindowsApps” folder....

Using Live SDK in Windows 8 – JavaScript

Sunday, September 30, 2012

Tweet In my previous post I talked about Using Live SDK in Windows 8 – C#, now it’s time to see how you can do the same things using JS. Live SDK provides a set of controls and APIs that enable applications to integrate single sign-on (SSO) with Microsoft accounts and access information from SkyDrive, Hotmail, and Windows Live Messenger on Windows Phone and Windows 8. Live SDK support several platforms such as: iOS, Android and of course Windows Phone and Windows 8 applications using C# and JS. In this demo I’ll show how to use Live...

Windows 8 RTM JavaScript – FlipView Control

Sunday, September 23, 2012

Tweet Windows 8 Metro App has couple of wonderful ways to display data, the more common way is Grid and Split Application Template. (You can read more about Windows 8 Project Templates - Windows 8 JavaScript Metro Application–Getting Started). But there are several other ways to display information, in this post I’ll demonstrate a FlipView control, that represents an items control that displays one item at a time, and which enables "flip" behavior for traversing its collection of items. The items on this FlipView control will come from my Blog Rss using SyndicationClient. We’ll create a FlipView control...

Windows 8 RTM JavaScript–Change Lock Screen Image

Tweet In the past couple of months I’ve worked a lot with Windows 8 JavaScript and C#, I’ve also wrote plenty of posts on that subject and there is much more stuff to talk about. In this post I’ll show two things: Using File Picker using JavaScript Change Windows 8 Lock Screen Image Programmatically Download Demo Project Step 1: Create Blank JavaScript Project In the app.onactivated function we add the following code to listen the Choose Picture button and calling the displayCurrentImg function. ...