+ All Categories
Transcript
Page 1: Windows Phone API QuickStart · 2016-08-23 · Windows Phone API QuickStart Fundamental Types and Date / Time Please see the docs for more info Same or very similar to Windows 8 Mostly

Windows Phone API QuickStartFundamental Types and Date / Time

Please see the docs for more infoSame or very similar to Windows 8Mostly overlaps with Windows 8Limited overlap with Windows 8Supported in native apps onlyExtension methodsSimilar to Windows.UI.Xaml namespace in WindowsUse Add Reference Extensions dialog to add to project

Core App Framework, Memory & Debugging

Threading and Synchronization

• NFC -> Networking, Web, & Proximity• Bluetooth -> Networking, Web, & Proximity• GPS -> Maps, Location & Sensors; Multitasking• Background audio -> Multitasking; Media• Alarms & Reminders -> Multitasking; Contacts, Appointments & Reminders• Calendar -> Contacts, Appointments & Reminders• E-mail & SMS -> Messaging, Sharing & Miscellaneous

Windows Runtime Windows.Foundation♦♣DateTime, Uri

Windows.Foundation.Collections♦♣IIterable<T>, IVector <T>, IMap<TK, TV>, IVec-torView <T>

Windows.Storage.Streams♦Buffer

.NETSystem♦Object, Byte, Char, Int32, Single, Double, String, Array, Buffer, Uri, DateTime, TimeSpan, Convert, Math, Random, Type, Exception, Action<T...>, Func<T...>

System.Collections♦List<T>, Dictionary<TK,TV>, Queue<T>, Stack<T>

System.Collections.ObjectModel♦Collection<T>, ObservableCollection<T>

System.LinqNote: Contains extension methods; no need to use

System.Runtime.InteropServices.WindowsRuntimeWindowsRuntimeBuffer, WindowsRuntime-BufferExtensions+Note: You can also use standard C# and VB types and libraries, ‘dynamic’ types, and ‘async’ methods via ‘await’

NativePlatform♦Object, String, Array<T>, Exception

Platform::Collections♦Vector<T>, VectorView<T>, Map<TK,TV>, MapView<TK,TV>, VectorIterator<T>

Date & Time♦GetLocalTime, GetSytemTime, GetDynamicTi-meZoneInformation, SystemTimeToFileTime, FileTimeToSystemTimeNote: You can also use standard C types and the C++ standard libraries

Windows RuntimeWindows.ApplicationModel.Core■♣CoreApplication

Windows.Graphics.Display■♣DisplayProperties

Windows.Phone.UI.Core♣KeyboardInputBuffer

Windows.Phone.UI.Input♣HardwareButtons

Windows.UI.Core■♣CoreWindow

.NETMicrosoft.Phone.ControlsPhoneApplicationFrame, PhoneApplicationPage

Microsoft.Phone.ShellPhoneApplicationService, ApplicationBar, SystemTray

System.Diagnostics♦Debug, Debugger

System.WindowsApplication, MessageBox, ResourceDictionary

System.Windows.NavigationNavigationService, NavigationContext, UriMapper

NativeCOM♦

CoInitializeEx, CoUninitialize, CoCreateInstance-FromApp, StringFromCLSID, CoTaskMemFree, CoFreeUnusedLibrariesEx

Memory & Libraries♦GetProcessHeap, HeapAlloc, HeapFree, Load-PackagedLibrary, GetProcAddress, FreeLibraryNote: You can also use C++ new and delete opera-tors

Errors & Debugging♦GetLastError, IsDebuggerPresent, OutputDebug-StringW

Windows Runtime Windows.System.Threading♦ThreadPool, ThreadPoolTimer

Windows.UI.Core♦CoreDispatcher, CoreWindow, Note: You can get the current dispatcher from CoreWindow.GetForCurrentThread()

.NETSystemWindowsRuntimeSystemExtensions+

System.Threading■Thread, ThreadPool, Timer, AutoResetEvent, ManualResetEvent, Mutex

System.Threading.Tasks♦Task<T>, TaskCompletionSource<T>, TaskFactory<T>

System.Windows.ThreadingDispatcher, DispatcherTimerNote: You can get the global dispatcher from System.Windows.Deployment.Current

NativeThreads♦GetCurrentThread, GetCurrentThreadId

Synchronization♦WaitForSingleObjectEx, WaitForMultipleObject-sEx, CreateMutexExW, ReleaseMutex, Crea-teEventExW, SetEvent, ResetEvent, CloseHandle, InitializeCriticalSectionEx, EnterCriticalSection, LeaveCriticalSection, DeleteCriticalSection

Windows RuntimeWindows.Storage■ApplicationData, StorageFile, StorageFolderNote: You can get install folder from Windows.Ap-plicationModel.Package.Current.InstalledLocation

Windows.Storage.FileProperties•BasicProperties

Windows.Storage.Streams■DataReader, DataWriter

.NETMicrosoft.Phone.StorageExternalStorage

System.IO♦StreamReader, StreamWriter, StringReader, StringWriter, BinaryReader, BinaryWriter, MemoryStream, WindowsRuntimeStorageExten-sions+, WindowsRuntimeStreamExtensions+Note: Avoid using the File, FileInfo, Directory, Direc-toryInfo, and Path types

System.IO.IsolatedStorageIsolatedStorageFile

NativeFile I/O♦CreateFile2, ReadFile, WriteFile, DeleteFileW, CloseHandle, FindFirstFileExW, FindClose

Windows Runtime Windows.NetworkingHostName

Windows.Networking.Proximity♦PeerFinder, ProximityDevice

Windows.Networking.Sockets■DatagramSocket, StreamSocket

.NETMicrosoft.Phone.ControlsWebBrowser, WebBrowserExtensions+

Microsoft.Phone.TasksWebBrowserTask

System.Net■WebClient, HttpWebRequest, WebUtility

System.Net.SocketsSocketNote: Provided for compatibility; new apps should use Windows.Networking.Sockets

NativeHTTP♦IXMLHTTPRequest2

WinsockWSAStartup, socket, gethostbyname, WSAAd-dressToString, bind, connect, send, recv, accept, listen, closesocket, WSACleanup

Windows RuntimeWindows.Phone.Media.CapturePhotoCaptureDevice, AudioVideoCaptureDevice, KnownCameraPhotoProperties

Windows.Storage.Pickers•♣FileOpenPickerNote: Can only be used to pick photos from the Photos Hub

.NETMicrosoft.DevicesPhotoCamera, CameraButtons, CameraVideo-BrushExtensions+

Microsoft.PhonePictureDecoder

Microsoft.Phone.TasksMediaPlayerLauncher, CameraCaptureTask, PhotoChooserTask, ShareMediaTask, SaveRing-toneTask

Microsoft.Xna.Framework.AudioMicrophone, SoundEffect, DynamicSoundEffec-tInstance

Microsoft.Xna.Framework.MediaMediaLibrary, MediaPlayer, Song

Microsoft.Xna.Framework.Media.PhoneExtensionsMediaLibraryExtensions+

System.Windows.Media

MediaStreamSource, VideoBrushSystem.Windows.Media.ImagingWriteableBitmap, BitmapImage, Extensions+Note: See Messaging, Sharing & Miscellaneous for key DRM APIs

.NETMicrosoft.Phone.GlobalizationSortedLocaleGrouping

System.Globalization■CultureInfo, RegionInfo

System.ResourcesResourceManager

System.Text♦StringBuilder, Encoding

System,Text, RegularExpressions♦Regex

System.WindowsApplication.GetResourceStream()

NativeText & Resources♦FormatMessageW, MultiByteToWideChar, WideCharToMultiByte, CompareStringEx

NLS♦GetDateFormatEx, GetTimeFormatEx, Ge-tUserDefaultLocaleName, GetLocaleInfoEx

MUIGetUserPrefferedUILanguages

.NET System.Data.LinqDataContext

System.Data.Linq.MappingTableAttribute, ColumnAttribute

System.Runtime.Serialization♦DataContractSerializer

System.Runtime.Serialization.Json♦DataContractJsonSerializer

System.Xml♦XmlReader, XmlWriter

System.Xml.Linq♦XDocument, XElement, XAttribute, XNamespace, Extensions+

System.Xml.Serialization■XmlSerializer

Windows RuntimeWindows.ApplicationModel.Store■CurrentApp

Windows.System•Launcher.LaunchUriAsync▲

.NETMicrosoft.Phone.MarketplaceLicenseInformation

Microsoft.Phone.TasksMarketplaceDetailsTask, MarketplaceRe-viewTask, MarketplaceSearchTask

Windows RuntimeWindows.Devices.Geolocation♦Geolocator

Windows.Devices.Sensors■Accelerometer, Compass, Gyrometer, Orienta-tionSensor

VibrationDevice

.NETMicrosoft.DevicesVibrateController

Microsoft.Devices.SensorsAccelerometer, Compass, Gyroscope, Motion

.NET System.Windows.ControlsDrawingSurface, DrawingSurfaceBackground-Grid

XNANote: XNA is fully supported for Windows Phone 7.5 apps only; see documentation.

NativeDirect3DD3D11CreateDevice, CreateSwapChainForCore-Window, ID3D11Device1, ID3D11DeviceCon-text1, IDXGISwapChain1Note: See documentation for complete list of D3D interfaces and APIs

Windows RuntimeWindows.Phone.Speech.RecognitionSpeechRecognizerUI, SpeechRecognizer, In-stalledSpeechRecognizers

Windows.Phone.Speech.SynthesisSpeechSynthesizer, InstalledVoices

Windows.Phone.Speech.VoiceCommandsVoiceCommandService

Networking, Web and Proximity

Media, Soundsand Pictures

File System and Streams

cont.

XML, Databases and Serialization

In-App Purchase, Licensing and Marketplace

Text, Globalization & Resources

Maps, Location and Sensors

Controls and Animation (XAML)

Windows Phone Toolkithttp://phone.codeplex.comMicrosoft Media Player Frameworkhttp://smf.codeplex.com/Smooth Streaming Clienthttp://www.iis.net/downloads/microsoft/smooth-streaming-client-sdk

NuGet Package Managerhttp://nuget.codeplex.com/DirectX Helpershttp://directxtex.codeplex.com/, http://directxtk.codeplex.com/OData Clienthttp://msdn.microsoft.com/en-us/jj658961

• Facebook & Twitter -> Messaging, Sharing & Miscellaneous• Rumble / Vibration -> Maps, Location & Sensors• Battery & Power -> Messaging, Sharing & Miscellaneous• Memory -> Messaging, Sharing & Miscellaneous• App launching -> Messaging, Sharing & Miscellaneous• Ringtones -> Media, Sounds & Pictures• Security -> Messaging, Sharing & Miscellaneous• DRM -> Messaging, Sharing & Miscellaneous

Additional

Frameworks:

See Also:

Legend

Speech

Contacts, Appointments and Reminders

Messaging, Sharing and Miscellaneous

3D Graphics▲

cont.

MapsTask, MapsDirectionsTask, MapDownload-erTask

System.Device.LocationGeoCoordinateWatcher

Windows RuntimeWindows.Phone.Media.CaptureAudioVideoCaptureDevice, KnownCameraAu-dioVideoProperties

Windows.Phone.Media.DevicesAudioRoutingManager

Windows.Phone.Networking.VoipVoipCallCoordinator, VoipPhoneCall

.NETMicrosoft.Phone.MediaMediaStreamerFactory

Microsoft.Phone.Networking.VoipVoipBackgroundProcess, VoipHttpIncoming-CallTask, VoipKeepAliveTask

See also: Multitasking

NativeAudioActivateAudioInterface, GetDefaultAudioCaptu-reId, GetDefaultAudioRenderId,

.NETMicrosoft.Advertising.Mobile.UI♥AdControl

Microsoft.Expression.Interactivity.Core♥GoToStateAction, NavigateToPageAction, Call-MethodAction, ChangePropertyAction

Microsoft.Expression.Interactivity.Media♥ControlStoryboardAction, PlaySoundAction

Microsoft.Phone.ControlsLongListSelector, Panorama, Pivot, WebBrowser

Microsoft.Phone.Maps.ControlsMap, MapLayer, MapOverlay,

System.Windows.Controls°Button, CheckBox, RadioButton, HyperlinkBut-ton, TextBlock, TextBox, PasswordBox, RichText-Box, Image, MediaElement, ProgressBar, Border, Canvas, Grid, ListBox, StackPanel, ScrollViewer, ViewBox

System.Windows.Controls.PrimitivesPopup, ViewportControl

System.Windows.Interactivity♥Interaction, InvokeCommandAction,

System.Windows.Media.AnimationStoryboard, DoubleAnimation, DoubleAnima-tionUsingKeyFrames, DiscreteDoubleKeyFrame, ObjectAnimationUsingKeyFrames, DiscreteOb-jectKeyFrame

System.Windows.ShapesRectangle, Ellipse, PolygonNote: Use Visual Studio or Expression Blend for layout. Use Expression Blend to add interactivity, animation, and visual states.

Push, Live Tiles and Lock Screen

Multitasking▲

Wallet▲.NETMicrosoft.Phone.TasksAddWalletItem

Microsoft.Phone.WalletWallet, Deal, WalletTransactionItem, WalletAgent

.NETMicrosoft.Phone.BackgroundAudioBackgroundAudioPlayer, AudioTrack, AudioPlay-erAgent, AudioStreamingAgent

Microsoft.Phone.BackgroundTransferBackgroundTransferService, BackgroundTransfer-Request

Microsoft.Phone.Networking.VoipVoipCallInProgressAgent, VoipForegroundLife-timeAgent

Microsoft.Phone.SchedulerScheduledActionService, PeriodicTask, ResourceIn-tensiveTask

Microsoft.Phone.ShellShellToast

Microsoft.Phone.WalletWalletAgent

Windows Runtime

LockScreen, LockScreenManager

.NET

Microsoft.Phone.ShellShellTile, FlipTileData, IconicTileData, CycleTile-Data,

Windows RuntimeWindows.Phone.PersonalInformationContactStore, StoredContact, ContactInformation, KnownContactProperties

.NETMicrosoft.Phone.SchedulerAlarm, Reminder

Microsoft.Phone.TasksPhoneCallTask, PhoneNumberChooserTask, EmailAddressChooserTask, AddressChooserTask, SaveAppointmentTask, SaveContactTask,

Microsoft.Phone.UserDataContacts, Appointments

Windows RuntimeWindows.ApplicationModel.DataTransfer•♣DataPackage, DataTransferManager

Windows.Phone.Devices.PowerBattery

Windows.Phone.Management.DeploymentInstallationManager

Windows.Phone.Storage.SharedAccessSharedStorageAccessManager

Windows.Phone.System.AnalyticsHostInformation

Windows.Phone.System.MemoryMemoryManager

Windows.Phone.System.PowerPowerManager

Windows.SystemLauncher▲

.NETMicrosoft.Phone.InfoDeviceStatus

Microsoft.Phone.TasksPhoneCallTask, SmsComposeTask, EmailCompo-seTask, ShareLinkTask, ShareStatusTask, ShareMe-diaTask, SearchTask, ConnectionSettingsTask

System.Security.CryptographyProtectedData, RNGCryptoServiceProvider, RSAC-ryptoServiceProvider, SHA256Managed, AesMan-aged

System.Windows.Media♦▲DomainAcquirer, LicenseAcquirer

NativeHardwareIsProcessorFeaturePresent

VoIP▲

Microsoft.Phone.Maps.ControlsMap, MapLayer, MapOverlay,

Microsoft.Phone.Maps.ServicesGeocodeQuery, ReverseGeocodeQuery, Route-Query

Microsoft.Phone.Tasks

Native▲Media Foundation■MFSStartup, IMFMediaEngineClassFactory, IMF-MediaEngine, MFShutdown

XAudio2♦XAudio2Create, X3DAudioInitialize, X3DAudio-Calculate

CaptureDevice Native APIsICameraCaptureDeviceNative, IAudioVideoCap-tureDeviceNativeNote: These are accessible from the Windows Runtime objects

Top Related