Ecosystem Apps
INNOVATIVE CROSS-PLATFORM SOLUTIONS




                        Sergey Seletsky
                        Abiliton™ Senior Software Engineer
Agenda
1.        Why?
2.        What is an ecosystem?
3.        Problems?
4.        WinRT with HTML5 for other...
5.        Cross-platform frameworks
      •      Xamarin
      •      Titanium
      •      Portable apps
      •      AppMobi
6.        Specific integrated API
7.        Apps integration
8.        Apps Stores
9.        Ecosystem architecture
10.       Conclusions
What is an
ecosystem?
Enterprise App Ecosystem
  App Hub                                IT organization                    Windows Phone

                    1. Registration                        1. Device Enrollment


                    2. Signing Tools                       2. Get apps
                    3. Cert and
                    Enterprise ID
                                         1. Develop App
                                         2. Package and sign
Registration
1. Enterprise registers with App Hub     3. App Catalog
2. Enterprise downloads app tools
3. Microsoft notifies CA of pending      4. Create Token
    enterprise registration
4. Vets enterprise
5. CA checks that vetting is complete,
    and generates a certificate for
    enterprise
Why ?
Smartphone Market Share
                 Platforms




        Google   Apple   Microsoft   RIM
Native Wrappers
• Phonegap
• Titanium
• appMobi
• Create native apps using HTML5
• Provide API’s (Hooks to get out of the sandbox)
• Work across platforms (mostly)
• Can be submitted to app stores
Cross-Platform Devices
• Phones
  – iOS – iPhone, Touch
  – Android
  – Blackberry
  – Windows Phone 7
• Tablets
  – iPad
  – Android
Mobile Capabilities That Influence Apps
•   GeoLocation         •   Bluetooth
•   PIM Contacts        •   Calendar
•   Camera              •   Push
•   Barcode             •   Screen Rotation
•   Date/Time Picker    •   Native Maps
•   Native Menus        •   Alert
•   Tab Bar             •   Audio File Playback
•   Navigation Bar      •   Ringtones
•   Signature Capture   •   NFC
Cross-platform frameworks

 1. Xamarin
 2. Titanium
 3. Portable apps
 4. AppMobi
 5. PhoneGap
Xamarin
Asynchronous code before
MyApi.OnSomeMethod += () => {
      InvokeOnMainThread( (result) => {
           textView.Text = result;
  });
}

MyApi.SomeMethodAsync();
async/await


textView.Text = await MyApi.GetUrlAsync(

     “http://softserveinc.com”);
С# vs Objective-C
Objective-C:

// …
       [button addTarget:self
action:@selector(touchHandler:)
       forControlEvents:UIControlEventTouchUpInside];
// …

-(void) touchHandler:(id)sender {
       textView.text = @"some text";
}
С# vs Objective-C

C#:

btn.TouchUpInside += (s, e) => {
     textView.Text = "Clicked!";
};
C# vs Java
Java:

button.setOnClickListener(
     new View.OnClickListener() {
        public void onClick(View v) {
           textView.setText(“Clicked”);
        }
     }
);
C# vs Java

C#:

button.Click += (s, e) {
     textView.Text = “Clicked!”;
};
C# vs {0}
•   Simply
•   Cleaner
•   Develops very quickly
•   From Java sand pours
•   [[[[After Objective-C] world : square] as: very]
    and all: in the colon];
What is Monotouch

• Mono framework with AOT compilation for
  ARM processors and Bindings to Native API
• Code is written in C #
• UI is native tongue, through C # wrapper
• Development environment Visual Studio
Compilation process

• Compile your code, libraries, BCL, wrappers
  over native methods in IL
• You can use any language IL
• Converted into machine code using AOT
  compilation
• Added to app code with Mono Runtime and
  everything else
AOT vs JIT
• Usually in. Net and Mono native code
  generated at run - Just In Time compilation
• In iOS you can not compile code on JIT, only
  static linking
• But we already know the architecture (ARM)
  so you can compile the code in advance -
  Ahead Of Time compilation
Restrictions AOT
• No Emit, but remains Reflection
• Some specific designs will not work, because
  compiled on JIT
• Generic Virtual Methods
  – P/Invokes in Generic Types
  – Some LINQ expressions
Linking
• At time of compilation of IL BCL undertakes
  only code that is actually used
• Similarly, you can cut out unused code in
  their libraries
• Need to reduce the size of app
C# API
• Subscribe to Events
• Setting Properties
• Familiar names

var btn = new UIButton(new RectangleF(0, 0, 200, 80));
btn.Enabled = true;
btn.SetTitleColor(UIColor.FromRGB(255, 255, 0),
       UIControlState.Selected);
btn.TouchUpInside += delegate {
       // your code
};
window.Add(btn);
Wrappers over native methods

Monotouch:
• It all comes down to P/Invoke method
  objc_msgSend with the appropriate
  parameters
Mono for Android:
• Used JNI (Java Native Interface)
Wrappers over native methods
public virtual bool Enabled
{
           [Export("isEnabled")]
           get
           {
                      // …
                      return
Messaging.bool_objc_msgSend(base.Handle, UIControl.selIsEnabled);
           }
           [Export("setEnabled:")]
           set
           {
                      // …
                      Messaging.void_objc_msgSend_bool(base.Handle,
                  UIControl.selSetEnabled_, value);
         }
}
App Structure

• Virtually same in native app
• AppDelegate, UIWindows, ViewControllers
• To describe UI also uses nib files
Development environment – Visual Studio
Cross-platform
• Sharing in 30-60 percent of the code
• Combining basic mobile functionality
• There are various MVVM frameworks

    Xamarin                 Titanium           PhomeGap




   Shared   Specific       Shared   Specific   Shared   Specific
Use of opportunities of Windows OS


Win32 API
Vista Bridge
Windows Bridge
.NET Framework
  – Windows Presentation Foundation
  – Windows Communication Foundation
  – Windows Workflow Foundation
Windows 8 platform
Installation Store Apps
Transitions between states
                 App are given several   App is not notified
                   seconds to sleep




  User
                                                               Terminated
Launches                                 Low Resources
                                                                  App
  App

                 App is notified with
                     continued




  Splash
  screen                                         App not running
Process isolation
Language projection
IInspectable
                                                       C++ App
   IUnknown




                                      Projection
                                                            C#/VB App
   Object




                                      Projection


                                                   CLR
                                                            HTML App

                                      Projection


                                                   Chakra
                   Windows Metadata
IInspectable
                Collections
   IUnknown                                            C++ App

                                       STL-style
               IVector<T>              Projection

               IVectorView<T>
   Array
               IObservableVector<T>                          C#/VB App
                                      IEnumerable




                                                    CLR
                                        (T) style
                                       Projection
IInspectable
   IUnknown
                                                                 HTML App
               IMap<T>




                                                    Chakra
                                      JavaScript
                                      Projection
 Associative
               IMapView<T>
  Collection
               IObservableMap<T>
Asynchrony in Windows 8

• All that is more than 50 milliseconds –
  asynchronously
• Windows Runtime: IAsyncOperation<T>
• JavaScript: Promises
• C++: Parallel Patterns Library
• VB/C#: async /await
Threading




Windows
             Windows               Windows
   UI
              Object                Object
 Object




  App Code         App Code                  App Code
Architecture WinRT
                 Metro App
                                                        Language Support
                                                         (CLR, WinJS, CRT)

             Language projection


                UI      Pickers    Controls   Media         Web Host
                                                        (HTML, CSS, JavaScri
              XAML     Storage     Network      …               pt)
 Windows
Metadata &
Namespace                                     DirectX
                Windows Runtime Core                      Runtime Broker
                                              Win32


                         Windows Core
Runtime app
Your App



                                            Direct API calls

 Process.exe   WinRT APIs




                                                                    Core OS
                              Brokered API calls
                                                        Broker

  App Container + Signed
     & Validated code




                                                     AppXManifest
Brokered Objects
     RuntimeBroker.exe                         App




                                  Projection
                          Proxy
  Windows
Runtime Object
Windows Runtime APIs
                                                             User Interface

              HTML5/CSS                         XAML                 DirectX                   Controls             Data Binding


                       SVG                      Tiles                    Input                Accessibility               Printing


                             Devices                                                          Communications & Data

Geolocation            Portable          Sensors            NFC                   Contracts            Local & Cloud Storage                Web




                               Media                                                               Notifications      Streams



                                                                                  Memory
  Playback             Capture            PlayTo        Visual Effects                                 XML           Networking             SMS
                                                                                 Management




                                                             Fundamentals

Application Services         Threading/Timers       Memory Management            Authentication            Cryptography              Globalization
Sensors
                                        Accelerometer



                                         Gyroscope



                                          Compass
Agitation   Turn          Overturning


                                           Slope



                                            Light



In dark     Indoors       Outdoors       Orientation
Areas of integration

On Windows OS   Together      With cloud
Live tiles      Contracts :   Synchronization
Notifications                 app settings
                • Search
Contracts
                • Share       Live SDK
Settings
Print
…
Pop-up notifications
                     Toast Notifications
Show messages from apps and services outside the UI apps


Attract attention


Is disconnected


Allow the user to go directly to the section of the app


Initiated locally or from cloud
Windows Push Notification Service
                                                          Windows 8             Cloud Service

Serves pop-up notifications and update live tiles
external services
                                                             Metro
Tile updated and notifications are working even when         Style         2
not running app                                              App


Takes control of communications devices                          1                   3

                                                                                Windows Push
                                                                                 Notification
Scaled without you                                          Notification
                                                                                   Service
                                                              Client       3
                                                             Platform


Free


                                                    1.   Request for URL notification channel
                                                    2.   Service registration
                                                    3.   Notifications
Contracts - part of a large family

•   App to App Picking contract
•   Contact Picker
•   File activation
•   Play To contract
•   Print task settings
•   Protocol activation
•   Search contract
•   Settings contract
•   Share contract
How does this work
   Source app              Share Broker            Target apps


     Registration           User selected
 DataTransfer Manager         “Share”



Activation DataPackage    Filter apps or links       Activated



                          User has selected a       Processing
Asynchronous processing
                                target             DataPackage



                            App start-goal       Completion Report

DataPackage in source
        app
Unprecedented coverage
Income distribution

               70%
               new
               applications




               80%
               once you do
               $25,000
Best economy

 To generate $ 1 million profit
            Price: $4.99


     ~250,000 sales
0.05% users Windows from
 500+              Windows 7
Azure Service Bus
 • Unified set of messaging capabilities
     Consistent management and observation capabilities

 • Service Bus Relay
 •   Rich options for interconnecting apps across network
     boundaries

 • Service Bus Brokered Messaging
 •   Queuing, publish/subscribe

 • Easily build hybrid apps
 • Available as PaaS & on-premise server
Conclusions
Thank you!

Eco system apps

  • 1.
    Ecosystem Apps INNOVATIVE CROSS-PLATFORMSOLUTIONS Sergey Seletsky Abiliton™ Senior Software Engineer
  • 2.
    Agenda 1. Why? 2. What is an ecosystem? 3. Problems? 4. WinRT with HTML5 for other... 5. Cross-platform frameworks • Xamarin • Titanium • Portable apps • AppMobi 6. Specific integrated API 7. Apps integration 8. Apps Stores 9. Ecosystem architecture 10. Conclusions
  • 3.
  • 5.
    Enterprise App Ecosystem App Hub IT organization Windows Phone 1. Registration 1. Device Enrollment 2. Signing Tools 2. Get apps 3. Cert and Enterprise ID 1. Develop App 2. Package and sign Registration 1. Enterprise registers with App Hub 3. App Catalog 2. Enterprise downloads app tools 3. Microsoft notifies CA of pending 4. Create Token enterprise registration 4. Vets enterprise 5. CA checks that vetting is complete, and generates a certificate for enterprise
  • 6.
  • 7.
    Smartphone Market Share Platforms Google Apple Microsoft RIM
  • 8.
    Native Wrappers • Phonegap •Titanium • appMobi • Create native apps using HTML5 • Provide API’s (Hooks to get out of the sandbox) • Work across platforms (mostly) • Can be submitted to app stores
  • 9.
    Cross-Platform Devices • Phones – iOS – iPhone, Touch – Android – Blackberry – Windows Phone 7 • Tablets – iPad – Android
  • 10.
    Mobile Capabilities ThatInfluence Apps • GeoLocation • Bluetooth • PIM Contacts • Calendar • Camera • Push • Barcode • Screen Rotation • Date/Time Picker • Native Maps • Native Menus • Alert • Tab Bar • Audio File Playback • Navigation Bar • Ringtones • Signature Capture • NFC
  • 12.
    Cross-platform frameworks 1.Xamarin 2. Titanium 3. Portable apps 4. AppMobi 5. PhoneGap
  • 13.
  • 14.
    Asynchronous code before MyApi.OnSomeMethod+= () => { InvokeOnMainThread( (result) => { textView.Text = result; }); } MyApi.SomeMethodAsync();
  • 15.
    async/await textView.Text = awaitMyApi.GetUrlAsync( “http://softserveinc.com”);
  • 16.
    С# vs Objective-C Objective-C: //… [button addTarget:self action:@selector(touchHandler:) forControlEvents:UIControlEventTouchUpInside]; // … -(void) touchHandler:(id)sender { textView.text = @"some text"; }
  • 17.
    С# vs Objective-C C#: btn.TouchUpInside+= (s, e) => { textView.Text = "Clicked!"; };
  • 18.
    C# vs Java Java: button.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { textView.setText(“Clicked”); } } );
  • 19.
    C# vs Java C#: button.Click+= (s, e) { textView.Text = “Clicked!”; };
  • 20.
    C# vs {0} • Simply • Cleaner • Develops very quickly • From Java sand pours • [[[[After Objective-C] world : square] as: very] and all: in the colon];
  • 21.
    What is Monotouch •Mono framework with AOT compilation for ARM processors and Bindings to Native API • Code is written in C # • UI is native tongue, through C # wrapper • Development environment Visual Studio
  • 22.
    Compilation process • Compileyour code, libraries, BCL, wrappers over native methods in IL • You can use any language IL • Converted into machine code using AOT compilation • Added to app code with Mono Runtime and everything else
  • 23.
    AOT vs JIT •Usually in. Net and Mono native code generated at run - Just In Time compilation • In iOS you can not compile code on JIT, only static linking • But we already know the architecture (ARM) so you can compile the code in advance - Ahead Of Time compilation
  • 24.
    Restrictions AOT • NoEmit, but remains Reflection • Some specific designs will not work, because compiled on JIT • Generic Virtual Methods – P/Invokes in Generic Types – Some LINQ expressions
  • 25.
    Linking • At timeof compilation of IL BCL undertakes only code that is actually used • Similarly, you can cut out unused code in their libraries • Need to reduce the size of app
  • 26.
    C# API • Subscribeto Events • Setting Properties • Familiar names var btn = new UIButton(new RectangleF(0, 0, 200, 80)); btn.Enabled = true; btn.SetTitleColor(UIColor.FromRGB(255, 255, 0), UIControlState.Selected); btn.TouchUpInside += delegate { // your code }; window.Add(btn);
  • 27.
    Wrappers over nativemethods Monotouch: • It all comes down to P/Invoke method objc_msgSend with the appropriate parameters Mono for Android: • Used JNI (Java Native Interface)
  • 28.
    Wrappers over nativemethods public virtual bool Enabled { [Export("isEnabled")] get { // … return Messaging.bool_objc_msgSend(base.Handle, UIControl.selIsEnabled); } [Export("setEnabled:")] set { // … Messaging.void_objc_msgSend_bool(base.Handle, UIControl.selSetEnabled_, value); } }
  • 29.
    App Structure • Virtuallysame in native app • AppDelegate, UIWindows, ViewControllers • To describe UI also uses nib files
  • 30.
  • 31.
    Cross-platform • Sharing in30-60 percent of the code • Combining basic mobile functionality • There are various MVVM frameworks Xamarin Titanium PhomeGap Shared Specific Shared Specific Shared Specific
  • 33.
    Use of opportunitiesof Windows OS Win32 API Vista Bridge Windows Bridge .NET Framework – Windows Presentation Foundation – Windows Communication Foundation – Windows Workflow Foundation
  • 34.
  • 35.
  • 36.
    Transitions between states App are given several App is not notified seconds to sleep User Terminated Launches Low Resources App App App is notified with continued Splash screen App not running
  • 37.
  • 38.
    Language projection IInspectable C++ App IUnknown Projection C#/VB App Object Projection CLR HTML App Projection Chakra Windows Metadata
  • 39.
    IInspectable Collections IUnknown C++ App STL-style IVector<T> Projection IVectorView<T> Array IObservableVector<T> C#/VB App IEnumerable CLR (T) style Projection IInspectable IUnknown HTML App IMap<T> Chakra JavaScript Projection Associative IMapView<T> Collection IObservableMap<T>
  • 40.
    Asynchrony in Windows8 • All that is more than 50 milliseconds – asynchronously • Windows Runtime: IAsyncOperation<T> • JavaScript: Promises • C++: Parallel Patterns Library • VB/C#: async /await
  • 41.
    Threading Windows Windows Windows UI Object Object Object App Code App Code App Code
  • 42.
    Architecture WinRT Metro App Language Support (CLR, WinJS, CRT) Language projection UI Pickers Controls Media Web Host (HTML, CSS, JavaScri XAML Storage Network … pt) Windows Metadata & Namespace DirectX Windows Runtime Core Runtime Broker Win32 Windows Core
  • 43.
    Runtime app Your App Direct API calls Process.exe WinRT APIs Core OS Brokered API calls Broker App Container + Signed & Validated code AppXManifest
  • 44.
    Brokered Objects RuntimeBroker.exe App Projection Proxy Windows Runtime Object
  • 45.
    Windows Runtime APIs User Interface HTML5/CSS XAML DirectX Controls Data Binding SVG Tiles Input Accessibility Printing Devices Communications & Data Geolocation Portable Sensors NFC Contracts Local & Cloud Storage Web Media Notifications Streams Memory Playback Capture PlayTo Visual Effects XML Networking SMS Management Fundamentals Application Services Threading/Timers Memory Management Authentication Cryptography Globalization
  • 46.
    Sensors Accelerometer Gyroscope Compass Agitation Turn Overturning Slope Light In dark Indoors Outdoors Orientation
  • 48.
    Areas of integration OnWindows OS Together With cloud Live tiles Contracts : Synchronization Notifications app settings • Search Contracts • Share Live SDK Settings Print …
  • 49.
    Pop-up notifications Toast Notifications Show messages from apps and services outside the UI apps Attract attention Is disconnected Allow the user to go directly to the section of the app Initiated locally or from cloud
  • 50.
    Windows Push NotificationService Windows 8 Cloud Service Serves pop-up notifications and update live tiles external services Metro Tile updated and notifications are working even when Style 2 not running app App Takes control of communications devices 1 3 Windows Push Notification Scaled without you Notification Service Client 3 Platform Free 1. Request for URL notification channel 2. Service registration 3. Notifications
  • 51.
    Contracts - partof a large family • App to App Picking contract • Contact Picker • File activation • Play To contract • Print task settings • Protocol activation • Search contract • Settings contract • Share contract
  • 52.
    How does thiswork Source app Share Broker Target apps Registration User selected DataTransfer Manager “Share” Activation DataPackage Filter apps or links Activated User has selected a Processing Asynchronous processing target DataPackage App start-goal Completion Report DataPackage in source app
  • 54.
  • 55.
    Income distribution 70% new applications 80% once you do $25,000
  • 56.
    Best economy Togenerate $ 1 million profit Price: $4.99 ~250,000 sales 0.05% users Windows from 500+ Windows 7
  • 60.
    Azure Service Bus • Unified set of messaging capabilities Consistent management and observation capabilities • Service Bus Relay • Rich options for interconnecting apps across network boundaries • Service Bus Brokered Messaging • Queuing, publish/subscribe • Easily build hybrid apps • Available as PaaS & on-premise server
  • 61.
  • 62.