The Xactimate Insurance App: Bringing 10,000,000 Lines of Code to Mobile, Nick Sykes and Trent GundersenPresentation Transcript
Nick Sykes, Director of Mobile Projects Trent Gundersen, Android Development Lead 10,000,000 Lines of Code to Mobile
1986 27 Years Ago…
1986 27 Years Ago…
Orem, Utah • 19 of the top 25 US insurance carriers • 80% of US homeowner property claims • 7 of the top 10 US independent adjusOng ﬁrms
London, England • Each day 14,000 property claims processed • Over 31.5 million property claims processed
2014• New 210,000 square foot campus • Fitness Center, Beach Volleyball, and Basketball Courts
COLLAPSE COLLISION EARTH MOVEMENT EARTHQUAKE FIRE FREEZING HAIL HURRICANE LIGHTNING SMOKE STRUCTURAL DEFECT THEFT VANDALISM WATER WIND
Super Storm Sandy, 2012
Super Storm Sandy, 2012$25.0 Billion
Super Storm Sandy, 2012400,000claims assigned in days
Hurricane Katrina, 2005
Hurricane Katrina, 2005$48.7 Billion
Xactware Customers Want Mobile • We tried mobile a few Omes… – Apple Newton – Windows Mobile – XP Tablet EdiOon – Blackberry – iOS (naOve objecOve C) • Too much overhead and customer maintenance • Finally a shared iOS and Android version
User’s Mobile Experience • Why do they want a mobile soluOon? • What makes sense? • Don’t try to include everything • Desktop applicaOon without a mouse and keyboard.
Mobile Devices • Keeping up with new devices • FragmentaOon • When to force an upgrade of hardware • Internal tesOng device budget
Why We Chose1. UOlize exisOng, complex codebase 2. Same calculaOons across plaiorms 3. Speed of deployment 4. .NET developer recruitment 5. TransiOon and training of developers 6. RelaOonship with Xamarin
How We Started • Created a new mobile soluOon – Learned later on we needed 2 soluOons • One for each plaiorm Android and iOS – Xamarin.iOS libraries are not compaOble on Android – Decided what assemblies we needed. – Started adding empty projects and then adding in ﬁles to them and compiling – Added needed references and dependent assemblies and classes – Got everything compiling as a ﬁrst step, nothing visual yet.
Project Structure • We created two soluOons – iOS and Android – Custom build commands to replace the AndroidManifest.xml to have to separate package names
Sketch Interface ImplementaMon • Created a test setup environment for our Sketch applicaOon • Implemented Drawing class for sketch • Used mouse click events and connected to touch events and touched the screen – Jumped up and down in excitement because 20 years of code was now running on iOS and android
iOS CompilaMon • Edge Cases: – Assembly size – We ran into a case where we could not compile an assembly because we exceeded the gcc limit – we had to split the assembly.
Memory Management • Windows Desktop applicaOons don’t worry about memory like you need to on Mobile devices. This is a large concern porOng huge code bases to mobile – Events • Must release them. += must be followed with -‐=, this will kill you • NaOve Controls – iOS – UITextView and all naOve controls, you must dispose them explicitly.
2 GC Systems on Android • Use structs instead of classes when your system is allocaOng thousands of objects per second. The GC can’t keep up
GC on iOS • We had to explicitly call collect in a few cases to keep performance up • We had to increase the number of trampolines • Mixed library using naOve objecOve c librarys are really hard to debug, Just don’t do it unless you have to.
Preprocess DirecMves • We had to use liberal amounts of #if !MONO throughout the code base to remove non .net pieces of our desktop applicaOon
Lucene • It overﬂows on purpose – Change the compiler to not care about overﬂows otherwise it will crash randomly in places that do not make any sense. Total garbage call stacks.