300 likes | 526 Views
Mobile Affairs. Doing business anywhere!. Agenda. Solution Architecture Solution Components Actors Developer Story NAVmobile SDK (mobile development) Dynamics NAV Development. Solution architecture. Other sources. Mobile Sync Services. Solution Components. Mobile Application
E N D
Mobile Affairs Doing business anywhere!
Agenda • Solution Architecture • Solution Components • Actors • Developer Story • NAVmobile SDK (mobile development) • Dynamics NAV Development
Solution architecture Other sources Mobile Sync Services
Solution Components • Mobile Application • Mobile Core • Mobile Modules • Synchronization Server (a.k.a. NAVmobile Services) • NAVmobile Addon for Microsoft Dynamics NAV
Actors • Mobile Developer • Uses the NAVmobile SDK and Visual Studio 2008 • Dynamics NAV (C/AL) Developer • Uses the Dynamics NAV Development Environment and NAVmobile objects • Mobile user • Uses the NAVmobile Mobile Application (and mobile device) • System Administrator • Uses the NAVmobile Services Web Admin Console • Uses Dynamics NAV Client • System Vendor ( Partner ) • Uses the NAVmobile Services Web Admin Console • Uses Dynamics NAV Client
Developer story The mobile developers can: • develop mobile modules using NAVmobile SDK/.NET CF • upload new module versions in test status • upload new module versions in production status • configure devices and roles in test or production status
Developer story The NAV developers can: • modify the NAV synchronization process using C/AL • Define new types of inbound and outbound data • Create/modify business logic for inbound data • Create/modify business logic for outbound data • Partition outbound data by device, device roles and others • Introduce new forms/tables/fields
Administrator story The administrators can perform the following (remote): • Upload new module versions on the server per device role • Install new NAVmobile mobile modules • Configure the mobile modules per device or role • Provision devices through OMA Client Provisioning • Deploy new files on the device • Install third party apps on the device • Sending a text message to the device* • Monitor and analyze the system behavior • Review device information ( device logs, server logs) • Assign device roles, block devices
NAVmobile SDK - overview MODULE: set of business objects, views (User Interface), business logic components and tasks
Architecture Provisioning SyncLog Notification Security Remote Storage (SQL) Live Data Link NAVmobile Services BackEnd Agent ERP ( NAV) IIS/ASP.NET HTTP Mobile Device Communication Mobile Database Data Access Data Synchronization Security Provisioning Instrumentation User Module Configuration Storage Config API User Experience User Workflow Microsoft .NET Compact Framework
SDK Overview A set of .NET CF classes providing the following services: • User Experience • Data Access ( off-line and on-line support) • Automatic bi-directional data synchronization • Configuration • Logging • Template based printing • Barcode scanner support • Automatic module version update • Device Provisioning
User Experience Task : mini workflow containing steps (User Controls) and routes (user interactions/events). User interactions causes the system to navigate to the another step by following specific route.
User Experience Any .NET CF UI Library can be used Step title Click event can be ‘mapped’ to route NEXT Step options Mapped to NEXT route Mapped to PRIOR route
User Experience • User Interface based on ‘tasks’. • Each task is a mini workflow containing steps and routes • Task workflow is defined in a special XML file (IT.WF.xml) • Each step defined in the workflow corresponds to .NET CF User Control inherited from a special ‘ViewBase’ class • The ‘ViewBase’ class has a well defined life cycle to allow the framework to balance between performance and memory load • Third party CF.NET User interface libraries are welcome • Developer can navigate between steps by using ‘routes’UIProcessManager.Navigate(‘scan’);
NAVmobile SDK – Data Access • The mobile application provides the following data access options • Local (on-device ) data access through ORM style API • Local (on-device ) data access through ADO.NET and SQL • Remote data access through ORM style API (Live Data Link ) • Any other .NET CF supported data access options can be used Mobile Storage User Code Remote Storage Sync Server (Live Data Link)
NAVmobile SDK – Local Data Access • The mobile app provides mobile ‘SQL’ storage • Developer defines a business object by inherit from ‘BusinessObjectBase’ class. • Developer describe the business object in a special xml file ( IT.BO.xml) including unique version number. • The system automatically provision the mobile db based on the business object descriptions(database schema update ) • Data is automatically synchronized with NAV based on the business object descriptions and NAV table mappings IList<Customer> cust= BusinessObjectBase.Find<Customer>('[CreditLimit]>100');
Data Syncrhonization Sync Log Sync Packet Policy Device Roles Sync Packet Policy Devices Sync Packet Policy Device Mobile Modules Sync Packet Sync Packet Agents Agents Sync Packet Agents Sync Packet NAVmobile Services ERP ERP ERP
Data Syncrhonization NAS Device Roles Sync Log Sync Packet Devices Sync Packet C/AL Sync Packet Mappings Agent Sync Packet Sync Packet Sync Packet Sync Packet Dynamics NAV
Data Syncrhonization • The Data Synchronization feature allows the device to automatically extract data from NAV and store it locally for use through the local data access APIs. The device also sends data to NAV. • The NAVmobile Services implement store-and-forward pattern around the NAVmobile Services SyncLog: • SyncLog stores SyncPacket based messages from devices and NAV • Extracts data from NAV and store it in the SyncLog (message queue) • Extracts data from the devices during the sync sessions and store it in the SyncLog • Send stored data to devices and NAV, based on ‘rules’ (a.k.a. Sync Policy) • The user can launch manually the Sync process • NAVmobile Device Agent can launch the Sync process
Remote Data Access • NAVmobile Services exposes HTTP/SOAP service called Live Data Link to allow devices to query MS SQL Server Databases • NAVmobile SDK provides ORM style API for easier Live Data Link access. • Developer defines a business object by inherit from ‘BusinessObjectBase’ class. • Developer describe the business object in a special xml file including unique version number • Developer/admin uploads the latest module on the server IList<Customer> cust= LiveDataLinkService.Find<Customer>('[CreditLimit]>100');
Remote Data Access • Devices can send any business object to the NAV SyncLog for processing by NAS //fetch business object from NAV database by primary keyPutAwayHeader pa = LiveDataLinkService.FetchEntity<PutAway>(‘233’); //modify the PuAwaybusines object instance in memory…//create XML SyncPacket from the business objectStringBuilderpacket = new StringBuilder();SyncTableDAO.BeginSyncPacket(context, packet); SyncTableDAO.EmbedEntityToSyncPacket(context, packet, pa);SyncTableDAO.EndSyncPacket(context, packet);//sending the SyncPacket for NAS processingLiveDataLinkServices.PostToSyncLog(packet);
Configuration API • Mobile modules behavior can be adjusted through settings: if(ConfigurationManager.Instance.Settings["PrintIsEnabled"]=="true") ASCIIPrinterHelper.PrintCustom("mytemplate.tmpl",null); • The settings and the corresponding behavior is designed by the developer • The settings can be defined by the admin from the server console per device or device role • The developer can also store settings locally on device ConfigurationManager.Instance.Settings["PrintIsEnabled"]="true“;ConfigurationManager.Instance.SaveSettings();
Logging API • Mobile modules behavior can log events on the device: LogManager.Instance.LogInfo(“data fetch completed"); // log information in the log fileLogManager.Instance.LogError(“error occured"); //log error in the log file LogManager.Instance.LogDebug(“debug messages are not included in Release mode"); LogManager.Instance.StartCounter(“My high-precisions timer");//start a high-precision timer LogManager.Instance.StopCounter();//emit the time between Start and Stop in miliseconds LogManager.Instance.LogMemory(“Launching my special routine"); // emit the text and current memory load • The events are stored in text files on the device • The log files are sent to NAVmobile Services on each sync session • The log files can be sent to NAVmobile Services in background from the NAVmobile Device Agent • The log files can be reviewed from the NAVmobile Services Admin Console
Printing API • Developer can use the NAVmobile Template Language to create document templates (invoices ,receipts, reports ,etc.) • Different templates can be sent to devices depending on their role • Templates can : • Consume local and remote data • Calculate formulas • Format output (fonts, alignments, data formatting, padding , etc) • Pass special commands to printers (EPSON, IBM or other emulation) • Developers can implement special interface ‘INAVmobilePrinter‘ to implement more complicated printer protocolsASCIIPrinterHelper.PrintCustom("mytemplate.tmpl",null);
Barcode scanner API • NAVmobile provide out-of-the box support for Motorola Devices equipped with barcode scanners • Developer can implement ‘IBarcodeScanner’ interface to implement utilize specific barcode scanner interface • The new implementation is setup from the server console through a special setting called ‘barcodescanner’ which specifies the actual class name //developers can switch on the scanner by calling:BarcodeScannerManager.BarcodeScanner.Start(ScanHandler)//implement barodescan handling methodprotected voidScanHandler(objectsender,BarcodeScnnerEvent e) { if (e.Data==“12345678”)MessageBox.Show(“Scanned!”); if (e.Barcodes[0].Name==“PickBarcode” && e.Barcodes[0].Segments[“quantity”].ToFloat()>0) PerformSomeAction(e.Barcodes[0].Segments[“item-id”].ToString(), e.Barcodes[0].Segments[“quantity”].ToFloat() ); } //and turn it off by calling: BarcodeScannerManager.BarcodeScanner.Stop();
Module Version Update • NAVmobile provide out-of-the box automatic update for mobile modules • The update is performed (if needed) on each synchronization session started from the mobile user • Update can be performed in background from the NAVmobile Device Agent • The developer only needs to maintain the version number of the module • Modules can be updated/deployed on the devices depending on their roles
Notification Services • NAVmobile Services expose a special set of operations part of the Live Data Link engine known as Notification Services • The NAVmobile Services maintains a notification message queue • Devices can receive notifications through a message push based approach via HTTP/HTTPS • Notifications can alert the device for available updates, data changes, new module versions and others • Developers can define and use their custom notifications • NAV C/AL can prepare SyncPackets containing notification messages to devices • Device Agent uses Notification Services in order to receive interesting events. string payload = LiveDataLinkService.ReceiveNotifications();XmlDocument doc = newXmlDocument();doc.LoadXml(payload);XmlNodeListnodes = doc.SelectNodes("notifications/notification");foreach (XmlNode node in nodes){ …}
Device Agent • NAVmobile Device Agent operates in background on the device to provide: • Downloading and installing of new module versions • Fetching of new configuration settings from NAVmobile Services • Receiving and displaying of user messages on the device screen • Background data sending (when the data was not sent due to limited connectivity) NOTE:The Device Agent is notified for interesting events (new data, new module versions, etc.) via the NAVmobile Device Notification Services in order to perform alert push alike feature for the devices.
NAV Side • NAVmobileAddon • NAV Tables to Mobile Business Objects Mapping • Handlers (C/AL) for bi-directional synchronization based on XML messages – a.k.a. SyncPackets hosted in NAS • Filtering of the extracted data per device and/or device role • Queue based transactional mechanism for SyncPacket processing • Support for multiple companies and databases
Thank you for your time www.mobile-affairs.com sales@mobile-affairs.com