Rapporto della Task Force sulle startup istituita dal Ministero dello Sviluppo
Sviluppo e deployment cross-platform: Dal mobile alla Tv
-
Upload
codemotion -
Category
Technology
-
view
107 -
download
0
description
Transcript of Sviluppo e deployment cross-platform: Dal mobile alla Tv
<Andrea Trento> - <@andreatrento> – <Interpreting>
Sviluppo e deployment cross-platform: Dal mobile alla Tv
Andrea Trento
<Andrea Trento> - <@andreatrento> – <Interpreting>
Andrea Trento
<Andrea Trento> - <@andreatrento> – <Interpreting>
Specializzato in cross-platform games e applications dal 2000
Managing Director e Lead Developer in Interpreting
Flash Platform, C++, Objective-C, Action Script
Adobe Community Professional Mobile & Devices, Adobe User Group Manager.
<Andrea Trento> - <@andreatrento> – <Interpreting>
“By definition, a cross contents is one that can be used in multiple location, platform and while moving…”
“Per definizione, un contenuto cross può essere usato in luoghi e piattaforme differenti e in movimento…”
<Andrea Trento> - <@andreatrento> – <Interpreting>
Terminata la progettazione…Dobbiamo sviluppare per i vari dispositivi…
A livello tecnico di solito le soluzioni sono:
Nativo C++, Qt, Java, Objective-C
Ibrido Xhtml, Css, JavaScript, JQuery mobile, PhoneGap, ecc.
HTML5
<Andrea Trento> - <@andreatrento> – <Interpreting>
WORA Write Once Run Anywhere
Progettare in maniera corretta ed efficace
Sviluppare con le giuste tecnologie
Sviluppare con tools efficaci.
<Andrea Trento> - <@andreatrento> – <Interpreting>
Flash Player 10.1 - AIR 2.5 10.2 – 2.6
In browser e out of browser
WEB – MOBILE – TABLET - DESKTOP – TV – AUTOMOTIVE - (DEVICES)
ActionSript 3.0
<Andrea Trento> - <@andreatrento> – <Interpreting>
MultiscreenContent and Applications
FlexFlex Flash Media Server FamilyFlash Media
Server FamilyFlash
PlatformServices
Flash PlatformServices
AIRAIR
Flash PlayerFlash Player
Flash BuilderFlash Builder
FlashCatalystFlash
CatalystFlash
ProfessionalFlash
Professional
FLA
SH
PLA
TF
OR
M
TOOLSTOOLS FRAMEWORKFRAMEWORK CLIENTSCLIENTSSERVICESSERVICESSERVERSSERVERS
LiveCycleLiveCycle
<Andrea Trento> - <@andreatrento> – <Interpreting>
ActionScript 3.0 Reference for the Adobe Flash Platform
• http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html
<Andrea Trento> - <@andreatrento> – <Interpreting>
Nuove Features:
Multi-touch e gestures
Accelerometer
Screen orientation
Mobile text input
Sleep mode
Graphics hardware acceleration
Stage video
H.264 video decoding
Compatibilità e integrazione con i device
…
<Andrea Trento> - <@andreatrento> – <Interpreting>
Per avere buoni content dobbiamo considerare:
Scripting performance
Start-up time
Sleep mode
Battery life
CPU
Hardware acceleration
Memory utilization
… e molte altre cose.
Molti pensano che la Flash Platform e AS3 non siano in grado farlo…
<Andrea Trento> - <@andreatrento> – <Interpreting>
Architetture e design patterns
<Andrea Trento> - <@andreatrento> – <Interpreting>
ship.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoom);
function onZoom(e:TransformGestureEvent):void
{
ship.scaleX *= e.scaleX;
ship.scaleY = ship.scaleX;
}
ship.addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate);
function onRotate(e:TransformGestureEvent):void
{
ship.rotation += e.rotation;
}
AS3
<Andrea Trento> - <@andreatrento> – <Interpreting>
import flash.events.StageOrientationEvent;
stage.scaleMode = StageScaleMode.NO_SCALE;stage.align = StageAlign.TOP_LEFT;
function setPosition():void{vidHolder.x = stageWidth/2 - vidHolder.width/2;vidHolder.y = stageHeight/2 - vidHolder.height/2;
//If the layout is verticalif (stage.stageWidth < stage.stageHeight){//Adjust graphics}
}setPosition();
stage.addEventListener(Event.RESIZE, resizeLayout);function resizeLayout(e:Event):void{
setPosition();}
AS3
<Andrea Trento> - <@andreatrento> – <Interpreting>
import flash.sensors.Accelerometer;import flash.events.AccelerometerEvent;Accelerometer.isSupported;
var accel:Accelerometer = new Accelerometer();accel.addEventListener(AccelerometerEvent.UPDATE, update);
function update(e:AccelerometerEvent):void{
e.accelerationX;e.accelerationY;e.accelerationZ;
}
AS3
<Andrea Trento> - <@andreatrento> – <Interpreting>
import flash.sensors.Geolocation;import flash.events.GeolocationEvent;
var geo = new Geolocation();geo.setRequestedUpdateInterval(1000);
geo.addEventListener(GeolocationEvent.UPDATE, onTravel);
function onTravel(event:GeolocationEvent):void{
long.text = event.latitude.toString();lat.text = event.longitude.toString();heading.text = event.heading.toString();speed.text = event.speed.toString();hacc.text = event.horizontalAccuracy.toString();vacc.text = event.verticalAccuracy.toString();
}
AS3
<Andrea Trento> - <@andreatrento> – <Interpreting>
import flash.media.CameraRoll;import flash.events.Event;
var cr:CameraRoll = new CameraRoll();cr.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(evt:Event):void {trace("bitmapData successfully added");}
if (cr.supportsAddBitmapData) {cr.addBitmapData(bitmap);}
AS3
<Andrea Trento> - <@andreatrento> – <Interpreting>
Minimizzare l’istance allocations:
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
Usare un frame rate più basso possibile
stage.frameRate = 4;
Variare dinamicamente il frame rate
Variare dinamicamente lo StageQuality (Low, Medium, High, Best)
Usare enterFrame quando necessario
Evitare timers e usarne uno solo per tutta l’applicazione
Ridurre al minimo gli eventi in esecuzione contemporaneamente
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
Usare l’appropriato type di display object, usare anche getSize() per ottenere e monitorare l’object size:
Per object che non sono interattivi, usare Shape();
trace(getSize(new Shape()));
Per interattività non timeline, usare Sprite();
trace(getSize(new Sprite()));
Per animation, usare Movieclip();
trace(getSize(new MovieClip()));
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
Anche quando si rimuove dal display list, il movie clip rimane dispatched ed influisce:
ship.addEventListener(Event.REMOVED_FROM_STAGE,deactivate);
function deactivate(e:Event):void{
e.currentTarget.removeEventListener(Event.ENTER_FRAME,handleMovement);e.currentTarget.stop();
}
Ricordarsi di mettere a null gli oggetti, eliminarli se non servono.Non metterli mai fuori dallo stage e gestirli con visible = false; se necessario
unloadAndStop(), null, delete.
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
<initialWindow>
<content>[...]</content>
<resizable>true</resizable>
<autoOrients>false</autoOrients>
<fullScreen>false</fullScreen>
<visible>true</visible>
<renderMode>gpu</renderMode>
</initialWindow>
square.cacheAsBitmap = true;
quare.cacheAsBitmapMatrix = new Matrix();
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
Usare un frame rate più basso possibile
stage.frameRate = 4;
Variare dinamicamente il frame rate
Variare dinamicamente lo StageQuality (Low, Medium, High, Best)
Usare enterFrame quando necessario
Evitare timers e usarne uno solo per tutta l’applicazione
Ridurre al minimo gli eventi in esecuzione contemporaneamente
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
Ottimizzare
<Andrea Trento> - <@andreatrento> – <Interpreting>
<Andrea Trento> - <@andreatrento> – <Interpreting>
<Andrea Trento> - <@andreatrento> – <Interpreting>
<Andrea Trento> - <@andreatrento> – <Interpreting>
Andrea Trento Twitter - @andreatrento
Mail - [email protected]