4. C# and .NET
• C#, the language.
• .NET, the platform.
5. Understand .NET
• It’s a framework, platform & environment not
language
– You build code using .NET framework (equals
.NET libraries)
– The code runs on the .NET platform (in the CLR)
– You need to install .NET environment (.NET
framework redistributable)
7. C# vs Java
• Both are good, better and best on their
own aspects.
• C# has continued to evolve and emerging.
• C# is faster than Java on Windows kernel,
while Java can run on any – Before 2004.
• Now C# can run on any – Thanks Mono.
8. Wait.. an interesting statData types Java C#
Single-root (unified) type system No; but wrapper types Yes[1]
Signed integers Yes; 8, 16, 32, 64 bits Yes; 8, 16, 32, 64 bits
Unsigned integers No; but some method support.[2]
Yes; 8, 16, 32, 64 bits
Character Yes[3]
Yes
Date/time Yes; reference type[4]
Yes; value type
IEEE 754 binary32 floating point number Yes Yes
IEEE 754 binary64 floating point number Yes Yes
Boolean type Yes Yes
High precision decimal number No; but see 'Arbitrary size decimals' below 128-bit (28 digits) Decimal type
Arbitrary size decimals Reference type; no operators[5]
No
Strings Immutable reference type, Unicode Immutable reference type, Unicode
Arbitrary size integers Reference type; no operators Yes[6]
Complex numbers No Yes
Reference types Yes Yes
Arrays Yes[7]
Yes
Value types No; only primitive types Yes
Type annotations Yes Yes
Enumerated types Yes; reference type Yes; scalar
Lifted (nullable) types No; but wrapper types Yes
Tuples No; limited 3rd party available.[8]
No; but standard library support with limited arity
Pointers No;[9]
only method references [10]
Yes[11]
11. You could become a
better mobile app
developer solution
developer.
12. Major platforms
Platform NativeLanguage Cloud & Push Services
iOS Objective C, Swift iCloud, APN
Android Java Google Play Games,
Google Fit, Google
Cloud, GPN…. And more
Windows Phone C#, C++, F# Azure, WPNS
14. Silo approach
• The present approach adopted by 90%
of the app dev companies.
• Separate teams for separate platforms
for the same app.
• Can achieve true nativity.
• Costly.
• Ex – Facebook, Twitter, Foursquare apps
in iOS, Android and Windows Phone.
15. HTML5 approach
• Bit earlier approach.
• How many of us remember the awful
Facebook app for Android in 2009.
• In Sri Lanka, most people do this kind
of silly work.
• Very low cost.
• Even Microsoft gave a big support to
this until last year.
• Now mostly they support native.
(and still this)
• Ex – Yamu.lk, some good games.
17. HTML5 approach
No magic..!
Generate a HTML5
web page
Make an
(Android/iOS/WP)
app with WebView
control
Load the web page
created on the
WebView and
deliver the app..
18. Xamarin approach
• Real definition of Cross platform.
• Share the same code & logic
among platforms.
• The FUTURE of mobile
programming.
• Being adopted rapidly.
• NATIVE.. NATIVE.. NATIVE..
• Low Cost.
• Robustness maintained.
Xamarin C# Shared
backend
{iOS}
C# UI
{Android}
C# UI
{Windows}
C# UI
You build code using .NET framework (equals .NET libraries)
The code runs on the .NET platform (in the CLR)
You need to install .NET environment (.NET framework redistributable)
Since HTML 5 and JS, AWS and Azure support JS mobile services.
When it comes to cloud, Xamarin has its own cloud service and own testing service as well. But since C# is the shared language we can use Azure as comparing to Azure Xamarin cloud is bit expensive.
.Phone – the namespace has classes for background task and native picture decosing
.networking – networking related api, contains classes to control hostname, ip and more
.storage – provide classes to store and open files from the device’s storage and SD card
.foundation – control windows runtime fundamentals, control async tasks and working with images and URIs
.devices - Contains information related to the hardware of Windows Phone devices.
System.Net… those are for C# and they are common to all platforms..
We call these are frameworks.. Like namespaces for Windows C#
Mapkit - provides an interface for embedding maps directly into your own windows and views. Provide supports to adding overlays, and performing reverse-geocoding lookups to determine placemark information for a given map coordinate.
Uikit - provides the window and view architecture needed to manage an app’s user interface, the event handling and app model
iBeacon - iBeacon is the trademark for an indoor positioning system
Coregraphics – frameworkd for rendering graphics
Coremotion - receive motion data from device hardware
Tts – tts
Action bar – like a title bar for app, determne where user is in the app and give him support.
Printing Framework – a framework that support hardcopy printing
Renderscript - RenderScript provides a platform-independent computation engine that operates at the native level. Use it to accelerate your apps that require extensive computational horsepower.
Remember iOS and Android has 100% ported APIs to Xamarin.
IL Code stands for Intermediate Language Code. It is a CPU independent partially compiled code.
JIT stands for Just In Timer Compiler. It is the internal compiler of .NET which takes IL code from CLR and executes it to machine specific instructions.
Next slide is.. The answer to Java peeps…
What matters at the end of the day is (press enter now) BIG O.. The faster your code runs…