Lezing voor de SIG Apps en de Regio Den Haag van Ngi-NGN op De Haagse Hogeschool over cross-platform native app ontwikkeling met Appcelerator Titanium en Alloy.
6. Omdat je je zelden tot één platform kunt beperken
7. Omdat er niet zoiets bestaat als één platform
1.0 1.1 1.5 1.6 2.0 2.0.1 2.1 2.2 2.3-2.3.2 2.3.3-2.3.7 3.0
3.1 3.2 4.0-4.0.2 4.0.3-4.04 4.1 4.2 4.3 4.4 5.0 5.1
2011 2012 2013 2014 2015
0%
20%
40%
60%
80%
100%
The white line shows the market share of the leading API level at any time
De white line shows the market share
of the leading API level at any time
Maart 2016
developer.apple.com
8. Omdat je te maken hebt met duizenden type devices
12. Wat betekent “Native” eigenlijk?
⎕ De developer gebruikt de platform tools
⎕ De developer gebruikt de platform taal/talen
⎕ De developer gebruikt de platform’s APIs
⎕ De user experience is zoals men op het platform verwacht
15. Wat “Native” volgens ons betekent
⎕ De developer gebruikt de platform tools
⎕ De developer gebruikt de platform taal/talen
⎕ De developer gebruikt de platform’s APIs
⎕ De user experience is zoals men op het platform verwacht✔
✔
45. Titanium API uitbreiden dmv modules
var blur =
require('bencoding.blur');
var view =
blur.createBasicBlurView({
blurRadius: 5,
image: '/images/background.png'
});
var window = Ti.UI.createWindow();
window.add(view);
window.open();
46. Hyperloop for Windows
var Window = require('Windows.UI.Xaml.Window'),
TextBlock = require('Windows.UI.Xaml.Controls.TextBlock'),
Colors = require('Windows.UI.Colors'),
SolidColorBrush = require('Windows.UI.Xaml.Media.SolidColorBrush');
var text = new TextBlock();
text.Text = 'Hello, world!';
text.FontSize = 50;
text.Foreground = new SolidColorBrush(Colors.Red);
var window = Window.Current,
window.Content = text;
window.Activate();
47. Hyperloop for iOS
var Hyperloop = require("hyperloop");
var TiApp = require("TiApp");
var UIViewController = require("UIViewController");
var UILabel = require("UILabel");
var UIColor = require("UIColor");
var UIScreen = require("UIScreen");
var CGRect = require("CGRect");
var NSTextAlignment = require("NSTextAlignment");
var label = UILabel.initWithFrame(CGRect.Make(0, 0,
UIScreen.mainScreen().bounds.width,
UIScreen.mainScreen().bounds.height
));
label.setText('Hello World!');
label.setTextColor(UIColor.redColor());
var viewController = UIViewController.init();
viewController.view.setBackgroundColor(UIColor.whiteColor());
viewController.view.addSubview(label);
TiApp.app().showModalController(viewController, false);
48. Hyperloop for iOS
var Hyperloop = require("hyperloop");
var TiApp = require("TiApp");
var UIViewController = require("UIViewController");
var UILabel = require("UILabel");
var UIColor = require("UIColor");
var UIScreen = require("UIScreen");
var CGRect = require("CGRect");
var NSTextAlignment = require("NSTextAlignment");
var label = UILabel.initWithFrame(CGRect.Make(0, 0,
UIScreen.mainScreen().bounds.width,
UIScreen.mainScreen().bounds.height
));
label.setText('Hello World!');
label.setTextColor(UIColor.redColor());
var viewController = UIViewController.init();
viewController.view.setBackgroundColor(UIColor.whiteColor());
viewController.view.addSubview(label);
TiApp.app().showModalController(viewController, false);
49. Hyperloop for Android
var TextView = require('android.widget.TextView'),
Activity = require('android.app.Activity'),
Color = require('android.graphics.Color'),
RelativeLayout = require('android.widget.RelativeLayout'),
Gravity = require('android.view.Gravity'),
TypedValue = require('android.util.TypedValue');
var text = new TextView(activity);
text.setText("Hello World!");
text.setTextColor(Color.RED);
text.setTextSize(TypedValue.COMPLEX_UNIT_PX, 60);
var layout = new RelativeLayout(activity);
layout.setGravity(Gravity.CENTER);
layout.setBackgroundColor(Color.BLACK);
layout.addView(text);
var activity = new Activity(Ti.Android.currentActivity);
activity.setContentView(layout);
50. Abstractie heeft zijn voordelen
var window = Ti.UI.createWindow({
backgroundColor: “black"
});
var label = Ti.UI.createLabel({
text: “Hello, world!”,
color: “red”
});
label.addEventListener(“click”,
function open() {
alert(“Hello, world!”);
}
);
window.add(label);
window.open();
51. From Zero to App
• Appcelerator OSS vs Platform
• Dependency Hell
• Titanium & Alloy installeren
• Onze eerste app in 10 best practices
52.
53.
54. OSS INDIE $39/m TEAM $259/m
Ti CLI ✔ ✔ ✔
Ti SDK CI & Second-last GA ✔ ✔
Alloy ✔ ✔ ✔
AppC unified CLI ✔ ✔
Publish / Production ✔ ✔ ✔
Collaboration ✔ ✔
Studio ✔ ✔
LiveView, Profiler etc. ✔ ✔
Premium modules ✔
Arrow DB 1M / 5GB 10M / 10GB
Arrow Push 1M 10M
Arrow Web ✔
Arrow Builder ✔
Analytics 30 days 12 months
SLA 99%
Support community ✔
Labs ✔