The mobile device offers great potential for enhancing customer service, reducing risk or improving productivity. To be effective, however, any application or mobile interface must accommodate the wide range of differing manufacturers and diverse operating systems.
Mobile Development Specialist, Ross Dargan covers how to write a cross platform application using c#. He demonstrates how easily you can target iOS, Android and Windows phone 8 using tools you will already be familiar with as a c# developer. Ross explains how to use good coding techniques to ensure a high amount of code reuse for both the back end core logic, and the front end user interface.
7. Xamarin
• C# and .NET for Android, iOS and Mac
• Full native APIs
8. The bad…
•
•
•
•
Price $2000 per dev per year
Still need a mac
Write once, run (and test!) everywhere
Tooling is still a bit immature (but the
support is great!)
• Need to write each UI separately
15. File Linking
Pros
• Quick
Cons
• Messy code
• Progressively more
difficult to maintain as you
add implementations
• Very hard to test
• File linking is a PITA to
remember as you add
files
24. Dependency Injection
• Helps separate code (Single responsibility)
• Allows you to unit test’s discrete parts of
the implementation – no God classes
• You can inject in platform specific
implementations
• Inversion of Control allows you to swap
implementations easily
26. Dependency Injection
Pros
• Very loosely coupled
code (reuse)
• Unit tests are easy
• Single Responsibility
• Open/Closed
Cons
•
•
•
27.
28.
29. What are the downsides to using
Dependency Injection?
It can be dangerous for your career because it
may increase your overall knowledge of good API
design. Once you learn how proper loosely
coupled code can look like, it may turn out that you
will have to decline lots of job offers because you
would otherwise have to work with tightly
coupled legacy apps. Happens to me a lot :)
Source: http://bit.ly/com6aD
30. Dependency Injection
Pros
• Very loosely coupled
code (reuse)
• Unit tests are easy
• Single Responsibility
• Open/Closed
Cons
• More code
• Bloated constructors
36. Improving Code Reuse in 3 easy
ways
• Heavy use of dependency injection
– Allows different implementations for different
platforms
• Use PCLs (and file linking for the time
being)
• Use View Models to reuse presentation
code
37. 3 layers of win
MVVMCross
Xamarin
Visual Studio