Visually Located

XAML and GIS

Use the [beta] Nokia Imaging SDK to crop and resize any image to create a lockscreen for your phone

When the new Nokia Imaging SDK was released I was really excited to start using it within one of my apps. Unlike most, I was not interested in the image filters that change how it looks. I was initially interested in using the resize and crop functionality it had. The day after it was released my wife had surgery, so I had a good amount of time to play with the SDK while I sat in the waiting room. What I wanted to accomplish that was to take a random photo from the users phone, crop and resize it to fit the device and set it as the lockscreen. I know that you can set any image to be the lockscreen and  if the image is too big, it will center the image. I needed to do it manually because I wanted to overlay information on the image. Getting the random image is pretty easy. We’ll just get one from the MediaLibrary. private Picture GetRandomImage() { var rand = new Random(DateTime.Now.Millisecond);   MediaLibrary library = ne... [More]

Keeping ads in the same location when the phone orientation changes to landscape

There has been a lot of information flying around about ads in apps these days. Microsoft recently updated PubCenter reporting to include fill rates and number of requests for ads. Dvlup recently partnered with AdDuplex to in its reward program. With all of this hype, I thought I would talk about a common problem with placing ads in apps. That issue is keeping ads in the same location when rotating the phone. Most apps are Portrait apps and display ads either at the top or bottom of the app. Displaying ads like this can be done with the following xaml <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Margin="12,17,0,28"> <TextBlock Text="STATIONARY AD" Style="{Stat... [More]

Creating a Behavior to change text to any case

In a previous post we created a behavior that would capitalize any text. This Behavior served a great purpose allowing you to capitalize the text for any TextBlock. What happens when you need to lower case the text? You could create a second Behavior for this, or we could modify the Behavior so that it allows for multiple options. The first option just seems silly when we can reuse code, but how can we specify which text case we want to apply? In the previous post I talked about some reasons why I like behaviors. One reason I did not list is that you can add Dependency Properties to them. Dependency Properties allow us to set properties in xaml or even better bind to other properties. You can add Dependency Properties to value converters, but that requires your value converter to inherit from DependencyObject. A Behavior already is a DependencyObject! We’ll start with the ToUpperBehavior from before. We’ll first change the name to ChangeCaseBehavior and we’ll create an enum that will... [More]

Responding to the Windows Phone Toolkit ListPicker closing

I’ve often wondered why the ListPicker in the Windows Phone Toolkit does not have an Opened or Closed event, especially since the SelectionChanged event fires only when the selection changes (as it should). So how are you suppose to know when the ListPicker opens or closes. After all, the ComboBox control has DropDownOpened and DropDownClosed. But then I thought, “Do you really need those? You can always use the IsDropDownOpened property.” The ListPicker does not have an Opened or Closed event and it does not have an IsDropDownOpened property. What the ListPicker does have, is the ListPickerMode property. // // Summary: // Gets or sets the ListPickerMode (ex: Normal/Expanded/Full). public ListPickerMode ListPickerMode { get; } This property is actually a DependencyProperty that we can bind to! Let’s say you need to change the visibility of another control when the ListPicker opens/closes. Or maybe you need to change some text based on the... [More]

Increasing in app purchases in your Windows Phone apps

There are a few ways to increase the rate of in app purchases. One of these ways is to show a message prompt to the user explaining that an in app purchase is available and what the user can get from it. In a previous post I explained how to use Telerik’s RateApplicationReminder to increase reviews of your app. The RateApplicationReminder is great because it just works. No, really. No need for you to determine if you should show a reminder to rate the app. It handles all of the logic and it navigates the user to rate your app. Another benefit of the RateApplicationReminder is that it is built on a framework for showing reminders. This framework can be extended to create your own reminders. The is a decent framework to build reminders on. It has one abstract method, GetDataFilePath. This is just a file name for the data that will be saved. It has two virtual methods that can be overridden, but the power is in the properties that it has // Summary: // Setting this property... [More]

Increasing app reviews with Telerik’s RateApplicationReminder

I have seen a few blog posts that explain how to prompt a user to rate your app after a few visits. These posts describe how to store a setting for how many times the app has been opened and whether the prompt has been shown. Some use a custom message box and some use the built in MessageBox. There have even been NuGet packages for this. I have to wonder, Why are you not using Telerik’s RateApplicationReminder? After all, if you do not have Telerik’s controls, you might be doing something wrong. Telerik’s RateApplicationReminder is a great tool to have. It allows users to ignore further reminders. It allows you to specify if the reminder should not be shown any more if the user taps the yes button. The text it displays is fully customizable, including the buttons. It also allows you to show the reminder based on number of times the app has opened or days from the last reminder. Oh, and it helps increase app reviews. The RateApplicationReminder is used in conjunction with the Applica... [More]

Why do you not have Telerik's Phone controls for yours Windows Phone dev?

If you are doing Windows Phone development and you do NOT have Telerik’s Windows Phone control toolkit you are doing something wrong. For the price of a Windows Phone Store developer account (when not discounted) you can join Nokia’s Premium Developer Program. I have been in the program for almost a year and I’ll be renewing my subscription. The Premium Developer Program gives you the following: A Windows Phone Dev Center  account (normally priced at $99, currently $19). You get a token for one year of membership to the dev center. This token can be used at any time. If you already have an account, you can use the token when the account expires. A free license for Telerik RadControls for Windows Phone. These controls and tools are priced at $99 per year (if you wish to receive updates). I have found this toolset to be very valuable. I have only used a few of the components, but it has well passed the $99 value. 12 months of access to Buddy.com. This cloud so... [More]

Create a consistent background for your Panorama Title

I was helping out a fellow Windows Phone developer with some app testing today and noticed that his app had a Panorama control with a background color that had a break between the last page and the first page. Here’s an example using the “Windows Phone Panorama App” project template.                This looks very weird and is distracting from the real content. This problem is very similar to the Changing the background color of your pivot headers post I did. You cannot just change the background within the TitleTemplate. The above images were created by modifying the TitleTemplate of the Panorama. <controls:Panorama.TitleTemplate> <DataTemplate> <Border Background="Blue"> <TextBlock Text="{Binding}" Width="800" FontSize="80" Margin="0,75,0,0"/> ... [More]

Remove ads with an in app purchase across your entire app

Today I read that the Windows Phone team had added some new samples. I was excited to take a look at the Free App With Paid Products sample to see if they had done anything different than I had in Disney Expedition. When looking at the sample I was even more excited to see this in MainPage.xaml.cs // Each in-app product is identified by a string that is unique for the owning app. This value // is an example identifier for a product that causes the display of ads to be removed from the app. private const string PRODUCTID = "AdRemovalProductIdentifier"; This little snippet was exactly what I was doing! Using the In App Purchase(IAP) model to remove ads from my app. I continued to look at the sample only to become disappointed that the sample did not really show how to remove ads with an In App Purchase. Okay, I wasn’t that disappointed. Removing an ad on a single page once the purchase is made is easy enough to do if you follow the sample. But the... [More]

Using the Geolocator API in your Phone 8 AND Phone 7 apps!

If you’ve done any work with location in Windows Phone you probably know that the a new location API was added at Windows Phone 8. If you want to upgrade your app to take advantage of functionality in Window Phone 8 you have a few options. Continue to use the original GeoCoordinateWatcher API from Windows Phone 7 in your Phone 8 and Phone 7 app Upgrade your app to Windows Phone 8 and use the new API in your Phone 8 app, while the Phone 7 app uses the original API. Upgrade your app to Windows Phone 8 and use the new API in your Phone 8 app AND your Phone 7 app! These options assume you want to continue to support Windows Phone 7. Please do not forget that there are a lot of people with a Phone 7. If you want to do options one or two you can stop reading now. If you want to do option three then you are in the right place. I’m not a big fan of supporting two different APIs in my apps and I don’t like using “out dated” APIs either. What we will need to do is create an A... [More]