![]() This code is there to switch it off if a connection isn’t made in time. You’ll also note some code that uses a dispatcher timer that fires once a second once a device has come in range. If (!NFCSupportedOnDevice) throw new NotSupportedException( "There is no NFC support on this device") įirst, you’ll need to enable ID_CAP_PROXIMITY on your app. Public void AddAlternateIdentity( string platform, string appid) / Don't add an alternate identity for the platform you're on, or you'll get an exception _nfcdev.DeviceDeparted += _nfcdev_DeviceDeparted ĭt = new DispatcherTimer() " _nfcdev.DeviceArrived += _nfcdev_DeviceArrived () // clear anything we addedĭ(() => dt.Stop()) _nfcdev.DeviceArrived -= _nfcdev_DeviceArrived _nfcdev.DeviceDeparted -= _nfcdev_DeviceDeparted If ( this = Interlocked.Exchange( ref _instance, null)) I can’t decide if this is because my app doesn’t claim that it supports Proximity, or that it doesn’t support networking at the moment, so some investigation is still required.Īfter further investigation, it appears that the part after the ! should just say App in my case.įull source code of the class is available here: On the other hand, if the app is installed, nothing appears to happen. Now, we obfuscate using EazFuscator, and as a result, the namespace and class names are probably obfuscated.Īs a result, when you tap, and the app isn’t installed, the user is asked if they want to get the app from the store. It is in fact the name of the class that contains the entry point of your App. The second part is really badly documented. The first part before the “!” character can be found when editing Package.appxmanifest. The format of the appid is difficult to determine. Now if you tap your WP8 app against a Windows Tablet with NFC, it will attempt to launch our BouncingBalls App (Wishbone does not yet have a W8 version, though it’s in the pipeline for a Tidy 250 XP in the double challenge) Mgr.AddAlternateIdentity(platform: "Windows",Īppid: "WieserSoftwareLtd.BouncingBalls_38031z1jk36d6!BouncingBalls.App") Mgr.DisplayName = "Wieser Software Wishbone" Here’s the code that I add to my Application_Launching event handler. I’ve come up with a class that makes all of this really easy. I for some reason thought that what was happening is that you could write to them from your code, and appear as a tag. The important thing to realize is that there aren’t any static tags on your phone. I can't wait for the fun I'll have with these, but I digress. I’ve ordered some of them like this, and they’re in the post. ![]() There are some magic parts to this documentation that are a little bit difficult to work out, as I’ll soon describe, so your journey down this route will be frought, and unfortunately, after a lot of pain, I finally realized that this would not work, as it only writes to static tags. If you read the documentation, you’ll find something promising in the ProximityDevice.PublishBinary documentation named LaunchArgs.WriteTag Thanksgiving’s coming up very soon, so I thought sharing our Wishbone application between Windows phones would be a really cool way to do it. ![]() Virtual void DoSomethingAwesome() override Īs part of the DVLUP challenges, you can gain up to 500 points by adding NFC to your app. Public CPropertyPage, public IDoSomethingAwesome So, the correct declaration is public class MyAwsomePropertyPage : As a result, asking for the interface dutifully returns null, as private inheritance is an implementation detail, and not visible in the inheritance tree. I had inadvertently declared my IDoSomethingAwesome interface not public. ![]() My C# had blinded me to the joys of C++ inheritance. I started writing this up as a question on StackOverflow, but while doing so, ended up talking to the duck and discovered the error in my ways. Only one problem: pInt was always NULL! That was odd, because looking at the pointer returned by GetParent() gave me an object that the debugger knew was of type MyAwesomePropertyPage, yet I couldn’t for the life of me figure out why this wasn’t working. IDoSomethingAwesome *pInt = dynamic_cast(GetParent())
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |