Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing Mobile Applications

Similar presentations


Presentation on theme: "Developing Mobile Applications"— Presentation transcript:

1

2 Developing Mobile Applications
Tim Heuer Immedient Bert Solano

3 Agenda Mobile Overview VS .NET Features Data Storage Options
Tips and Tricks

4 CE Devices are available

5 Mobile vs. Wireless Mobile Architectures Wireless
Application can function in a vacuum “Synchronize When You Can” Wireless Tethered to the data source, just like wired, only we use wireless WiFi, CDPD, GPRS, Prone to problems Mobile Apps leverage Wireless Wireless is NOT Mobile

6 Goal for a Mobile App Can your user function from the bottom of the ocean? (… with a waterproof device) Is your application as reliable as their paper notebook? Take advantage of the internet, don’t depend on it.

7 Compatibility Challenges
Many different device types Different form-factors Human interface choices Connectivity choices WiFi Network Cradle Compact Flash WWan Desktop Cradle Infra Red On-device resources vary widely ROM/RAM capacity File system Battery life

8 Mobile Development Environment
Single set of familiar productive tools for all development Server components Rich client applications Mobile Web development Building Web services Consuming Web services Easily take advantage of all Microsoft mobile platform assets

9 Mobile Development Approaches
Application on device Device specific Fewer devices Offline options Richest UI Client Application Application on server Runs in browser Many devices Online only Less UI choice Easy to deploy Web Application

10 Mobile Development Tools
Today Visual Studio & NET Compact Framework Client Application Embedded Visual Tools eVB and eVC++ Device-specific Active Server Pages Visual Studio & Mobile Internet Toolkit Web Application

11 Mobile Internet Toolkit
Components Mobile controls Mobile designer Rich device identification Rapidly develop Mobile Web Applications Powerful and flexible Easy to customize and extend For future devices

12 Mobile Controls Render based on device capabilities
Automatically output multiple markup languages Built upon ASP.NET control base classes Common controls: Label TextView Link Calendar

13 .NET Compact Framework Smart Device Extensions
A subset of the .NET Framework Same programming model Same security as desktop programming model Lightweight and Resource Efficient RAM Battery and CPU usage Flash and ROM Rich PocketPC Functionality Windows Forms (WinForms) ADO.NET Data Access XML Web Services Client

14 Common Language Runtime
With Windows CE Windows CE Device Windows UI Standard Windows look and feel Forms-based UI All the standard controls Significant subset for small size XML Web Services Windows NT® network integration Data Access Local data (offline) Remote data (online) Simple structured files (text) XML Web Services Windows Forms Data and XML Base Class Library Common Language Runtime Take advantage of Windows richness

15 Device Compatibility .Net Compact Framework
Faithful implementation of Standard CLI Core types and methods + device extensions Subset of .Net framework appropriate to smart device development Microsoft Full .NET Framework Desktop Microsoft .NET Compact Framework Pocket PC (CE) Microsoft .NET Compact Framework Smart Phone ISO/IEC 23271:2002 / ECMA 335 Common Language Infrastructure Microsoft Windows CE Extensions IRDA, Barcode Scanner, etc

16 It’s All About Balance (Developer Perspective)
This is NOT the desktop, think 100mhz Features Amount of Data Garbage Collection Data Entry/Selection Performance Memory Usage Data, Objects Connectivity

17 Device Databases

18 Microsoft Strategy Scalable Solutions
Server, Desktop, Tablet PC SQL Server } MSDE SQL Server CE CE Platform

19 SQL Server CE (SQL CE) Database for the CE / Pocket PC Platform
Similar programming style to SQL Server Limitations are more device then SQL/CE 1 Connection/ Database, (usually not a problem) Multiple Databases per device No Stored procs Use cached DataCommands Referential Integrity with cascading updates/Deletes Stand alone, or replicate/sync with SQL Server SQL Server not required, but best match SQL Server CE 2.0 designed for .NET Compact Framework (System.Data.SqlServerCe) Replacement of Pocket Access, just like DBF/Access

20 CE Data Access Storage Architecture
.NET CF / Managed Stack VS .NET (VB.NET, C#) Native/Unmanaged Stack eVB 3.0 eVC 3.0 ADO.NET Ethernet SQL Server CE Data Provider SQL Server Client Data Provider TDS ADO CE v3.1 Well Connected CLR / .NET CF OLEDB CE OLEDB / Replication API 802.11b, CDPD, GSM, CDMA, TDMA, etc. SQL CE Edition v2.0 Data Provider Client Agent: Replication and RDA IIS Server Agent: Replication and Remote Data Access OLEDB QP/Cursor Engine/ES OLEDB HTTP Storage Engine / Repl Tracking Occasionally Connected CLIENT SERVER

21 Setting up SQL CE Replication
Basic Replication setup + Install SQL CE Replication Tools Test connectivity from device Localhost won’t work NETBIOS name may not work (WINS Resolution) Test with IP or Fully Qualified Domain Name If you don’t get this response from the DLL, don’t go any further

22 SQL / CE – Data Transfer Multiple Techniques
RDA system.Data.SqlServerCe.SqlCeRemoteDataAccess Great for semi-connected environments, large data transfers Merge Replication Over IIS System.Data.SqlServerCe.SqlCeReplication Great for managing concurrency ADO.net System.Data.SqlClient.SqlCommand Can call SQL Server directly, but not a great idea…* (*Not a Mobile Architecture) Web Services Great when concurrency isn’t an issue, or server isn’t SQL

23 Supported ADO .NET And XML Classes On .NET CF
XmlDocument DataView XmlReader DataSet XmlWriter SqlDataReader SqlCeDataReader SqlDataAdapter SqlCeDataAdapter SqlCommand SqlCeCommand SqlConnection SqlCeConnection .NET Data Provider for SQL Server .NET Data Provider for SQL CE XML File

24 Parsing Exceptions public static void ShowErrors(SqlCeException se) {
SqlCeErrorCollection errorCollection = se.Errors; StringBuilder exInfo= new StringBuilder(); Exception inner = se.InnerException; foreach (SqlCeError err in errorCollection) exceptionDetailStringBuilder.Append("\n Error Code: " + err.HResult.ToString("X")); exceptionDetailStringBuilder.Append("\n Message : " + err.Message); exceptionDetailStringBuilder.Append("\n Minor Err.: " + err.NativeError); exceptionDetailStringBuilder.Append("\n Source : " + err.Source); foreach (int numPar in err.NumericErrorParameters) if (0 != numPar) exceptionDetailStringBuilder.Append("\n Num. Par. : " + numPar); } foreach (string errPar in err.ErrorParameters) if (String.Empty != errPar) exceptionDetailStringBuilder.Append("\n Err. Par. : " + errPar); MessageBox.Show(exceptionDetailStringBuilder.ToString()); exceptionDetailStringBuilder.Remove(0, exceptionDetailStringBuilder.Length);

25 Mobile Application

26 Tips and Tricks Always think Performance, …always
Test performance on everything Get the actual device Design and Proof of Concept EVERYTHING Get a wireless Lan for debugging Reuse everything you can Database optimization is KEY Don’t assume flat is good. Balance of normalization is good Don’t assume your .sdf needs to have the same structure as the server

27 Tips and Tricks This is NOT a 1.8GHZ Processor
Think 100MHZ Be kind to your environment Reuse Everything Pre-Load Data Use DataSets to cache data …more to come… Save Forms that will be used again Use a forms collection that caches forms Toss objects that you don’t use often Don’t try to load 9 MB of data onto a device with 8 MB of RAM protected override void OnClosing(CancelEventArgs e) { this.Save(); e.Cancel = true; this.Hide(); base.OnClosing (e); }

28 Resources Newsgroups: http://www.gotdotnet.com/team/netcf SQL CE
microsoft.public.dotnet.framework.compactframework SQL CE Article on Setting up a sample Replication and RDA

29 Q & A

30


Download ppt "Developing Mobile Applications"

Similar presentations


Ads by Google