WP7 Platform Architecture sunumu

Uzun zamandir webinerlere (hem katilmaya hem de sunum yapmaya) ara vermistim. Az once "Windows Phone 7 Platform Architecture" adli sunumu webiner olarak paylastim ve guzel sorular, geri donusler aldim. Platform, Tools, Architecture ve Marketplace basliklarindan olusan sunumu sizlerle de paylasmak istedim.

 

 

My Zune Cards

Well, it has been long time not listening music on my Zune… and of course my Zuna cards have not been updated for that long period.. We’re getting our WP7 devices on Monday, and these cards will be very dynamic from then on..

 

Starting up WP7 Development: 31 days of Windows Phone 7

Microsoft’s Jeff Blankenburg wrote an interesting blog series called 31 Days of Windows Phone 7 , in which he focuses on one
developer topic each day for a month. Very nice! Here’s the list of
topics:

Day #1: Project Template
Day #2: Page Navigation
Day #3: The Back Button Paradigm
Day #4: Device Orientation
Day #5: System Theming
Day #6: Application Bar
Day #7: Launchers
Day #8: Choosers
Day #9: Debugger Tips
Day #10: Input Scope (on-screen Keyboard)
Day #11: Accelerometer
Day #12: Vibration Controller
Day #13: Location Services
Day #14: Tombstoning
Day #15: Isolated Storage
Day #16: Panorama Control
Day #17: Pivot Control
Day #18: WebBrowser Control
Day #19: Push Notification API
Day #20: Map Control
Day #21: Silverlight Toolkit
Day #22: Apps vs. Games
Day #23: Trial Versions of Your App
Day #24: Embedding Fonts
Day #25: Talking to Existing APIs (like Twitter)
Day #26: Sharing Your App With Other Developers
Day #27: Windows Phone Marketplace
Day #28: Advertising SDK
Day #29: Animations
Day #30: Gestures
Day #31: Charting

This looks very well done and is a nice addition to the already copious amount of Windows Phone developer content out there.

Promoting your Windows Phone 7 application

So you’ve got your Windows Phone 7 application
certified and it’s available for download via marketplace. You think
you’re done? No, you’ve just started. With more applications appearing
in the marketplace all the time it’s important that you continue to
promote and advertise your application. To do this Microsoft have come
out with a series of buttons that you can use to promote application
downloads directly from the website.

Here is a sample of the
various sized buttons in blue. There are versions of the button in
English, French, German, Italian and Spanish and in blue, red and green.
Download for Windows Phone 7 Button

Don’t
forget to read the included readme and policy documents that come in
the download. Also, for the format of the download link, check out the
MSDN Documentation on How to: Link to Windows Phone Marketplace Content

Windows Phone 7 Tools Final

The new Windows Phone 7 tools (final release) are available!  Go get them and start building. It includes:
  • Visual Studio Express for the Phone (or it installs VS support into your version of VS).
  • Expression Blend 4 (full version but only the phone support, but will integrate with your Blend 4 version if installed)
  • Phone Emulator
  • Developer Phone Registration Tool

The installer comes with both Silverlight and XNA for the phone. 

For those of you who have been using the tools, it will require you
uninstall everything. When you upgrade you'll see a couple of new
features:

  • New Pivot and Panorama controls for creating WP7 looking apps.
  • New Pivot and Panorama templates.

In addition to these new features, they've announced the new Silverlight Toolkit for the Windows Phone 7 which includes new controls including:

  • ContextMenu
  • DatePicker
  • TimePicker
  • WrapPanel
  • ToggleSwitch

In addition to these controls, there is a new GestureService class
which will help you bind touch gestures (Tap, DoubleTap, Hold, Drag,
Flick and Pinch) to events so you can handle touch in an easier way than
ever. 

 http://go.microsoft.com/fwlink/?LinkId=185584

Updates from Windows Phone Marketplace

There is some good news with the updated marketplace policies:

  • You still have to pay a registration free which entitles you to 5 free app submissions
  • But any further “paid for” app submissions are free
  • Only “free” app submissions have a cost associated
  • Also MS are introducing the Trial API
  • Includes the Push Notification service.

http://windowsteamblog.com/windows_phone/b/wpdev/

 

Windows phone capabilities security model

Today, Microsoft released the Windows Phone Developer Tools CTP- April Refresh.  You can find most of the details on the new features for this release at the Windows Phone developer blog.
One of these new features is the capabilities-driven security model.
What are capabilities?
A Capability is defined as a resource for which privacy, security, cost or business concerns exist.  Examples of capabilities include GPS, camera, microphone, SMS or sensors.
As of April Refresh, the following capabilities have been disclosed:

 

Capability Id/Name Description
ID_CAP_NETWORKING Apps with access to network services. Disclosed because services could incur cost when roaming.
ID_CAP_LOCATION Apps with access to location services.
ID_CAP_MICROPHONE Apps that access the microphone; can record without visual indication that recording is taking place.
ID_CAP_MEDIALIB Apps that can access media library.
ID_CAP_GAMERSERVICES Apps that interact with XBOX live APIs.  Disclosed due to privacy since data is shared with XBOX.
ID_CAP_PHONEDIALER Apps that place phone calls; possibly without visual indication to end-user.
ID_CAP_PUSH_NOTIFICATION Apps can receive push notifications from internet service; disclosed because services could incur cost when roaming.
ID_CAP_WEBBROWSERCOMPONENT Apps that will use the webbrowser component; if script is turned on, this can have security risks.

*Note: Listing the ones are only the ones publicly disclosed; there are more capabilities, but some are specific to mobile operators and OEMs, others I have not seen publicly disclosed so I am not comfortable sharing.


Why do we have/need capabilities?

Windows Phone leverages capabilities to:
•    Decrease the attack surface.  Capabilities are used by the package loader at install-time to create a security chamber within which the application will execute. This chamber is created once at install-time and used from there-on.
•    Ensure proper disclosure happens to the end-user. Each application discloses its capabilities.
Pending the capabilities used (and maybe the marketplace) there will be several types of disclosures:
o    Disclosure on the application details page in the marketplace  – is the least
o    Disclosure with a prompt at purchase time, for those capabilities that have legal requirements
o    Disclosure with-in the app, when a capability is about to be used.

As a developer, how do I code or prepare for capabilities?
It is very simple, your application includes the list of capabilities it needs in WMAppManifest.xml.
Starting with the April CTP Refresh, when you create a new Windows Phone Application,  the tools automatically include the following capabilities declaration in the WMAppManifest.xml file:

<App xmlns="" … >
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_LOCATION" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>

This manifest is requesting all capabilities.  If you do not need a specific capability, you can just remove or comment out the capability within the manifest.
If you do not request a capability in your manifest, and try to use a feature restricted by this capability, you will get an
UnauthorizedAccessException  with an “Access denied” message. The exception will not happen until you try to use the capability. So your app will load and run fine, up to the point when you try to use the capability and then kaboom! busted!
There is no developer API to check if you have a capability. The assumption is if your application is installed, you got the capabilities you requested, and you should party. If you did not request the right ones, you will then meet the UnauthorizedAccessException we met in the last paragraph.

Any extra tips?
For now, as you are developing and likely don’t have a phone, I recommend you stick to the default capabilities (all).  There are still some scenarios that require a capability and is not obvious from the descriptions I have seen. Here is the ones I have seen so far:

 

 

Capability class or namespace that requires it
ID_CAP_MEDIALIB MediaStreamSource,
Microsoft.Devices.Radio,
Microsoft.Xna.Framework.Media.MediaLibrary and MediaSource,
Microsoft.Devices.MediaHistory
ID_CAP_NETWORKING System.Net,
Microsoft.Xna.Framework.GamerServices.GamerServicesComponent,
WebBrowser class,
Smooth Streaming Media Element (SSME)
ID_CAP_SENSORS Microsoft.Devices.Sensors
ID_CAP_MICROPHONE Microsoft.Xna.Framework.Audio.Microphone
ID_CAP_PHONEDIALER Microsoft.Phone.Tasks
ID_CAP_PUSH_NOTIFICATION Microsoft.Phone.Notification
ID_CAP_WEBBROWSERCOMPONENT WebBrowser class
ID_CAP_LOCATION System.Device.Location