So, I recently discovered www.DVLUP.com, if you haven't heard of them they reward Windows Phone developers for taking part in various challenges which are aimed at improving the quality of your apps. Completing challenges earns you XP and once you've earned enough XP you can spend it on cool rewards like new devices and marketing campaigns.
However when looking through the challenges I noticed that most of them require your app to have "All 3 Live Tile Sizes", with both of my apps being XNA and targeting the 7.1 OS this presented a problem since the wide tile size isn't natively available. After doing some research I found a couple of different ways to add the wide tile but they required a lot of fiddling like renaming your XAP files to .ZIP and unpacking it to add the image... or another option was to use MangoPollo which is a sort of wrapper for using WP8 functionality in WP7 apps, but again it had problems like forcing the app to restart when adding the tile.
So... in the end i just sort of hacked my own solution using bits of code from both of the previously mentioned solutions, both of my apps have since passed certification and have been accepted for the DVLUP challenges. The only drawback is that the app has to be launched once before the wide tile will be available to the user... anyway heres how I did it:
Both of my Apps are built with XNA4 and im using Visual Studio 2012 with the WP8 SDK targeting 7.1 OS, the wide tile I create is just a static image but you can create a flip tile or whatever without too much fuss.
First thing to do is create the image for your wide tile, the dimensions are 691 × 336 pixels, once you've got your image create a new folder in your game project (I called the folder 'TileImg') then simply add your image to the folder with the following properties:
build action: none
copy to output directory: copy if newer
Now that we have the image for our wide tile we need to alter the WMAppManifest file, add the following code below <Deployment> and above <App> in your Manifest file:
<AppExtra xmlns="" AppPlatformVersion="8.0">
<Extra Name="Tiles"/>
</AppExtra>
Then in Game.cs we will need to make several changes, firstly we set our target OS to WP 7.8 because that's the first version to allow wide tiles (7.10.8858 is the official version of WP 7.8). Then we check what version OS the user has, if its greater than the target version then 'IsTargetedVersion' will be true:
private static Version TargetedVersion = new Version(7, 10, 8858);
public static bool IsTargetedVersion { get { return Environment.OSVersion.Version >= TargetedVersion; } }
Now we write a new static method, if the user has WP 7.8 or better installed on their phone then a new wide tile is created using the image we added earlier... if the OS is less than 7.8 then it does nothing (you'll also need to add 'using Microsoft.Phone.Shell;' to your using statements:
public static void CreateWideTile()
{
if (IsTargetedVersion)
{
try
{
// Get the new FlipTileData type.
Type flipTileDataType = Type.GetType("Microsoft.Phone.Shell.FlipTileData, Microsoft.Phone");
// Get the ShellTile type so we can call the new version of "Update" that takes the new Tile templates.
Type shellTileType = Type.GetType("Microsoft.Phone.Shell.ShellTile, Microsoft.Phone");
// Loop through any existing Tiles that are pinned to Start.
foreach (var tileToUpdate in ShellTile.ActiveTiles)
{
// Get the constructor for the new FlipTileData class and assign it to our variable to hold the
Tile properties.
var UpdateTileData = flipTileDataType.GetConstructor(new Type[] { }).Invoke(null);
// Set the properties.
SetProperty(UpdateTileData, "WideBackgroundImage", new Uri("/TileImg/LargeTile.png",
UriKind.Relative));
// Invoke the new version of ShellTile.Update.
shellTileType.GetMethod("Update").Invoke(tileToUpdate, new Object[] { UpdateTileData });
break;
}
}
catch
{
}
}
}
private static void SetProperty(object instance, string name, object value)
{
var setMethod = instance.GetType().GetProperty(name).GetSetMethod();
setMethod.Invoke(instance, new object[] { value });
}
and finally we have to call the method we just created, we do this as soon as the app is launched:
protected override void OnActivated(object sender, System.EventArgs args)
{
if (SaveComponent.wideTileCreated == false)
{
SaveComponent.wideTileCreated = true;
CreateWideTile();
SaveComponent.SaveWideTile();
}
base.OnActivated(sender, args);
}
You'll notice that I have a flag called SaveComponent.wideTileCreated... once the app has checked the OS version and decided whether the wide tile should be created or not this flag is set to true and saved so that we never check again.
Well that's it... your users now have a nice new Wide Tile they can pin to their start screen and you can enter the DVLUP challenges :D
Comments
------
купить электронные сигареты в сабурове hqd оптом по 100 руб
to mmy 4 year old daghter andd said "You can hear the ocean if you put this to your ear."
She placed the shell to her ear and screamed. There was
a hermit crabb inside and it pinched her ear. She nevr wants to go back!
LoL I know this is completely off topic buut I had to tell
someone!
to mmy 4 year old daghter andd said "You can hear the ocean if you put this to your ear."
She placed the shell to her ear and screamed. There was
a hermit crabb inside and it pinched her ear. She nevr wants to go back!
LoL I know this is completely off topic buut I had to tell
someone!
to mmy 4 year old daghter andd said "You can hear the ocean if you put this to your ear."
She placed the shell to her ear and screamed. There was
a hermit crabb inside and it pinched her ear. She nevr wants to go back!
LoL I know this is completely off topic buut I had to tell
someone!
to mmy 4 year old daghter andd said "You can hear the ocean if you put this to your ear."
She placed the shell to her ear and screamed. There was
a hermit crabb inside and it pinched her ear. She nevr wants to go back!
LoL I know this is completely off topic buut I had to tell
someone!
previous to and you're simply extremely excellent.
I actually like what you've acquired here, certainly like what you are saying and the
way in which wherein you assert it. You make it enjoyable and you continue to care for to stay it wise.
I can not wait to learn much more from you. This is really a terrific web site.
Also visit my web blog: Dj Cooper - Schickeria (https://mp3-Rr.buzz/: https://mp3-rr.buzz/)
previous to and you're simply extremely excellent.
I actually like what you've acquired here, certainly like what you are saying and the
way in which wherein you assert it. You make it enjoyable and you continue to care for to stay it wise.
I can not wait to learn much more from you. This is really a terrific web site.
Also visit my web blog: Dj Cooper - Schickeria (https://mp3-Rr.buzz/: https://mp3-rr.buzz/)
this write-up very pressured me to try and do so! Your writing style has been surprised me.
Thanks, quite nice article.
Stop by my page; download: https://music-super-drive.club/getsong/earth-wheel-sky-band-reamision.html
this write-up very pressured me to try and do so! Your writing style has been surprised me.
Thanks, quite nice article.
Stop by my page; download: https://music-super-drive.club/getsong/earth-wheel-sky-band-reamision.html
the web the simplest thing to take note of. I say to you, I definitely
get annoyed at the same time as other people think about concerns that they plainly do not understand about.
You managed to hit the nail upon the top and defined out the entire thing with no need side effect , people can take a signal.
Will probably be back to get more. Thanks
Visit my website :: The Vogues - You Were On My Mind mp3 free
(mp3-stereo.xyz: https://mp3-stereo.xyz/mp3download/the-vogues-you-were-on-my-mind.html)
Look at my blog :: herve leger store locations (Issac: https://Www.Herveleger.best/)
I don't know why I can't join it. Is there anybody
having identical RSS issues? Anybody who knows the solution can you kindly respond?
Thanx!!
Here is my website ... the ikettes - fine: https://mp3-stereo.xyz/mp3download/the-ikettes-fine-fine-fine.html
УКП-66 цвет Белый (BLNDA000011) 1450руб.
УКП-66 цвет Молоко (BLNDA000012) 1500руб.
УКП-66 цвет Бежевый (BLNDA000017) 2000руб.
УКП-66 Алюминий, Титан, Антрацие (BLNDA000013, BLNDA000014, BLNDA000016) 2450руб.
place else may just anyone get that kind of information in such a perfect way of
writing? I've a presentation next week, and I'm on the search for such info.
place else may just anyone get that kind of information in such a perfect way of
writing? I've a presentation next week, and I'm on the search for such info.
place else may just anyone get that kind of information in such a perfect way of
writing? I've a presentation next week, and I'm on the search for such info.
place else may just anyone get that kind of information in such a perfect way of
writing? I've a presentation next week, and I'm on the search for such info.
I'd like to look more posts like this .