I’m trying to implement the live tile to my app. This is the easier processes that I found online. But I get an Uri exception.
Here is the Code:
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{
InternetIsAvailable(); GetDataFeed(); BackTile();
}
public void BackTile()
{
StandardTileData backData = new StandardTileData
{
BackBackgroundImage = new Uri(@"https://dl.dropbox.com/u/27136243/AchivementHunters/Images/LatestTile.png", UriKind.Absolute),
};
ShellTile tile = ShellTile.ActiveTiles.First();
tile.Update(backData);
}
I want to update the back tile by just replacing the image. I see many tutorials that include servers, but I do not know anything about servers.
If I include the file in the soluction and use this:
BackBackgroundImage = new Uri(@"LatestTile.png", UriKind.Absolute),
it works fine.
how can i download the image from the URL and save it the specific path needed for the back image?
The documentation for StandardTileData states that “Secondary Tiles can be created only using local resources for images”
You will need to use a WebClient to download the image and save it to IsolatedStorage and then specify that isostore URI for the live tile to use.
Hope this helps!