introduzione allo sviluppo con.net compact framework roberto brunetti...
TRANSCRIPT
Introduzione allo sviluppo con Introduzione allo sviluppo con
.NET Compact Framework .NET Compact Framework Roberto Brunetti Roberto Brunetti [email protected] [email protected] http://blogs.devLeap.com/robhttp://blogs.devLeap.com/robhttp://thinkmobile.it/blogs/robhttp://thinkmobile.it/blogs/rob
Marco FrontiniMarco [email protected]@softandroll.itwww.softandroll.itwww.softandroll.ithttp://thinkmobile.it/blogs/front http://thinkmobile.it/blogs/front
Fabio SantiniFabio [email protected]@microsoft.comwww.fsantini.netwww.fsantini.nethttp://thinkmobile.it/blogs/fabiosantinihttp://thinkmobile.it/blogs/fabiosantini
MobileMobile&&
.NET Compact .NET Compact Framework Framework
……in questa sessione…in questa sessione…
Microsoft Mobility PlatformMicrosoft Mobility Platform
Increased FunctionalityIncreased Functionality
Notebook PCNotebook PC• Complex document Complex document
authoring, editing authoring, editing and readingand reading
• Keyboard centric at Keyboard centric at the deskthe desk
• Keyboard and Keyboard and mouse input mouse input methodsmethods
• Full .NET Full .NET framework framework availableavailable
Windows CE+Windows CE+ Windows XPWindows XP
Tablet PCTablet PC• Complex document Complex document
authoring, editing and authoring, editing and active readingactive reading
• Note taking and ink Note taking and ink annotating annotating
• Keyboard centric at the Keyboard centric at the desk, pen & keyboard desk, pen & keyboard away from the deskaway from the desk
• Keyboard, mouse plus Keyboard, mouse plus pen, ink, and speech pen, ink, and speech input methodsinput methods
• Full .NET framework Full .NET framework preinstalledpreinstalled
• Pen, ink, handwriting Pen, ink, handwriting and speech recognition and speech recognition API’sAPI’s
Pocket PC Pocket PC PhonePhone
• Integrated PDA Integrated PDA with phonewith phone
• View and some View and some data entrydata entry
• Interoperability Interoperability with Office, with Office, Exchange and Exchange and SQL ServerSQL Server
• .NET compact .NET compact frameworkframework
SmartphoneSmartphone• Integrated Integrated
phone with PDAphone with PDA
• Data viewingData viewing
• Interoperability Interoperability with Exchangewith Exchange
• .NET compact .NET compact frameworkframework
Smart Smart Personal Personal ObjectsObjects
• One-way One-way networknetwork
• Information Information consumptionconsumption
Panoramica su Windows CE Panoramica su Windows CE Win CE, Pocket PC, Windows Mobile, Cosa Win CE, Pocket PC, Windows Mobile, Cosa
sono? sono? • Windows CE un OS ModulareWindows CE un OS Modulare• Windows CE 3.0 (CF Windows CE 3.0 (CF supportato solo su Pocket supportato solo su Pocket
PCPC))• Handheld PC 2000 Handheld PC 2000
(CF (CF non è supportatonon è supportato))• Windows CE .NET 4.2Windows CE .NET 4.2• Windows for Pocket PC 2000-2002 Windows for Pocket PC 2000-2002
((basato su Windows CE 3.0basato su Windows CE 3.0))• Windows Mobile 2003 (Windows Mobile 2003 (basato su CE .NET 4.2basato su CE .NET 4.2) ) • Windows Mobile 2003 SE (Windows Mobile 2003 SE (basato su CE .NET basato su CE .NET
4.214.21))
RoadmapRoadmap20022002 20032003 20042004 20052005
Pocket PCPocket PCSmartphoneSmartphone PPC 2002PPC 2002 SP 2002SP 2002 WM 2003WM 2003 WM 2003 SEWM 2003 SE WM 2005WM 2005
VisualVisualStudioStudio Visual Visual
Studio Studio 20032003
Visual Visual Studio Studio 20052005
Windows CEWindows CE3.03.0 4.24.2 5.05.0
.NET Compact .NET Compact FrameworkFramework
4.14.1
1.01.0 SizeSize PortabilityPortability CompatibilityCompatibility
(redist)(redist)
1.0 SP11.0 SP1 SmartphoneSmartphone
1.0 SP21.0 SP2 Perf updatePerf update LandscapeLandscape AutoscrollAutoscroll Bug fixesBug fixes
2.02.0 GenericsGenerics COM interopCOM interop ControlsControls MD3DMMD3DM PerformancePerformance
(redist)(redist)
1.0 SP31.0 SP3 Bug fixesBug fixes
Features delle varie versioniFeatures delle varie versioni
• Windows CE (la base)Windows CE (la base)una shell stile windows…non sempre una shell stile windows…non sempre
utilizzabileutilizzabile• Pocket PCPocket PC
una shell specificauna shell specifica• Pocket PC Phone EditionPocket PC Phone Edition• SmartphoneSmartphone
HardwareHardware
• Processori: Processori: ARM, StrongARM, MIPS, Intel PXA, ARM, StrongARM, MIPS, Intel PXA,
SH3, ecc.SH3, ecc.
• Comunicazione: Comunicazione: IrDA, Bluetooth, USB, SerialeIrDA, Bluetooth, USB, Seriale
• Memoria: Memoria: RAM-ROM, SD, CF (RAM-ROM, SD, CF (esecuzione diretta dalla esecuzione diretta dalla
ROMROM) )
Visual Studio 2003Visual Studio 2003Tipologie di progettoTipologie di progetto
• PocketPC, CE.NET e Smartphone: DifferenzePocketPC, CE.NET e Smartphone: DifferenzeApplicazioni console, in PocketPC e SP non sono supportate Applicazioni console, in PocketPC e SP non sono supportate (occorre caricare manualmente la console.dll)(occorre caricare manualmente la console.dll)Si possono creare applicazioni senza UISi possono creare applicazioni senza UI
Diverso posizionamento e gestione dei Diverso posizionamento e gestione dei controllicontrolli Attenzione al ClientRectangle con CEAttenzione al ClientRectangle con CE
• MenuMenu• Toolbar (Toolbar (no Smartphoneno Smartphone))• Tab Control (Tab Control (su Smartphone ListView+Formssu Smartphone ListView+Forms))• ListView, TreeView (ListView, TreeView (SmartphoneSmartphone))
Visual Studio 2003Visual Studio 2003Architettura di un progettoArchitettura di un progetto
• Piattaforme supportatePiattaforme supportate
Project PropertiesProject PropertiesOutput File FolderOutput File FolderDeployment DeviceDeployment Device
Device OptionsDevice Options
DEMO #1DEMO #1PProgetti PocketPC, CE.NET, rogetti PocketPC, CE.NET,
SmartphoneSmartphone
DEMO #1DEMO #1PProgetti PocketPC, CE.NET, rogetti PocketPC, CE.NET,
SmartphoneSmartphone
StrumentiStrumenti
• Compact Framework SDKCompact Framework SDKC:\C:\ProgrammiProgrammi\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK
• SDKsSDKsPocket PC 2003 SDK + Emulators 2003 SEPocket PC 2003 SDK + Emulators 2003 SESmartphone 2003 SDKSmartphone 2003 SDK + Emulators 2003 SE+ Emulators 2003 SE
• ToolsToolsPower Toys Power Toys C:C:\\ProgrammiProgrammi\Windows Mobile Developer Power Toys\Windows Mobile Developer Power Toys
Remote Tools Remote Tools C:\C:\ProgrammiProgrammi\Windows CE Tools\Common\\Windows CE Tools\Common\PlatmanPlatman\bin\bin
Windows CE Utilities Windows CE Utilities ((debug su custom CE devicesdebug su custom CE devices))
C:\Programmi\Microsoft Visual Studio .NET 2003\C:\Programmi\Microsoft Visual Studio .NET 2003\CompactFrameworkSDKCompactFrameworkSDK
C:\Programmi\Windows CE ToolsC:\Programmi\Windows CE Tools
C:\Programmi\Windows Mobile Developer Power ToysC:\Programmi\Windows Mobile Developer Power Toys
C:\Programmi\Windows CE Tools\Common\Platman\binC:\Programmi\Windows CE Tools\Common\Platman\bin
DEMO #2 ToolsDEMO #2 ToolsDEMO #2 ToolsDEMO #2 Tools
Differenze con la versione FullDifferenze con la versione Full .NET CF è un sottoinsieme della versione Full.NET CF è un sottoinsieme della versione Full
DifferenzeDifferenze• Tipi (Tipi (molte classi sono state omessemolte classi sono state omesse))• Method Overloads (Method Overloads (molti Overloads sono stati tralasciatimolti Overloads sono stati tralasciati) ) • Web Services (Web Services (solo clientsolo client))• NGen (manca)NGen (manca)
Namespaces mancantiNamespaces mancanti• Classi legate alla stampa (Classi legate alla stampa (Crystal, PrintDialog, etc.Crystal, PrintDialog, etc.))• System.Xml.XPath namespace ed Extensible Stylesheet Language System.Xml.XPath namespace ed Extensible Stylesheet Language
Transformation (XSLT)Transformation (XSLT)• Binary SerializationBinary Serialization• Microsoft.Win32.Registry namespaceMicrosoft.Win32.Registry namespace• COM InteropCOM Interop• GDI+GDI+• RemotingRemoting
LinguaggiLinguaggi• per ora solo C# e VB.NETper ora solo C# e VB.NET
Il codice è sempre IL compilato a runtime con il JIT, esiste la GACIl codice è sempre IL compilato a runtime con il JIT, esiste la GAC
Namespaces e tipi specifici del Namespaces e tipi specifici del CFCF
• System.Net.IrDA namespaceSystem.Net.IrDA namespace• System.Data.SqlServerCeSystem.Data.SqlServerCe• System.SRSystem.SR• <System.Windows.Forms.DataGrid.dll><System.Windows.Forms.DataGrid.dll>• Microsoft.WindowsCE.Forms.dllMicrosoft.WindowsCE.Forms.dll• Input PanelInput Panel
• Bluetooth purtroppo assenteBluetooth purtroppo assente• Class Library Comparison ToolClass Library Comparison Tool
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dv_spchk/html/NET_Compact_Framework.htmms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dv_spchk/html/NET_Compact_Framework.htm
Windows FormsWindows Forms.NET Compact Framework 1.x.NET Compact Framework 1.x
• Controlli supportati e nonControlli supportati e non• TabIndex, TabStopTabIndex, TabStop• Gestione dell’Input PanelGestione dell’Input Panel• Activation e Deactivation (Activation e Deactivation (Pocket PCPocket PC))• Common dialogsCommon dialogs
OpenFileDialog, SaveFileDialog: solo un livello sotto My OpenFileDialog, SaveFileDialog: solo un livello sotto My DocumentsDocumentsColorDialog, FontDialog: non sono supportateColorDialog, FontDialog: non sono supportateSmartphone: non sono supportateSmartphone: non sono supportate
• Custom ControlsCustom Controls• Data BindingData Binding
DEMO #3DEMO #3Win Forms, TabIndex, InputPanel, Win Forms, TabIndex, InputPanel,
Activation-DeactivationActivation-Deactivation
DEMO #3DEMO #3Win Forms, TabIndex, InputPanel, Win Forms, TabIndex, InputPanel,
Activation-DeactivationActivation-Deactivation
Accesso ai datiAccesso ai dati• Locale con XMLLocale con XML• Files, StreamsFiles, Streams
File, FileInfo, Directory, DirectoryInfoFile, FileInfo, Directory, DirectoryInfoBinaryReader/Writer, StreamReader/Writer, BinaryReader/Writer, StreamReader/Writer, FileStream, NetworkStream, MemoryStream, FileStream, NetworkStream, MemoryStream, StringReader/WriterStringReader/Writer
• Encodings, System.Text.EncodingEncodings, System.Text.Encoding• Remoto con WebRequest (Remoto con WebRequest (HttpWebRequestHttpWebRequest))• Remoto con Web ServicesRemoto con Web Services• Locale con SQL CELocale con SQL CE• Remoto con SQL Server 2000Remoto con SQL Server 2000• RDARDA
DEMO #4DEMO #4Lettura files e DataBindingLettura files e DataBinding
DEMO #4DEMO #4Lettura files e DataBindingLettura files e DataBinding
Configurazione ambiente Configurazione ambiente di sviluppo e Debugdi sviluppo e Debug
• Emulatore, configurazione per accesso Emulatore, configurazione per accesso alla rete e al weballa rete e al web
• Loopback adapterLoopback adapter• Debug e Trace, limiti con CFDebug e Trace, limiti con CF• ActiveSyncActiveSync
3.5 fino a CE 4.1, 3.7 fino a CE 4.2, 4.0 per CE 5.03.5 fino a CE 4.1, 3.7 fino a CE 4.2, 4.0 per CE 5.0
DEMO #5DEMO #5Configurazione ambiente di sviluppoConfigurazione ambiente di sviluppo
DEMO #5DEMO #5Configurazione ambiente di sviluppoConfigurazione ambiente di sviluppo
© 2004 Microsoft Corporation. All rights reserved.© 2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.Content created by 3 Leaf SolutionsContent created by 3 Leaf Solutions