MIX10 Highlights – Day Two

 

Day two at the Mandalay Bay!

IMAG0072

More of the details of Windows Phone were covered today.  Again, it was stressed that the version of Silverlight on the phone is regular Silverlight 3 that everyone knows, plus extra extensions for phone specific features and performance enhancements, plus a more relaxed sandbox.

The demos consisted of showing how you can help the phone to help the user use your application.  Input fields can take input scopes to tell them what kind of input you are expecting, e.g. Text, Url,  Number, Time, Phone Number, email and the phones software keyboard will reconfigure to easier allow the entry of that data.

When interfacing with the phone’s sensors the are a number of classes provided for interfacing with the sensors on the phone, mostly they are singletons as there’s only one hardware sensor to talk to.

Accelerometer measures the G forces applied in each axis over time and returns a reading for each dimension measured in Gs.  Shaking the device can produce a G reading greater than 1.

var a = AccelerometerSensor.Default
a.ReadingChanged += [event handler]

The delegate currently does not get called on the UI thread, there was some debate as to whether it should or not. The emulator does not have any support for the accelerometer at present.

The VibrateContoller allows an app to make the handset, well, vibrate.  Takes a timespan.  Again, not in the emulator.

The CameraCaptureTask allows you to launch the photo taking application, and you receive the image back as a stream.

The Silverlight Webbrowser control is a fully featured browser, supporting pan, tap, double tap, and pinch zoom, however by default javascript is disabled.  It can be enabled using the “IsScriptEnabled” property. The cookies and cache are isolated to the application containing the webbrowser control, they are not shared between controls or with the main browser.  Siliverlight can interact with javascript running inside the browser using

wb.InvokeScript(“functioname”,arg0,arg1)

to go from Silverlight to script and

window.external.Notify(string)

to go from javascript back to Silverilght, which then raises an event on the browser control.

The other main concepts are launchers and chooser.  Launchers let you fire up an OS experience, like SMS, email, browser, maps, dialer, search etc.  Choosers let you browse for phone data then return back to your app, like contacts, pictures, media etc.  When the Chooser completes it raises an OnChooserReturn event on your application, and you can inspect what was chosen by looking at the event args.

Location services were covered, you can tell the device what accuracy you want to know your location to, and depending on what you choose will depend on how it locates you – either GPS, Cell Tower, or geo-tagged Wifi hotspots.  This allows the device to conserve power by not bringing up the GPS if it doesn’t need to, and also makes your app more responsive by returning a rapid approximate match if there’s no need for you to wait minutes for a GPS fix.

The lifetime of an application was covered.  Two things can happen to your application whilst you are running, you can be obscured by an incoming notification (e.g. sms, incoming call) or you can be paused (e.g. reading the sms, taking the call).  Your application is notified of both events, and for obscured you continue to execute as your still in the foreground, although if you are a game it might be polite to wait for the user.  If you are paused you can get brief time window to persist your state, as you should assume that you’ll be unloaded.  If you’re not unloaded you may be resumed when the user returns, if you were unloaded you can restore your persisted state next time you launch your app.  There’s no framework support for this though, you have to roll your own persistence.

No one is talking about text-to-speech, the quote was “I don’t want to answer that right now”.

Following on from all the talk of user experience, of which there is a lot, there’s an interesting demo outside the convention center:

IMAG0070

The tiles are projected onto the wall that people are walking past, but the tiles dodge out of the way if someone casts a shadow on the wall.  It’s pretty much always got someone playing with it, even though it doesn’t actually do anything!

Comments

No comments posted yet.

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Please add 1 and 5 and type the answer here:

Preview Your Comment.