Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using connected devices in Metro style apps

Similar presentations


Presentation on theme: "Using connected devices in Metro style apps"— Presentation transcript:

1 Using connected devices in Metro style apps
12/5/2018 7:48 PM PLAT-278T Using connected devices in Metro style apps Jack Tao Program Manager Lisa Ong Software Developer Microsoft Corporation © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

2 Agenda Creating possibilities for your app with devices
Finding a device to use in your Metro style app Using a device in your Metro style app You’ll leave with examples of how to Make your app more exciting by integrating with devices

3 Your Metro style app can seamlessly integrate device access.

4 Using devices from your Metro style app
Ecosystem of devices carrying a lot of data and content Apps create more possibilities with access to device content Windows APIs enable you to build apps that leverage devices

5 Creating possibilities for your app with devices

6 It’s easy for your Metro style app to use a variety of devices.

7 Using SMS and Location in a Metro style app
demo Where’s my lost tablet? Using SMS and Location in a Metro style app

8 How I found my lost tablet
from: 425-mylaptop to: mytablet body: Where is my tablet? my //build/ from: 425-mytablet to: mylaptop body: 47.XXXXX, -122.YYYYY my lost my office! location ???

9 Using SMS & Location Through Windows, your app can send & receive SMS using mobile broadband Through Windows, your app can easily integrate Location

10 Variety of devices

11 Devices carry a ton of information
Music Photos Videos Documents Contacts, calendar, tasks, notes Text messages Location and routes Workout stats Health data

12 Many common scenarios include devices
Uploading vacation photos, movies from camera to SkyDrive Importing contacts from phone Backing up data to external storage Getting trip history from personal navigation device Tracking daily workout from a fitness device Sending and receiving SMS messages with mobile broadband

13 Your app can easily use device content with cloud services.

14 Uploading photos from a camera to SkyDrive
12/5/2018 7:48 PM demo Photo uploader Uploading photos from a camera to SkyDrive © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

15 Portable storage & web services
Through Windows, your app can easily access content stored on devices Through Windows, your app can share content from devices to an online service

16 You can create mash-up apps that use devices in new ways.

17 Visualizing maps from an off-the-shelf GPS
12/5/2018 7:48 PM demo Rally trip Visualizing maps from an off-the-shelf GPS © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

18 Portable storage & mash-ups
Your app can combine data from devices & web services to create a mash-up Mash-up apps provide rich and exciting ways to use content from devices

19 Using devices in your app
Ecosystem of devices more More possibilities + Your Metro style app

20 Finding a device to use in your Metro style app

21 Ways your app can find devices to use
Multiple/externally-connected Use Windows.Devices.Enumeration Perform queries to list devices Get device icon, name, etc. Get connect/disconnect events Single/built-in Get the default device

22 Find devices by query & enumeration.

23 Finding all portable storage devices
var query = Windows.Devices.Enumeration.DeviceClass.portableStorageDevice; Windows.Devices.Enumeration.DeviceInformation.findAllAsync(query). then(function (storageDevices) { var name = storageDevices[0].name; storageDevices[0].getThumbnailAsync(function (deviceIcon) { var imageTag = document.createElement('img'); imageTag.src = URL.createObjectURL(deviceIcon, …); // PNG format }); var storageDevice = Windows.Devices.Portable.StorageDevice.fromId(storageDevices[0].id);

24 Find a built-in device with one line of code. Start using it right away.

25 Use the .getDefault( ) pattern
var smsDevice = Windows.Devices.Sms.SmsDevice.getDefault(); // Start sending & receiving SMS … var inclinometer = Windows.Devices.Sensors.Inclinometer.getDefault(); // Start writing your racing game … var proximity = Windows.Networking.Proximity.ProximityDevice.getDefault(); // Start discovering nearby PCs …

26 Using a device in your Metro style app

27 Ways your app can use devices
Use files stored on the device File APIs for searching and acting on files Send & receive SMS using mobile broadband Access contacts on a phone Portable devices APIs for unique functionality

28 Search files on a device and use them directly.

29 Upload external camera photos to SkyDrive
var options = new Windows.Storage.Search.QueryOptions(…, [".jpg", ".png"]); var query = storageDevice.createFileQueryWithOptions(options); query.getFilesAsync(). then(function (pictureFiles) { picturesFiles.forEach(function (pictureFile) { WL.upload({ path: "me/skydrive", file: pictureFile, … }); });

30 Send & receive SMS quickly and easily.

31 Use SMS to locate a lost PC
// Send an SMS to locate a second, lost PC var msg = new Windows.Devices.Sms.SmsTextMessage(); msg.to = " "; msg.body = "Where is my tablet?"; smsDevice.sendMessageAsync(msg).then(…); // Elsewhere …, on the lost PC smsDevice.onsmsmessagereceived = function (event) { var messageBody = event.textMessage.body; // Parse message body and reply with current location };

32 Access a phone’s contacts and unique functionality.

33 Get contacts from a phone
// Contacts stored as data in the phone's Contacts Service Windows.Devices.Enumeration.DeviceInformation.findAllAsync(contactsServiceQuery). then(function (devices) { var device = portableDeviceFactory.getDeviceFromId(devices[0].id); var contactsService = device.services[0]; // Get all contact data stored in the vcard2 format contactsService.onGetChildrenByFormatComplete = function (contacts) { … }; contactsService.getChildrenByFormat("vcard2"); });

34 Be sure to declare the necessary capabilities in your app manifest.

35 Recap

36 Your Metro style app can seamlessly integrate device access.

37 Key takeaways Ecosystem of devices carrying a lot of data and content
Apps create more possibilities with access to device content Windows APIs enable you to build apps that use devices

38 + app devices more Ecosystem of devices More possibilities
Your Metro style app

39 Related sessions [APP-398T] How to declare your app’s capabilities
[APP-405T] Share: your app powers the Windows 8 share experience [PLAT-282T] File type associations and AutoPlay [PLAT-781T] Using location & sensors in your app [PLAT-891T] Using files: accessing, searching, and acting on files [HW-747T] Building Metro style apps that connect to specialized devices

40 Further reading and documentation
Metro style device experience Windows.Devices.Enumeration namespace Windows.Devices.Portable namespace Windows.Devices.Sms namespace

41 thank you Feedback and questions http://forums.dev.windows.com
Session feedback

42 12/5/2018 7:48 PM © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

43


Download ppt "Using connected devices in Metro style apps"

Similar presentations


Ads by Google