SlideShare a Scribd company logo
1 of 45
Windows XAML+
Silverlight 8.1
30 April 2014
Building Apps for Windows Phone 8.1 Jump Start
Raw Sensor Type Windows 8.1 Windows Phone 8.1
3D-Accelerometer Yes Yes
3D-Magnetometer Yes Yes
3D-Gyroscope Yes Yes
Ambient Light Yes Yes
Short Range Proximity No Yes
Simple Device
Orientation
Device
Orientation
Inclinometer Compass Shake
// Determine whether we have a gyro on the phone
_gyrometer = Gyrometer.GetDefault();
if (_gyrometer != null)
{
// Establish the report interval (units are milliseconds)
_gyrometer.ReportInterval = 100;
_gyrometer.ReadingChanged += _gyrometer_ReadingChanged;
}
else
{
MessageBox.Show("No gyrometer found");
}
// Establish the report interval (units are milliseconds)
uint reportInterval = 100;
if (_gyrometer.MinimumReportInterval > reportInterval)
{
reportInterval = _gyrometer.MinimumReportInterval;
}
_gyrometer.ReportInterval = reportInterval;
_gyrometer.ReportInterval = 100;
_gyrometer.ReadingChanged += _gyrometer_ReadingChanged;
…
private void _gyrometer_ReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
{
Dispatcher.BeginInvoke(() =>
{
GyrometerReading reading = args.Reading;
X_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
Y_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
Z_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
});
}
// Alternative to ReadingChanged event, call GetCurrentReading() to poll the sensor
GyrometerReading reading = _gyrometer.GetCurrentReading();
if (reading != null)
{
X_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX);
Y_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY);
Z_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ);
}
http://aka.ms/Gc7rwo
18
<!-- We'll use the Serial Port Profile service on any device. -->
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any"> <!-- or ="vidpid:xxxx xxxx bluetooth" -->
<m2:Function Type="name:serialPort" />
<!-- use name:<service> as above, or… -->
<m2:Function
Type="serviceId:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/>
</m2:Device>
</m2:DeviceCapability>
You cannot modify the Bluetooth device capability using the Manifest editor in Microsoft Visual Studio.
You must right-click the Package.appxmanifest file in Solution Explorer and select Open With..., and
then XML (Text) Editor.
Discover
RfcommDeviceServices
with the
Windows.Devices.
Enumeration API
Use a
StreamSocket to
communicate
with the remote
device
23
Familiarity
&
Extensibility
<m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
<m2:Device Id="model:xxxx;xxxx"|"any">
<m2:Function Type="name:heartRate"/>
<!-- use name:<service> as above, or… -->
<m2:Function Type="serviceId:xxxxxxxx"/>
</m2:Device>
</m2:DeviceCapability>
You cannot modify the Bluetooth GATT device capability using the Manifest editor in Microsoft Visual
Studio.
You must right-click the Package.appxmanifest file in Solution Explorer and select Open With..., and
then XML (Text) Editor.
async void Initialize()
{
var themometerServices = await Windows.Devices.Enumeration
.DeviceInformation.FindAllAsync(
GattDeviceService.GetDeviceSelectorFromUuid(
GattServiceUuids.HealthThermometer), null);
GattDeviceService firstThermometerService = await GattDeviceService.FromIdAsync(themometerServices[0].Id);
Debug.WriteLine("Using service: " + themometerServices[0].Name);
GattCharacteristic thermometerCharacteristic =
firstThermometerService.GetCharacteristics(GattCharacteristicUuids.TemperatureMeasurement)[0];
thermometerCharacteristic.ValueChanged += temperatureMeasurementChanged;
await thermometerCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(
GattClientCharacteristicConfigurationDescriptorValue.Notify);
}
void temperatureMeasurementChanged(GattCharacteristic sender, GattValueChangedEventArgs eventArgs)
{
byte[] temperatureData = new byte[eventArgs.CharacteristicValue.Length];
Windows.Storage.Streams.DataReader.FromBuffer(eventArgs.CharacteristicValue).ReadBytes(temperatureData);
var temperatureValue = convertTemperatureData(temperatureData);
temperatureTextBlock.Text = temperatureValue.ToString();
}
double convertTemperatureData(byte[] temperatureData)
{
// Read temperature data in IEEE 11703 floating point format
// temperatureData[0] contains flags about optional data - not used
UInt32 mantissa = ((UInt32)temperatureData[3] << 16) |
((UInt32)temperatureData[2] << 8) | ((UInt32)temperatureData[1]);
Int32 exponent = (Int32)temperatureData[4];
return mantissa * Math.Pow(10.0, exponent);
}
28
30
// The service Uuid: 662DD79F-3CD4-4D16-8279-DB1D45ED9628
private static readonly Guid BluetoothServiceUuid = Guid.Parse("662DD79F-3CD4-4D16-8279-DB1D45ED9628");
...
// Register a background Task
var trigger = new RfcommConnectionTrigger();
trigger.InboundConnection.LocalServiceId = RfcommServiceId.FromUuid(BluetoothServiceUuid);
trigger.OutboundConnection.RemoteServiceId = RfcommServiceId.FromUuid(BluetoothServiceUuid);
trigger.AllowMultipleConnections = false;
var builder = new BackgroundTaskBuilder();
builder.SetTrigger(trigger);
Picture
Contact cards
URLs
Videos
Transit passes
Enterprise access control
Mobile Payments (Credit/debit
cards etc)
http://aka.ms/Gc7rwo
Windows.Networking.Proximity.ProximityDevice proximityDevice =
Windows.Networking.Proximity.ProximityDevice.GetDefault();
if (proximityDevice != null)
{
// The format of the app launch string is: "<args>tWindowst<AppName>".
// The string is tab or null delimited. The <args> string can be an empty string ("").
string launchArgs = "user=default";
// The format of the AppName is: PackageFamilyName!PRAID.
string praid = "MyAppId"; // The Application Id value from your package.appxmanifest.
string appName = Windows.ApplicationModel.Package.Current.Id.FamilyName + "!" + praid;
string launchAppMessage = launchArgs + "tWindowst" + appName;
var dataWriter = new Windows.Storage.Streams.DataWriter();
dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf16LE;
dataWriter.WriteString(launchAppMessage);
var launchAppPubId =
proximityDevice.PublishBinaryMessage(
"LaunchApp:WriteTag", dataWriter.DetachBuffer());
}
Tags supported:
Tags supported:
39
41
Bank/MNO App
UICC
Card
NFC Controller
SE Manager with ACL Enforcer
3rd party
Smartcard API
OS Platform
public async void SetupCardReader()
{
var devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(
SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Nfc));
var reader = await SmartCardReader.FromIdAsync(devices.First().Id);
reader.CardAdded += CardAdded;
reader.CardRemoved += CardRemoved;
}
public async void CardAdded(SmartCardReader sender, CardAddedEventArgs args)
{
DoCardOperations(args.SmartCard);
}
void CardRemoved(SmartCardReader sender, CardRemovedEventArgs args)
{ // Handle card removal }
async void DoCardOperations(SmartCard card)
{
using (var connection = await card.ConnectAsync())
{
var atr = await card.GetAnswerToResetAsync();
string adpuCommand = "Some ADPU command";
var dataWriter = new Windows.Storage.Streams.DataWriter();
dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf16LE;
dataWriter.WriteString(adpuCommand);
var apduResponse = await connection.TransmitAsync(dataWriter.DetachBuffer());
}
}
44
45
©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

2012 NagraID display cards - alternatywa dla tokenów
2012 NagraID display cards - alternatywa dla tokenów2012 NagraID display cards - alternatywa dla tokenów
2012 NagraID display cards - alternatywa dla tokenówSzymon Dowgwillowicz-Nowicki
 
Blockchain solutions leading to better security practices
Blockchain solutions leading to better security practicesBlockchain solutions leading to better security practices
Blockchain solutions leading to better security practicesEric Larcheveque
 
Make the Smartcard great again
Make the Smartcard great againMake the Smartcard great again
Make the Smartcard great againEric Larcheveque
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2John Staveley
 
A 2018 practical guide to hacking RFID/NFC
A 2018 practical guide to hacking RFID/NFCA 2018 practical guide to hacking RFID/NFC
A 2018 practical guide to hacking RFID/NFCSlawomir Jasek
 
Document Verification through C-One E-Id - Copy
Document Verification through C-One E-Id - CopyDocument Verification through C-One E-Id - Copy
Document Verification through C-One E-Id - CopyRima Hajou
 
Sviluppare un portale per gestire la tua soluzione IoT Hub
Sviluppare un portale per gestire la tua soluzione IoT HubSviluppare un portale per gestire la tua soluzione IoT Hub
Sviluppare un portale per gestire la tua soluzione IoT HubMarco Parenzan
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopSlawomir Jasek
 
iot hacking, smartlockpick
 iot hacking, smartlockpick iot hacking, smartlockpick
iot hacking, smartlockpickidsecconf
 
Cant touch this: cloning any Android HCE contactless card
Cant touch this: cloning any Android HCE contactless cardCant touch this: cloning any Android HCE contactless card
Cant touch this: cloning any Android HCE contactless cardSlawomir Jasek
 
Smart Card and Strong Cryptography for instant security
Smart Card and Strong Cryptography for instant securitySmart Card and Strong Cryptography for instant security
Smart Card and Strong Cryptography for instant securityOKsystem
 
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...Identive Group | Press Release | Identive Group's RFID and Near Field Communi...
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...Identive
 
Bluetooth LE Button
Bluetooth LE ButtonBluetooth LE Button
Bluetooth LE Buttondongbuluo
 
SmartWorld Portfolio
SmartWorld PortfolioSmartWorld Portfolio
SmartWorld PortfolioSmart World
 
IRJET - Securing Communication among IoT Devices using Blockchain Proxy
IRJET -  	  Securing Communication among IoT Devices using Blockchain ProxyIRJET -  	  Securing Communication among IoT Devices using Blockchain Proxy
IRJET - Securing Communication among IoT Devices using Blockchain ProxyIRJET Journal
 
CIS14: Securing the Internet of Things with Open Standards
CIS14: Securing the Internet of Things with Open StandardsCIS14: Securing the Internet of Things with Open Standards
CIS14: Securing the Internet of Things with Open StandardsCloudIDSummit
 

What's hot (20)

2012 NagraID display cards - alternatywa dla tokenów
2012 NagraID display cards - alternatywa dla tokenów2012 NagraID display cards - alternatywa dla tokenów
2012 NagraID display cards - alternatywa dla tokenów
 
Blockchain solutions leading to better security practices
Blockchain solutions leading to better security practicesBlockchain solutions leading to better security practices
Blockchain solutions leading to better security practices
 
Make the Smartcard great again
Make the Smartcard great againMake the Smartcard great again
Make the Smartcard great again
 
Rklb57 rwklb575 ds_en
Rklb57 rwklb575 ds_enRklb57 rwklb575 ds_en
Rklb57 rwklb575 ds_en
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2
 
Rebooting the smartcard
Rebooting the smartcardRebooting the smartcard
Rebooting the smartcard
 
A 2018 practical guide to hacking RFID/NFC
A 2018 practical guide to hacking RFID/NFCA 2018 practical guide to hacking RFID/NFC
A 2018 practical guide to hacking RFID/NFC
 
Document Verification through C-One E-Id - Copy
Document Verification through C-One E-Id - CopyDocument Verification through C-One E-Id - Copy
Document Verification through C-One E-Id - Copy
 
Sviluppare un portale per gestire la tua soluzione IoT Hub
Sviluppare un portale per gestire la tua soluzione IoT HubSviluppare un portale per gestire la tua soluzione IoT Hub
Sviluppare un portale per gestire la tua soluzione IoT Hub
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshop
 
Civintec introduction 2015
Civintec introduction 2015Civintec introduction 2015
Civintec introduction 2015
 
iot hacking, smartlockpick
 iot hacking, smartlockpick iot hacking, smartlockpick
iot hacking, smartlockpick
 
Cant touch this: cloning any Android HCE contactless card
Cant touch this: cloning any Android HCE contactless cardCant touch this: cloning any Android HCE contactless card
Cant touch this: cloning any Android HCE contactless card
 
Smart Card and Strong Cryptography for instant security
Smart Card and Strong Cryptography for instant securitySmart Card and Strong Cryptography for instant security
Smart Card and Strong Cryptography for instant security
 
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...Identive Group | Press Release | Identive Group's RFID and Near Field Communi...
Identive Group | Press Release | Identive Group's RFID and Near Field Communi...
 
Bluetooth LE Button
Bluetooth LE ButtonBluetooth LE Button
Bluetooth LE Button
 
SmartWorld Portfolio
SmartWorld PortfolioSmartWorld Portfolio
SmartWorld Portfolio
 
IRJET - Securing Communication among IoT Devices using Blockchain Proxy
IRJET -  	  Securing Communication among IoT Devices using Blockchain ProxyIRJET -  	  Securing Communication among IoT Devices using Blockchain Proxy
IRJET - Securing Communication among IoT Devices using Blockchain Proxy
 
CIS14: Securing the Internet of Things with Open Standards
CIS14: Securing the Internet of Things with Open StandardsCIS14: Securing the Internet of Things with Open Standards
CIS14: Securing the Internet of Things with Open Standards
 
NFC wallet
NFC walletNFC wallet
NFC wallet
 

Similar to 15 sensors and proximity nfc and bluetooth

Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Adam Blum
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorialSynapseindiappsdevelopment
 
Linux Input device에 대한 료해(Odroid-S Kernel)
Linux Input device에 대한 료해(Odroid-S Kernel)Linux Input device에 대한 료해(Odroid-S Kernel)
Linux Input device에 대한 료해(Odroid-S Kernel)syit02lll
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Frédéric Harper
 
Assistive Technology_Research
Assistive Technology_ResearchAssistive Technology_Research
Assistive Technology_ResearchMeng Kry
 
PhoneGap - Hardware Manipulation
PhoneGap - Hardware ManipulationPhoneGap - Hardware Manipulation
PhoneGap - Hardware ManipulationDoncho Minkov
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)DroidConTLV
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsRichard Hyndman
 
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...Constantine Mars
 
11 background tasks and multitasking
11   background tasks and multitasking11   background tasks and multitasking
11 background tasks and multitaskingWindowsPhoneRocks
 
Ch10 - Programming for Touchscreens and Mobile Devices
Ch10 - Programming for Touchscreens and Mobile DevicesCh10 - Programming for Touchscreens and Mobile Devices
Ch10 - Programming for Touchscreens and Mobile Devicesdcomfort6819
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updatedGhanaGTUG
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsAleksandar Ilić
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsPSTechSerbia
 

Similar to 15 sensors and proximity nfc and bluetooth (20)

Pandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 AgentPandora FMS: Windows Phone 7 Agent
Pandora FMS: Windows Phone 7 Agent
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013Sensing Mobile Devices talk from QCon London 2013
Sensing Mobile Devices talk from QCon London 2013
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Linux Input device에 대한 료해(Odroid-S Kernel)
Linux Input device에 대한 료해(Odroid-S Kernel)Linux Input device에 대한 료해(Odroid-S Kernel)
Linux Input device에 대한 료해(Odroid-S Kernel)
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
 
Assistive Technology_Research
Assistive Technology_ResearchAssistive Technology_Research
Assistive Technology_Research
 
PhoneGap - Hardware Manipulation
PhoneGap - Hardware ManipulationPhoneGap - Hardware Manipulation
PhoneGap - Hardware Manipulation
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen Widgets
 
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...
Android Wear 2.0 - New Level of Freedom for Your Action - GDG CEE Leads Summi...
 
11 background tasks and multitasking
11   background tasks and multitasking11   background tasks and multitasking
11 background tasks and multitasking
 
Ch10 - Programming for Touchscreens and Mobile Devices
Ch10 - Programming for Touchscreens and Mobile DevicesCh10 - Programming for Touchscreens and Mobile Devices
Ch10 - Programming for Touchscreens and Mobile Devices
 
Android 3
Android 3Android 3
Android 3
 
Analytics with Spark
Analytics with SparkAnalytics with Spark
Analytics with Spark
 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updated
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App Components
 
Java Svet - Communication Between Android App Components
Java Svet - Communication Between Android App ComponentsJava Svet - Communication Between Android App Components
Java Svet - Communication Between Android App Components
 

More from WindowsPhoneRocks

23 silverlight apps on windows phone 8.1
23   silverlight apps on windows phone 8.123   silverlight apps on windows phone 8.1
23 silverlight apps on windows phone 8.1WindowsPhoneRocks
 
22 universal apps for windows
22   universal apps for windows22   universal apps for windows
22 universal apps for windowsWindowsPhoneRocks
 
21 app packaging, monetization and publication
21   app packaging, monetization and publication21   app packaging, monetization and publication
21 app packaging, monetization and publicationWindowsPhoneRocks
 
19 programming sq lite on windows phone 8.1
19   programming sq lite on windows phone 8.119   programming sq lite on windows phone 8.1
19 programming sq lite on windows phone 8.1WindowsPhoneRocks
 
17 camera, media, and audio in windows phone 8.1
17   camera, media, and audio in windows phone 8.117   camera, media, and audio in windows phone 8.1
17 camera, media, and audio in windows phone 8.1WindowsPhoneRocks
 
16 interacting with user data contacts and appointments
16   interacting with user data contacts and appointments16   interacting with user data contacts and appointments
16 interacting with user data contacts and appointmentsWindowsPhoneRocks
 
14 tiles, notifications, and action center
14   tiles, notifications, and action center14   tiles, notifications, and action center
14 tiles, notifications, and action centerWindowsPhoneRocks
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authenticationWindowsPhoneRocks
 
12 maps, geolocation, and geofencing
12   maps, geolocation, and geofencing12   maps, geolocation, and geofencing
12 maps, geolocation, and geofencingWindowsPhoneRocks
 
10 sharing files and data in windows phone 8
10   sharing files and data in windows phone 810   sharing files and data in windows phone 8
10 sharing files and data in windows phone 8WindowsPhoneRocks
 
09 data storage, backup and roaming
09   data storage, backup and roaming09   data storage, backup and roaming
09 data storage, backup and roamingWindowsPhoneRocks
 
08 localization and globalization in windows runtime apps
08   localization and globalization in windows runtime apps08   localization and globalization in windows runtime apps
08 localization and globalization in windows runtime appsWindowsPhoneRocks
 
07 windows runtime app lifecycle
07   windows runtime app lifecycle07   windows runtime app lifecycle
07 windows runtime app lifecycleWindowsPhoneRocks
 
05 programming page controls and page transitions animations
05   programming page controls and page transitions animations05   programming page controls and page transitions animations
05 programming page controls and page transitions animationsWindowsPhoneRocks
 
04 lists and lists items in windows runtime apps
04   lists and lists items in windows runtime apps04   lists and lists items in windows runtime apps
04 lists and lists items in windows runtime appsWindowsPhoneRocks
 
03 page navigation and data binding in windows runtime apps
03   page navigation and data binding in windows runtime apps03   page navigation and data binding in windows runtime apps
03 page navigation and data binding in windows runtime appsWindowsPhoneRocks
 
02 getting started building windows runtime apps
02   getting started building windows runtime apps02   getting started building windows runtime apps
02 getting started building windows runtime appsWindowsPhoneRocks
 
01 introducing the windows phone 8.1
01   introducing the windows phone 8.101   introducing the windows phone 8.1
01 introducing the windows phone 8.1WindowsPhoneRocks
 

More from WindowsPhoneRocks (20)

3 554
3 5543 554
3 554
 
23 silverlight apps on windows phone 8.1
23   silverlight apps on windows phone 8.123   silverlight apps on windows phone 8.1
23 silverlight apps on windows phone 8.1
 
22 universal apps for windows
22   universal apps for windows22   universal apps for windows
22 universal apps for windows
 
21 app packaging, monetization and publication
21   app packaging, monetization and publication21   app packaging, monetization and publication
21 app packaging, monetization and publication
 
20 tooling and diagnostics
20   tooling and diagnostics20   tooling and diagnostics
20 tooling and diagnostics
 
19 programming sq lite on windows phone 8.1
19   programming sq lite on windows phone 8.119   programming sq lite on windows phone 8.1
19 programming sq lite on windows phone 8.1
 
17 camera, media, and audio in windows phone 8.1
17   camera, media, and audio in windows phone 8.117   camera, media, and audio in windows phone 8.1
17 camera, media, and audio in windows phone 8.1
 
16 interacting with user data contacts and appointments
16   interacting with user data contacts and appointments16   interacting with user data contacts and appointments
16 interacting with user data contacts and appointments
 
14 tiles, notifications, and action center
14   tiles, notifications, and action center14   tiles, notifications, and action center
14 tiles, notifications, and action center
 
13 networking, mobile services, and authentication
13   networking, mobile services, and authentication13   networking, mobile services, and authentication
13 networking, mobile services, and authentication
 
12 maps, geolocation, and geofencing
12   maps, geolocation, and geofencing12   maps, geolocation, and geofencing
12 maps, geolocation, and geofencing
 
10 sharing files and data in windows phone 8
10   sharing files and data in windows phone 810   sharing files and data in windows phone 8
10 sharing files and data in windows phone 8
 
09 data storage, backup and roaming
09   data storage, backup and roaming09   data storage, backup and roaming
09 data storage, backup and roaming
 
08 localization and globalization in windows runtime apps
08   localization and globalization in windows runtime apps08   localization and globalization in windows runtime apps
08 localization and globalization in windows runtime apps
 
07 windows runtime app lifecycle
07   windows runtime app lifecycle07   windows runtime app lifecycle
07 windows runtime app lifecycle
 
05 programming page controls and page transitions animations
05   programming page controls and page transitions animations05   programming page controls and page transitions animations
05 programming page controls and page transitions animations
 
04 lists and lists items in windows runtime apps
04   lists and lists items in windows runtime apps04   lists and lists items in windows runtime apps
04 lists and lists items in windows runtime apps
 
03 page navigation and data binding in windows runtime apps
03   page navigation and data binding in windows runtime apps03   page navigation and data binding in windows runtime apps
03 page navigation and data binding in windows runtime apps
 
02 getting started building windows runtime apps
02   getting started building windows runtime apps02   getting started building windows runtime apps
02 getting started building windows runtime apps
 
01 introducing the windows phone 8.1
01   introducing the windows phone 8.101   introducing the windows phone 8.1
01 introducing the windows phone 8.1
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

15 sensors and proximity nfc and bluetooth

  • 1. Windows XAML+ Silverlight 8.1 30 April 2014 Building Apps for Windows Phone 8.1 Jump Start
  • 2.
  • 3.
  • 4.
  • 5. Raw Sensor Type Windows 8.1 Windows Phone 8.1 3D-Accelerometer Yes Yes 3D-Magnetometer Yes Yes 3D-Gyroscope Yes Yes Ambient Light Yes Yes Short Range Proximity No Yes Simple Device Orientation Device Orientation Inclinometer Compass Shake
  • 6. // Determine whether we have a gyro on the phone _gyrometer = Gyrometer.GetDefault(); if (_gyrometer != null) { // Establish the report interval (units are milliseconds) _gyrometer.ReportInterval = 100; _gyrometer.ReadingChanged += _gyrometer_ReadingChanged; } else { MessageBox.Show("No gyrometer found"); }
  • 7. // Establish the report interval (units are milliseconds) uint reportInterval = 100; if (_gyrometer.MinimumReportInterval > reportInterval) { reportInterval = _gyrometer.MinimumReportInterval; } _gyrometer.ReportInterval = reportInterval;
  • 8. _gyrometer.ReportInterval = 100; _gyrometer.ReadingChanged += _gyrometer_ReadingChanged; … private void _gyrometer_ReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args) { Dispatcher.BeginInvoke(() => { GyrometerReading reading = args.Reading; X_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX); Y_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY); Z_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ); }); }
  • 9. // Alternative to ReadingChanged event, call GetCurrentReading() to poll the sensor GyrometerReading reading = _gyrometer.GetCurrentReading(); if (reading != null) { X_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityX); Y_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityY); Z_Reading.Text = String.Format("{0,5:0.00}", reading.AngularVelocityZ); }
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 16.
  • 17. 18
  • 18.
  • 19. <!-- We'll use the Serial Port Profile service on any device. --> <m2:DeviceCapability Name="bluetooth.rfcomm"> <m2:Device Id="any"> <!-- or ="vidpid:xxxx xxxx bluetooth" --> <m2:Function Type="name:serialPort" /> <!-- use name:<service> as above, or… --> <m2:Function Type="serviceId:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/> </m2:Device> </m2:DeviceCapability> You cannot modify the Bluetooth device capability using the Manifest editor in Microsoft Visual Studio. You must right-click the Package.appxmanifest file in Solution Explorer and select Open With..., and then XML (Text) Editor.
  • 22. 23
  • 24. <m2:DeviceCapability Name="bluetooth.genericAttributeProfile"> <m2:Device Id="model:xxxx;xxxx"|"any"> <m2:Function Type="name:heartRate"/> <!-- use name:<service> as above, or… --> <m2:Function Type="serviceId:xxxxxxxx"/> </m2:Device> </m2:DeviceCapability> You cannot modify the Bluetooth GATT device capability using the Manifest editor in Microsoft Visual Studio. You must right-click the Package.appxmanifest file in Solution Explorer and select Open With..., and then XML (Text) Editor.
  • 25. async void Initialize() { var themometerServices = await Windows.Devices.Enumeration .DeviceInformation.FindAllAsync( GattDeviceService.GetDeviceSelectorFromUuid( GattServiceUuids.HealthThermometer), null); GattDeviceService firstThermometerService = await GattDeviceService.FromIdAsync(themometerServices[0].Id); Debug.WriteLine("Using service: " + themometerServices[0].Name); GattCharacteristic thermometerCharacteristic = firstThermometerService.GetCharacteristics(GattCharacteristicUuids.TemperatureMeasurement)[0]; thermometerCharacteristic.ValueChanged += temperatureMeasurementChanged; await thermometerCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync( GattClientCharacteristicConfigurationDescriptorValue.Notify); }
  • 26. void temperatureMeasurementChanged(GattCharacteristic sender, GattValueChangedEventArgs eventArgs) { byte[] temperatureData = new byte[eventArgs.CharacteristicValue.Length]; Windows.Storage.Streams.DataReader.FromBuffer(eventArgs.CharacteristicValue).ReadBytes(temperatureData); var temperatureValue = convertTemperatureData(temperatureData); temperatureTextBlock.Text = temperatureValue.ToString(); } double convertTemperatureData(byte[] temperatureData) { // Read temperature data in IEEE 11703 floating point format // temperatureData[0] contains flags about optional data - not used UInt32 mantissa = ((UInt32)temperatureData[3] << 16) | ((UInt32)temperatureData[2] << 8) | ((UInt32)temperatureData[1]); Int32 exponent = (Int32)temperatureData[4]; return mantissa * Math.Pow(10.0, exponent); }
  • 27. 28
  • 28.
  • 29. 30 // The service Uuid: 662DD79F-3CD4-4D16-8279-DB1D45ED9628 private static readonly Guid BluetoothServiceUuid = Guid.Parse("662DD79F-3CD4-4D16-8279-DB1D45ED9628"); ... // Register a background Task var trigger = new RfcommConnectionTrigger(); trigger.InboundConnection.LocalServiceId = RfcommServiceId.FromUuid(BluetoothServiceUuid); trigger.OutboundConnection.RemoteServiceId = RfcommServiceId.FromUuid(BluetoothServiceUuid); trigger.AllowMultipleConnections = false; var builder = new BackgroundTaskBuilder(); builder.SetTrigger(trigger);
  • 30.
  • 31.
  • 32.
  • 33. Picture Contact cards URLs Videos Transit passes Enterprise access control Mobile Payments (Credit/debit cards etc)
  • 35.
  • 36. Windows.Networking.Proximity.ProximityDevice proximityDevice = Windows.Networking.Proximity.ProximityDevice.GetDefault(); if (proximityDevice != null) { // The format of the app launch string is: "<args>tWindowst<AppName>". // The string is tab or null delimited. The <args> string can be an empty string (""). string launchArgs = "user=default"; // The format of the AppName is: PackageFamilyName!PRAID. string praid = "MyAppId"; // The Application Id value from your package.appxmanifest. string appName = Windows.ApplicationModel.Package.Current.Id.FamilyName + "!" + praid; string launchAppMessage = launchArgs + "tWindowst" + appName; var dataWriter = new Windows.Storage.Streams.DataWriter(); dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf16LE; dataWriter.WriteString(launchAppMessage); var launchAppPubId = proximityDevice.PublishBinaryMessage( "LaunchApp:WriteTag", dataWriter.DetachBuffer()); }
  • 37.
  • 39.
  • 40. 41 Bank/MNO App UICC Card NFC Controller SE Manager with ACL Enforcer 3rd party Smartcard API OS Platform
  • 41. public async void SetupCardReader() { var devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync( SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Nfc)); var reader = await SmartCardReader.FromIdAsync(devices.First().Id); reader.CardAdded += CardAdded; reader.CardRemoved += CardRemoved; } public async void CardAdded(SmartCardReader sender, CardAddedEventArgs args) { DoCardOperations(args.SmartCard); } void CardRemoved(SmartCardReader sender, CardRemovedEventArgs args) { // Handle card removal }
  • 42. async void DoCardOperations(SmartCard card) { using (var connection = await card.ConnectAsync()) { var atr = await card.GetAnswerToResetAsync(); string adpuCommand = "Some ADPU command"; var dataWriter = new Windows.Storage.Streams.DataWriter(); dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf16LE; dataWriter.WriteString(adpuCommand); var apduResponse = await connection.TransmitAsync(dataWriter.DetachBuffer()); } }
  • 43. 44
  • 44. 45
  • 45. ©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.