Category: Windows Phone 8

NFC Tag Writer 2.0 Released: Pro upgrade enables long list of new features

NFC Tag Writer for Windows Phone can now read tags, save favorites, share tag definitions, publish and read published tags. All features beyond writing tags can be enabled via an in-app Pro upgrade.

NFC Tag Writer for Windows Phone has come a long way since its humble beginnings almost a year ago. Each release has steadily improved with support for additional tag types and has been localized into Chinese (simplified) and German.  It’s available as a free download here in all major markets around the world.

NFC Tag Writer (or more correctly Windows Phone) requires writable, NDEF formatted NFC tags. If the tag is not NDEF formatted, NFC Tag Writer will not recognize it. A great source for NFC tags is GoToTags.com.

The just released Version 2.0 is a huge leap forward with a beautiful UI, the ability to read tags and save favorites. You can also share tags with other users via email. Additionally you can ‘publish’ tags. Publishing is similar to writing a tag except it sends the tag information to another NFC device instead of to a physical tag. These features are enabled by purchasing the ‘PRO Upgrade’ found in the ‘additional features’ menu.

When you start version 2.0 is looks exactly like previous versions.

clip_image001

If you purchased the ‘removed ads’ feature in NFC Tag Writer prior to November 1, 2013 you received a free upgrade to Pro. Here is what the home page looks like after the Pro upgrade:

clip_image002

NFC Tag Writer Pro home page is using a nice looking panorama with ‘favorites’ (saved tag definitions) and ‘read tags’ to right of the ‘select tag type’ area. Below is a list of my favorites.

clip_image003

This is what the ‘read tags’ area looks like when no tags have been read. After reading a tag, you can save it to favorites or shake the phone to clear the list.

clip_image004

If you didn’t receive a free upgrade, you can purchase it via the ‘additional features’ page:

clip_image005

You can try the Pro features for $0.99. The option is ‘Upgrade to Pro! 500 tag writes’. For $0.99, you get a generous 500 tag writes. After you use up the 500 writes, the app reverts to free mode. You can buy additional writes at any time.

If you want the Pro features permanent, you can select the ‘Upgrade to Pro! Unlimited tag writes’ option for $2.49. After you’ve purchased this option, the app will always be in Pro mode – even if you uninstall and reinstall the app. Also if you move to a new phone, the Pro mode will follow.

If you just want to purchase the Pro version outright, you can here.

The Pro upgrade significantly expands the NFC capabilities of the app allowing you to not only write to tags, but ‘write’ the other NFC devices as well. This is known as publishing. The app can intelligently determine if it is writing to a device or tag and will write or publish as necessary. Try this:

Select ‘Contact’ from the home page.

Fill in some of the fields on the contact page.

Bring your phone in ‘NFC range’ (almost touching the NFC sensor) of another NFC device.

Note the NFC button on the app bar becomes active when in range of an NFC device or tag.

Now press the NFC button.

The target device will prompt the user to accept the Contact information:

clip_image006

After receiving the Contact information, you can save it to add it to your contact list:

clip_image007

Another Pro feature is the ability to read tags. That is, you can read the tag definitions of other tags and then store them as ‘favorites’. This is easy as starting the app, and then placing the phone near a tag or publishing to a device. Here is what the ‘read tags’ section of the home screen looks like after reading a ‘Contact’ tag:

clip_image008

Press and hold on a read tag to save that tag definition to the favorites list.

A really useful pro feature is the ability to share tag definitions via email. To do this, go to the favorites list, press and hold on a favorite and select ‘share’. Then select the email account you wish to use. The app will pre-populate an email for you. You’ll fill in the ‘To:’ field of the email and press send. The recipient can then read the tag definition into their NFC Tag Writer Pro app. If they have not installed the app, they will be prompt to install it from the Windows Phone Store. They will also have to select one of the Pro upgrades in order to import the tag definition.

clip_image009

clip_image010

Have a few tag definitions that you often use? Pin your often use tag definitions to the Start screen.

clip_image011

Overall, NFC Tag Writer is full featured and easy to use. It would be great if tags could make settings changes on the device without requiring the user to approve the change – this is an OS limitation that will hopefully addressed in a future update of Windows Phone.

Windows Phone: Don’t write to the InstalledLocation Folder

Crashes that occur not during development, but only after the application is installed by the Windows Phone store are among the most difficult to troubleshoot. This is one of those bugs.

Windows Phone 8 expanded the file storage APIs to include the StorageFile class support for parity with Windows 8. This class gives you access to ‘special folders’ including the folder where the application is installed. You can get to this folder as follows:

Windows.ApplicationModel.Package package = Windows.ApplicationModel.Package.Current;
Windows.Storage.StorageFolder installedLocation = package.InstalledLocation;

During development you can read and write from this folder, however after installing from the Windows Phone store, any write attempts to this folder will result in a file exception being thrown. Again, this bug will not occur if the app is sideloaded, only when the app is installed from the store. Most likely this is a security precaution to prevent any tampering with the installed files. 

This type of scenario, makes a strong argument for using the beta testing feature of Dev Center that allows you to test the store presentation and installation experience of your app to a specific list of users. By looking at the Dev Center generated crash logs (yes these are generated for beta apps as well as production), you can find the cause of the crash. 

Instead if using the InstalledLocation, you can read and write to the Local Folder. See here for more information.

Thanks,

Mike

Windows Phone: Don’t call LaunchForTest in Release

Calling ScheduledActionService.LaunchForTest is great for forcing a background task to run. This is important when you are developing and you need to debug your background agent. You may even want to call this in response to user action. You should not do this. The main reason is in Windows Phone 8 calling LaunchForTest, will throw an InvalidOperation exception. You may say that, ‘this works on my machine’, and you’d be right. This is because this exception is thrown only if the application is installed via the Windows Phone store. This does not occur if you sideload the app. Fortunately most of these scenarios are caught during certification testing. However, the Windows Phone certification team will report to you that that app crashes immediately after installation – without much more explanation. You will have a frustrating experience trying to reproduce this bug.

This type of scenario, makes a strong argument for using the beta testing feature of Dev Center that allows you to test the store presentation and installation experience of your app. In fact, by looking at the Dev Center generated crash logs, we found the cause of this crash. 

Frame

Image

Function

Offset

0

coredll.dll

xxx_RaiseException

19

1

mscoree3_7.dll

WatsonUnhandledManagedException

296

2

mscoree3_7.dll

Dbg_NotifyManagedException

93

3

mscoree3_7.dll

FirstPassException

1044

4

 

TransitionStub

0

5

 

Microsoft.Phone.Scheduler.SystemNotificationInterop.CheckHr

600

6

 

Microsoft.Phone.Scheduler.SystemNotificationInterop.LaunchNotification

128

7

 

Microsoft.Phone.Scheduler.ScheduledActionService.LaunchForTest

368

8

 

BritCo.App.Register_BackGroundAgent_ForLiveTile

240

9

 

BritCo.App..ctor

124

10

mscoree3_7.dll

IL_CallManaged

884

11

mscoree3_7.dll

BCL_System_Reflection_Invoke

1371

12

mscoree3_7.dll

BCL_System_Reflection_RTMI_Invoke

167

13

mscoree3_7.dll

BCL_System_Reflection_RTCI_Invoke

107

14

 

System.Reflection.RuntimeConstructorInfo.InternalInvoke

104

15

 

System.Reflection.RuntimeConstructorInfo.InternalInvoke

1240

16

 

System.Reflection.ConstructorInfo.Invoke

104

17

 

.__c__DisplayClass30._GetCreateObjectDelegate_b__2a

92

18

 

MS.Internal.TypeProxy.CreateInstance

100

19

 

MS.Internal.FrameworkCallbacks.CreateKnownObject

512

It turns our that the Windows Phone team added this exception to prevent the explicit launching of background agents in store deployed apps.  Why? Doing this can cause excessive battery drain and goes against the design of background agents.

Another common reason for wanting to call this API is that you may have code in the background agent you want explicitly triggered by user action. See Shawn Wildermuth’s blog post Confusion Around WP7.1 Periodic Agents for a discussion of this issue and how to code for it.

Thanks,

Mike

WP8: Lock Screen Notifications Sample

 

lock1

Having your app update the lock screen is one of the cool features of Windows Phone 8. It’s pretty easy to add this functionality to your app. See the documentation here for the details. I wrote sample code which you can download here.

The following are a couple of interesting things I found when putting together this sample:

To invoke the emulator’s lock screen press F12. Then press any button. The emulator will then be locked.

 

 

 

 

 

You can also invoke the lock screen via the new and cool ‘Simulation Dashboard’. Click on the ‘Locked’ radio button to lock the emulator. (see below)

image

The docs say the following ‘The lock screen’s app icon, count, and text are pulled directly from the app’s primary Tile.’ I found that the lock screen does not use the app icon from your primary tile. Instead it uses the a separate 38×38 image in your app, specifically for the lock screen, specified in the manifest file.

 

 

 

 

 

 

 

 

 

To have the lock screen update, you need to go to the device settings and enable it. The sample includes a button which will take you directly to the settings page for the lock screen. (Using the new WP8 API LaunchUriAsync.)

settings

In the lock screen settings, select your app’s lock screen icon in the ‘Choose apps to show quick status’ control and specify your app in the ‘Chose app to show detailed status’ drop down. Unless you do this you will not see the lock screen update. (see to the left)

 

 

 

 

 

 

 

The lock screen uses the .BackContent and .Count properties of the main tile StandardTileData to display status and count. To update the main tile:

void UpdateTile(DateTime time)
{
    ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
    var data = new StandardTileData();
    data.Count = time.Second;
    data.BackContent = string.Format(time.Second.ToString() + " seconds have elapsed.");
    tile.Update(data);
}

Mike