What to do when your Surface devices don’t sleep

Starting Windows 8 Microsoft introduced a sleep state called Connected Standby (CS). Think of this sleep as your smartphone when its screen is off, the device is still running, connected to the mobile networks, capable of receiving notifications and wakeup calls etc.

In early days this feature was supported only on WOA… you know it as Windows RT.. yes something many wouldn’t care to remember.. Windows x86 / x64 SKU officially support CS starting with Haswell processor. Haswell introduced a sleep state S0. This keeps part of the device sufficiently awake to receive notifications etc while in low power state.

It never truly worked for me. I had one of the first engineering models from Intel delivered in June 2013 and the device refused to wake up properly. I tried just about everything and while things have gotten better, for people like myself, battery life is more important than notification (which I already get on my phones). A few times SP4 in CS has had around 50 – 90% drain in few hours ( 2 – 4).

The solution is easy – unless CS is something you rather than instead of longer battery life, you should force system to hibernate rather than go into connected standby.

Switching to hibernate:

  • press Start Menu and type power options
  • open Power Options from Control Panel.
  • tweak Choose what power buttons do option – enable hibernation and set desired settings
  • tweak Change when the computer sleeps – I prefer a short sleep
  • next click Change advanced power settings
  • Navigate to Sleep > Hibernate After > Ensure duration is correct.
  • Click  Ok and close all power options.

Screenshorts

Screenshot (26)

Screenshot (27)

Screenshot (28)

Screenshot (29)

Windows Universal or Universal Windows – Part 2 #uwp #wpdev

Great minds think alike… its unlikely that you read the Part 1 its a bit TL;DR; to be frank.

Assuming you have a Windows Universal project or are starting there and are also interested in targeting Windows 10. Here is me creating a blank Windows 8.1 Universal project using Blank template.

WindowsUniversal1WindowsUniversal2

This is what Windows Universal Project looks like… You have the Windows head (that’s what they called it), the Windows Phone head and the Shared head.

Whatever is in the shared head is copied to Windows & WindowsPhone head as the first step of compiling the project. Its a neater version of sharing a file by adding a file reference (Add existing file > Add link).

All shared stuff goes in Shared head. Anything specific to either head goes in Windows or WindowsPhone heads. Shared head usually includes all the Models, ViewModels, Services, Helpers, Behaviours and whatever stuff you don’t what to put in PCL (not everyone uses PCLs)

Lets add Windows 10 project to the solution

Screenshot (22) WindowsUniversal3

We need a few minor adjustments before Windows 10 project becomes a part of Windows Universal and thinks the same way. Lets delete the App.xaml and App.xaml.cs to start with.

Next right click unload Windows head and then right click and choose Edit

Scroll all the way down until you see something like this

WindowsUniversal4

Copy this line.

Now unload and edit the Windows 10 project. Scroll to the bottom to the exact same spot and paste the line without any changes.

Save and close. Reload both Windows head and Windows 10 project and that’s it. The Windows 10 universal project is now a part of Windows Universal project. The circle is complete.

All items in shared head are now a part of Windows 10 head and all you need to do is add Windows 10 head specific bits like you have for Windows 8.1 and Windows Phone 8.1

You build for store like you build before.

You have appx / appxbundle for

Windows (x86 / x64 / ARM)

WindowsPhone (ARM)

Windows 10 (x86 / x64 / ARM) compiled to Native

 

Windows Universal or Universal Windows – Part 1 #uwp #wpdev

Did I just say Windows Universal ? Sure that came and went with Windows 8.1.. If I am still talking about it… I mostly likely do not have anything useful to add. I am going to any ways.. Haters are gonna hate.

If you are contemplating a brand new Windows 10 app targeting Windows 10 device families like Windows.Desktop / Windows.Mobile etc you most likely have a Windows 8.1 or Windows Phone 8.1 app or both (or Windows Universal). If you don’t then you like many have been attracted by the idea of massive growth in Windows 10 install base since launch in August.

Yes Windows 10 will make it and your app will finally have a big big market however that day isn’t today. Windows Phone 8.1 still constitutes 90% of Windows on Mobile devices. Windows 10 on desktops is same as Windows 8.1 out there today. Yes a big chunk of them will eventually convert – maybe but they still haven’t.

App usage is important and growth is important and for that reason if nothing else you shouldn’t leave existing Windows 8.1 (phone included) out of this equation. Let me give you a personal example.

We (me working along with my employer) released our official app on Windows 10 Mobile to coincide with launch of Lumia 950 and Lumia 950XL on the 2nd of December. We started getting installs and reviews from around the world. I had left out Windows Phone 8.1 version because of a bug I couldn’t put my hand on. After a few days of messing around, we released Windows Phone 8.1 app on 15th December (17:00 hours). By end of day of 17th Windows Phone 8.1 accounted for 62.2% of the users and exceeded 70% on 18th.

Less than 3 days and 70% user base – don’t make them wait. Serve one serve them all.

Our app available on Windows Phone 8.1 and Windows 10 devices and can be downloaded Windows Store

All said and done I am hoping to follow my own advice about Window 8.1 users soon.

 

Windows Platform New App Versioning style #wpdev #uwp

Windows Store unification started a few days before the release of Windows 10. On 29th, I pushed an update out while waiting for Windows 10 upgrade – I had reserved by copy of Windows 10. While waiting, I continued with updates and having lost all patience, forced an update on the 30th.

I continued development using newly install VS 2015 and wanted to make an install I suddenly got this error “The version attribute of the Identity element must have a higher version number than ‘2015.729.2036.5893’

WTF ?? I tweeted angrily asking @VisualStudio what the heck was being added to StoreAssociation file..

Later that day, I reset my device and went back to VS 2013..nope it wouldn’t have any of it.. would still give me the same error as VS 2015. Who knows what the heck was happening.. I had little time and I haven’t heard from anyone so I continued with whatever it suggested.

On 1st August I encountered yet another problem with store.. this time.. “MakeAppx failed to open the package”. This time I asked on of the Microsofties to pull a few strings. They fixed that issue (AnyCPU was being read as ARM and ARM package wasn’t found so it failed) and in the thank you note, I mentioned that store was forcing timestamp based version. Non of those on the list commented so I assumed it was a cockup on my app since SL based 1Shot has no such issues.

store version error

Fast forward yesterday. I pushed 1.1.0.1 on a new beta on a newly created store account. Today I wanted to update it and it fails with a similar message. I find support pages and chat with one of the support people. What am I told.. yes Timestamp based versioning is the new way in unified store. Sorry it wasn’t communicated and don’t know why it doesn’t hit SL apps but its all fine.

So it any of you lot develop with WinRT (many do I presume, you will face this issue soon).. just don’t format your machine like I did:)

Why can’t they just inform the developers ?? they find enough time to write boat loads of blogs about various things..

Coding4Fun Toolkit 2.1.1 released #wpdev #uwp

Coding4Fun toolkit 2.1.1 is now available for download.

Changes include

  • WinRT version of David Anson’s PlaceImage control
  • ToastPrompt control for Windows 8.1
  • Added SL 8 binaries though no new functionality is added

SL lib was added purely to just provide backward compat and to stop nuget manager from updating to latest version and removing support for it. Annoyed myself a few times already!

Happy coding

Edit: @Scottisafool the creator of SuperImage pointed out that it was built on top of PlaceImage and for that reason I have removed PlaceImage for now.

Custom Uri Scheme List – Old Nokia Dev cached copy #wpdev

Introduction

Apps that register to handle (are associated with) a particular URI scheme can be launched from email, NFC tags, and other apps using the URI. Apps can additionally use parameters specified with their URI to open with additional context – for example a calendar app might open in the view for a specific month, a map app might open at a specific location, or a music app might open with song for a particular artist.

At time of writing the URI-to-app associations for the inbuilt apps and operating system have been documented. However there is no central registry for finding out URI associations and parameters for marketplace applications.

This article is intended as a place where developers can both find out URI schemes for other apps, and also link to the documentation for their own app schema.

Marketplace app schemes

Developer-supported schemes

This section is for URI schemes that developers have documented and committed to maintain. Add schemes with official documentation (and your own apps!)

URI App name Description/Link to documentation
AroundMe AroundMe Launches app to search for pictures at a specific locations
melodia melodia Alerts for Windows Phone 8.1, each app will need one.
super8 Super 8 More than 50 tools in one, and start menu is back.
cooltiles Cool Tiles More than 40 tools in one, and you can design tiles for tools.
metrotube Metrotube Launch Metrotube’s YouTube player from within your app
pocketbrain pocketBRAIN A beautiful and light-weight note-taking app.App launch: pocketbrain:
Create a new note: pocketbrain:newNote?title=…&text=…
Create a note with image attachement: pocketbrain:newNote?title={…}&text={…}&mediaLibIndex={index}
noteplus Note+ Launches MainPage. A simple yet delightful note-taking app.
stopwatchplus Stopwatch+ Launches MainPage. A simple yet delightful time-keeping app.
counterplus Counter+ Launches MainPage. A simple yet delightful tally counter app.
Foundbite Foundbite Foundbite URI Scheme
GeoPhoto GeoPhoto Launch to show photos on map
photoinfo Photo-Info A beautiful photo-hub extension app for image information
App launch: photoinfo:
Show image information: photoinfo:show?mediaLibIndex={index}
instagraph Instagraph Instagraph (Instagram™ sharing app) custom URI schema
wpcentral WPCentral Windows Phone Central direct URI schema
metrotour MetroTour MetroTour URI Protocol
spotify Spotify Linking to Spotify
mehdoh Mehdoh Mehdoh URI schema
flitsnav Flitsservice FlitsNav Launches Flitsservice FlitsNav (no parameters available yet).
pictureslab Pictures Lab Pictures Lab URI schema
gmaps gMaps gMaps URI schema
Geosense Geosense Geo URI schema
ts-keyring Keyring Keyring URI schema – your private password safe on your phone, doesn’t need a data connection so no one can spoof – now with NFC.
me-zeitungen Newspapers Newspapers URI schema – read newspapers around the world
sixtag 6tag How to upload a picture on instagram from your app using 6tag
reedability Reedability Reedability URI schema/protocol – unofficial Readability.com client
My 500px My 500px My 500px Free My 500px URI schema View/search/upload photos to 500px
tiwahu-lma Live Music Access Live Music Access direct URI schema/protocol – Browse, search, and stream 100K+ concert recordings from the Live Music Archive (etree) collection.
pcast P | Cast P | Cast direct URI schema/protocol – Normal or Car Mode, start or play immediately a recent or random track. Also supports the common wp-podcast URI scheme for play/pause/skip next/skip previous control, available on NuGet and GitHub.
mix-play-share Mix Play & Share simple launch with no parameters of Mix Play & Share app
car-starter Car Starter Parameterless Launch URI for Windows Phone Dashboard App Car Starter
domainchecker Domain Checker Domain Checker URI schema Note: Available from version 2.0.0
podcastlounge Podcast Lounge Podcast Lounge URI Schema Note: Available from version 1.9.7 onwards
carstand CarStand Launch with parameter “carstand:?mainpage” to open startup page.
tasks Tasks Tasks Uri Schema Note: Available from version 1.81 onwards.
nfctoolkit NFC Toolkit with version 0.9.8 app allows other developers to add their app to the launch app list in profiles – version 0.9.8.1 introduces nfctoolkit:writeapp to enable writing on NFC tags from your app/ plain launch: nfctoolkit:home – documentation: http://msicc.net/?p=3842
ProShot ProShot Documentation
BringCast BringCast Supports the common wp-podcast URI scheme for play/pause/skip next/skip previous control, available on NuGet and GitHub.
weathertogo Weather To-Go Launch: “weathertogo:”; Select layout: “weathertogo:weather?layout=[0-1]”; Settings: “weathertogo:settings”
settingstogo Settings To-Go Launch: “settingstogo:”; Open setting: “settingstogo:open?setting[1-9]”; Open flashlight: “settingstogo:open?setting=100”
I’m Here I’m Here Launch app “imhere:”, launch and share options “imhere://share/text”, “imhere://share/email”, “imhere://share/social”, “imhere://share/whatsapp”
enlesssoft-battery Battery Documentation
enlesssoft-flashlight Flashlight Documentation
enlesssoft-birthdays Birthdays Documentation
enlesssoft-history History Documentation
enlesssoft-holidays Holidays Documentation
conference-calleague Conference Calleague Documentation Parse meeting invites for conference call dial-in information and initiate dialing
GPS monitor GPS monitor Documentation Show webcam retrieved through webcams-travel. Through the schema uri, you can open the apps, and see webcam nearby a point.
mxm musiXmatch lyrics player Documentation
Cineworld cineworld cinemas app The following Uri schemas are supported.
cineworld:film?12345
cineworld:cinema?22
cineworld?search?xmen
the film requires use of cineword EDI

Community Schemes

This section is for URI schemes that are used by more then one app, usually apps that share some similar functionality. These schemes should be well documented.

URI Apps Description/Link to documentation
Pocket Squirrel Poki Pouch OwlReader Pock8 Common uri scheme to use for adding links to Pocket. Learn more: http://metronuggets.com/2013/12/15/sharing-links-to-pocket-formerly-read-it-later/Package: https://github.com/ScottIsAFool/PocketWP
wp-podcast BringCastP Cast The common wp-podcast URI scheme for play/pause/skip next/skip previous control, available on NuGet and GitHub.

Unofficial schemes

This page is for schemes where the support of the developer has not been verified (for example, a scheme found on the Internet). Note that these are used at your own risk, and may change without notice.

Nokia URI Schemes

URI App name Description/Link to documentation
nokia-music Nokia MixRadio Launch the Nokia MixRadio app. Parameters can be used to specify artists, genre etc to be searched on open. See Nokia MixRadio app-to-app protocol for Windows Phone 8 and official documentation for the API in the Nokia Lumia Developer Library
directions HERE Maps For routing use cases. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
explore-maps HERE Maps For exploring map and map services. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
guidance-drive HERE Drive For drive navigation. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
guidance-walk HERE Drive For walk navigation. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
places HERE Maps For showing places. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
public-transit HERE Transit For public transit related use cases. See HERE Launchers API documentation in the Nokia Lumia Developer Library.
nokia-xpress: Nokia Xpress (min v1.5.1.773) This URI allows 3rd party apps to start the Nokia Xpress browser. If the browser is started for the first time, the user is presented with an End User License Agreement (EULA) which the user must accept, after which the app loads its home page.
nokia-xpress:Pageload?Url= Nokia Xpress (min v1.5.1.773) The “page load” protocol implemented on top of the Nokia Xpress URI allows 3rd party applications to start the browser in order to load the specified URL. The URL of the page to be loaded may include the http:// specifier or omit it. You can also specify https:// if needed.If the provided URL does not appear to be valid (contains invalid characters, out of IP range(sorry, no IPV6 yet), no domain suffix, etc.), Nokia Xpress will perform a search based on user settings.

Official “General” URI schemes

This is for URI schemes that are not necessarily reserved for a particular app, but which are known to be launched by them.

URI App name Description/Link to documentation
ms-drive-to:? HERE Drive + Beta How to request driving or walking directions for Windows Phone 8
ms-walk-to:? HERE Maps How to request driving or walking directions for Windows Phone 8

Reserved URL name schemes

Reserved URL names schemes for the in-built apps and operating system are documented in Reserved file and URI associations for Windows Phone 8#Reserved URI scheme names and URI schemes for launching built-in apps for Windows Phone 8 on the Dev Center. Note that when a reserved URI is launched only the built-in app or handler will launch. Any attempt to register an app with one of the following URI scheme names is ignored.

The information is reproduced below for completeness (but has been “collapsed”). We recommend you check the above links.

Reserved for built-in apps

URI Description
bing
callto
dtmf
http:[URL] Launches web browser and navigates to specified URL
https:[URL] Launches web browser and navigates to specified URL
mailto:[email address] – Launches the email app and creates a new message with the specified

Coding4Fun toolkit 2.1.0 released #WinRT #wpdev #windev

c4f

This is the 3rd iteration of toolkit updates I am pushing out. Like the other 2, this one builds on Windows Runtime WinRT app support for Windows Platform development.

This release also brings WinRT support close to what Silverlight version supported and finally drops support for Silverlight apps. The SL version is still available on nuget but it is unlikely to receive any updates.

SuperSlider (ColorSlider + ColorPicker) has a gotcha and its gonna need some clever work. Internally it uses code that monitors movement for updates and movements to prevent scrolling when the control is contained within Pivot, Hub or FlipView containers however lack of Touch class has forced me to use PointerPressed / PointerMoved and PointerReleased for these and in my tests, Pivot does not bubble those events and control doesn’t work correctly. Keep this in mind

Sample apps available in stores will be updated to reflect the changes

258x67_WP_Store_cyan WindowsStore

Control Windows Phone 8.1 Windows 8.1
RoundButton
ToggleButton
OpacityButton
Tile
ImageTile
ChatBubble
ChatBubbleTextBox
ColorHexPicker
ColorPicker
ColorSlider
AboutPrompt ×
InputPrompt ×
MessagePrompt ×
ToastPrompt ×
PasswordInputPrompt ×
MetroFlow
Overlay
SuperSlider
SuperImage

Happy coding