1
votes

How do you make live tiles for Windows Phone 8.1 Apps?

It is the best kept secret on the internet!

I am trying to make a tile, which whenever the app is suspended, it updates the live tile with some text.

I have read/watched roughly a dozen "tutorials" on live tiles, and none of them are compatible with Windows Phone 8.1.

At a high level, what steps do I need to follow to accomplish this?

Note: I am well aware that Tile Templates exist...but the secret is what to do with them. All of the code out there not only does not compile for Windows Phone 8.1, but on top of that, the code assumes that people already know how to make the live tiles.

1
If you ask for a link to a tutorial, your question immediately becomes off topic according to the help center guidelines.Ken White
I wasn't asking for one. I was asking what to do at a high level. That last line was a joke, but I'll remove itEvorlor
What does the bold text in your question say?Ken White
That was the joke, which I removedEvorlor
Probably not a good idea to make a joke that makes your question off-topic, then. :-)Ken White

1 Answers

2
votes

Below is how to create live tile in windows phone 8.1

 //Generates an image tile
 StringBuilder sb = new StringBuilder("<tile>");
        sb.Append("<visual version=\"2\">");
        sb.Append("<binding template=\"TileSquare150x150Image\" fallback=\"TileSquarePeekImage01\">");
        sb.Append("<image id=\"1\" src=\"ms-appx:///Assets/Logo.scale-141.png\"/>");
        sb.Append("</binding>");
        sb.Append("</visual>");
        sb.Append("</tile>");
        XmlDocument xmldoc = new XmlDocument();
        xmldoc.LoadXml(sb.ToString());

        TileNotification tileNotification = new TileNotification(xmldoc);

        TileUpdater tileUpdator = TileUpdateManager.CreateTileUpdaterForApplication();

        tileUpdator.Update(tileNotification);