1

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.

Evorlor
  • 7,263
  • 17
  • 70
  • 141
  • 1
    If you ask for a link to a tutorial, your question immediately becomes off topic according to the [help/on-topic] guidelines. – Ken White Jul 26 '14 at 21:21
  • 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 it – Evorlor Jul 26 '14 at 21:21
  • What does the **bold text** in your question say? – Ken White Jul 26 '14 at 21:22
  • That was the joke, which I removed – Evorlor Jul 26 '14 at 21:22
  • 2
    Probably not a good idea to make a joke that makes your question off-topic, then. :-) – Ken White Jul 26 '14 at 21:27
  • Hopefully it didn't cost me an answer! – Evorlor Jul 26 '14 at 21:28
  • To reveal the secret for live tile watch this video on channel 9. by following this video I was able to generate live tiles in my app. I will post how I am generation live tile in answer http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1/14 – Muhammad Saifullah Jul 26 '14 at 22:00
  • I was able to generate all sizes of tiles in my app if you need any sample I will post that in my answer – Muhammad Saifullah Jul 26 '14 at 22:08
  • @MuhammadSaifullah thank you, but i had already watched that video. It is intended for people who already know how to make live tiles. at least he skips 80% of the process – Evorlor Jul 26 '14 at 22:11

1 Answers1

2

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);
Muhammad Saifullah
  • 4,292
  • 1
  • 29
  • 59
  • anywhere in your app you want :) in my case I have created util class TileGenerator which generate differnet types of tiles. in your case you can use above code in onsuspending method – Muhammad Saifullah Jul 26 '14 at 22:33
  • Hmmm...do i have to append a string or can I just read it straight from the .xml? – Evorlor Jul 26 '14 at 22:35