How to create a WP8 wide tile in WP7 XNA...

Created on 31 October 2013 Written by Graham Smith

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   

 
0 #607 what is mobile slot 2018-11-15 20:35
I got this web page from my friend who shared with me regarding this site and now this time I am
visiting this site and reading very informative posts at this place.
Quote
 
 
0 #606 lpe88 apk 2018-11-15 20:29
Hello there, You've done a great job. I will definitely digg it and personally suggest to my friends.

I'm sure they'll be benefited from this site.
Quote
 
 
0 #605 ex back 2018-11-15 18:30
Increasing the traffic in the site assures that to combine sales on a site.

My name was replaced with someone else's name and links were removed.
Needs so that people claiming that a number of
does perform.
Quote
 
 
0 #604 playboy888 2018-11-15 12:34
Excellent, what a weblog it is! This web site gives helpful data to
us, keep it up.
Quote
 
 
0 #603 playboy888 2018-11-15 12:33
Excellent, what a weblog it is! This web site gives helpful data to
us, keep it up.
Quote
 
 
0 #602 ace333 slot 2018-11-15 06:25
bookmarked!!, I like your website!
Quote
 
 
0 #601 3win8 casino 2018-11-15 02:57
Discover of course speed up this process with
various legitimate SEO methods. Considering all from the variables, high page
rank is definitely a long-term indicator
of emergency.
Quote
 
 
0 #600 rollex11 2018-11-14 04:48
I mean the title within the HTML code in the house page or possibly called the
index. Additionally help to be sure that a body's running an actual business.
A person group them by client or by project.
Quote
 
 
0 #599 rollex11 2018-11-14 04:48
I mean the title within the HTML code in the house page or possibly called the
index. Additionally help to be sure that a body's running an actual business.
A person group them by client or by project.
Quote
 
 
0 #598 joker123 download 2018-11-13 10:52
Hi there to every , since I am in fact keen of reading this
web site's post to be updated on a regular basis.

It carries fastidious stuff.
Quote
 
 
0 #597 BestRory 2018-11-13 07:06
I have noticed you don't monetize your page, don't waste your
traffic, you can earn additional cash every month.
You can use the best adsense alternative for any type of website (they approve all websites),
for more info simply search in gooogle: boorfe's tips monetize
your website
Quote
 
 
0 #596 casino de montreal 2018-11-12 20:22
Online trading takes more preparation and decision making because an individual
might be virtually for your own. Look back over the course of the
relationship, seeing if experience changed, minimizing those quality.
Quote
 
 
0 #595 women watch brands 2018-11-12 19:38
Hi my friend! I wish to say that this article
is amazing, great written and include approximately all vital infos.
I would like to peer more posts like this .
Quote
 
 
0 #594 scr888 download 2018-11-12 18:10
Wow, incredible blog layout! How long have you been blogging for?
you make running a blog look easy. The entire look of your web site is wonderful, as smartly as the content
material!
Quote
 
 
0 #593 s777 2018-11-12 13:04
The result of which they didn't do a pretty good job
simply because they started to feel cleared. Nuts are an anytime snack,
they can be had roasted, raw or added to salads. In plain english a quality website is first and foremost.
Quote
 
 
0 #592 s777 2018-11-12 13:03
The result of which they didn't do a pretty good job
simply because they started to feel cleared. Nuts are an anytime snack,
they can be had roasted, raw or added to salads. In plain english a quality website is first and foremost.
Quote
 
 
0 #591 online casino usa 2018-11-12 07:35
That is just the manner it might be. This is where website owners fail May.
The reason fish oil may be so great for a balanced heart is which is rich in omega3 fatty acids.
Quote
 
 
0 #590 play8oy download ios 2018-11-12 04:55
If you read it the first time feel liberated to skip over it this season! That's the exactly what
Strategic Online techniques do for a niche site. First, analyze the website
your link will be put on.
Quote
 
 
0 #589 play8oy download ios 2018-11-12 04:55
If you read it the first time feel liberated to skip over it this season! That's the exactly what
Strategic Online techniques do for a niche site. First, analyze the website
your link will be put on.
Quote
 
 
0 #588 scr888 2018-11-11 21:57
Hello! I could have sworn I've been to this site before but after browsing through some of
the post I realized it's new to me. Anyhow, I'm definitely happy
I found it and I'll be bookmarking and checking back frequently!
Quote
 
 
0 #587 scr888 2018-11-11 21:56
Hello! I could have sworn I've been to this site before but after browsing through some of
the post I realized it's new to me. Anyhow, I'm definitely happy
I found it and I'll be bookmarking and checking back frequently!
Quote
 
 
0 #586 seo michael 2018-11-11 16:10
28- Steer clear from being too comfortable with your income or situation. By spending few bucks you'll be able
to choose a new look to your eshop. You can even link to your
competitor's thread.
Quote
 
 
0 #585 seo michael 2018-11-11 16:09
28- Steer clear from being too comfortable with your income or situation. By spending few bucks you'll be able
to choose a new look to your eshop. You can even link to your
competitor's thread.
Quote
 
 
0 #584 scr888 download 2018-11-11 13:24
Hi there, just became alert to your blog through Google, and found that it's really
informative. I am gonna watch out for brussels. I will be
grateful if you continue this in future. A lot of people will be benefited from your writing.

Cheers!
Quote
 
 
0 #583 sports betting game 2018-11-11 02:11
Even if there possibly be a few IP per day, but you could also dig the actual earnings type.
Not every one is worthwhile you will find many blog. An individual are can ask a question within your title, great.
Quote
 
 
0 #582 ntc33 download 2018-11-11 01:33
Terrific article! This is the kind of information that should be shared across the internet.
Disgrace on the seek engines for not positioning
this put up higher! Come on over and discuss with my web site .
Thanks =)
Quote
 
 
0 #581 mega copper 88839 2018-11-10 17:34
Firstly, you might have to admit this along with me. The phrase will appear as though they just flow at a mind and into a lot of
processor. You will find my ctr to be on time frame side.
Quote
 
 
0 #580 ocean king fish game 2018-11-10 12:09
It's hard to come by educated people for this topic, however, you sound like you know what you're talking about!
Thanks
Quote
 
 
0 #579 mobile slot.com 2018-11-10 10:21
If so, see for can use technology meet up with with the client remotely,
saving your unbillable time. You certainly don't want
seem to be stiff and formal. And I really recommend in order to definitely try it out.
Quote
 
 
0 #578 scr888 2018-11-07 06:53
Keep your eye upon the ball since the wheel is spinning and
Walla! Information and facts that will clearly help any person.
So look out the configuration of games and ensure your system have all required businesses.
Quote
 
 
0 #577 slot mobile abuja 2018-11-07 00:07
Howdy! This is kind of off topic but I need some advice from an established blog.
Is it hard to set up your own blog? I'm not very techincal but I
can figure things out pretty fast. I'm thinking about making my own but I'm not sure where to begin. Do you have
any tips or suggestions? Thanks
Quote
 
 
0 #576 3w8 2018-11-06 20:49
Even if there should be only a few IP per day, an individual could also dig the actual earnings method.
But we can start having a small website page.

Try it yourself; make a subject that interests you.
Quote
 
 
0 #575 live22 download 2018-11-06 20:04
Headline tags show the search engines the importance of these written text.
Can't stand spam along with a passion, ideal approach make sure your comments add towards conversation.
Quote
 
 
0 #574 live22 download 2018-11-06 20:03
Headline tags show the search engines the importance of these written text.
Can't stand spam along with a passion, ideal approach make sure your comments add towards conversation.
Quote
 
 
0 #573 live poker london 2018-11-06 19:07
Pretty! This was a really wonderful post. Thanks for
supplying this info.
Quote
 
 
0 #572 joker123 casino 2018-11-06 18:35
Unquestionably consider that that you said. Your favorite justification appeared
to be on the internet the easiest thing to have in mind of.

I say to you, I certainly get annoyed at the same time as
other people think about worries that they just do not understand about.
You managed to hit the nail upon the top as neatly as defined out the
entire thing without having side-effects , other folks can take a signal.
Will probably be again to get more. Thanks
Quote
 
 
0 #571 online casino nevada 2018-11-06 15:45
Hmm it appears like your blog ate my first comment (it was extremely long) so I
guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog.
I too am an aspiring blog blogger but I'm still new to everything.
Do you have any tips for inexperienced blog writers?
I'd genuinely appreciate it.
Quote
 
 
0 #570 rollex 11 2018-11-06 08:44
Your way of explaining all in this article is in fact pleasant,
all can simply know it, Thanks a lot.
Quote
 
 
0 #569 l22 2018-11-06 00:43
Choose a column into the far right where banner or text ads can air.
Back in the days, may find only limited font
styles that you'll be able to choose because of.
Quote
 
 
0 #568 l22 2018-11-06 00:43
Choose a column into the far right where banner or text ads can air.
Back in the days, may find only limited font
styles that you'll be able to choose because of.
Quote
 
 
0 #567 918kiss update 2018-11-06 00:04
There is no better strategy grow your online business than through Internet
article writing. Or rename your 'download' folder as 'download-cheap-web-templates'.
So the chances of climbing up the rankings to the very top
does seem to be very low.
Quote
 

Add comment


Security code
Refresh

Facebook YouTube

Latest on Twitter

SuperSmithBros @sophiablue18 You know you have the power of words and can ask her to move it?
SuperSmithBros @NetflixUK On the Samsung TV app you don't display what language a movie is. Please change it so it displays the la… https://t.co/YtncBZlrar
SuperSmithBros RT @MarcusJLGardner: Graduated with @JamieKKing, @SuperSmithBros and @Polygonical from @MoonshineGS today! Looking forward to our many year…
SuperSmithBros RT @MarcusJLGardner: About 1.5 years ago I applied to my first games job as a QA Tester. The QA lead asked me where I saw myself in 7 years…
SuperSmithBros RT @MoonshineGS: Thanks to everyone who came to see our pitch at Digital Catapult in London! #IndieGameDev #IndieDev #gamedev https://t.co/