Upload
e-xtrategy-internet-way
View
4.353
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
Sviluppo di applicazioni mobile con Titanium Appcelerator
@lorenzomassacci@g_mandolini@emanuele_r
TechBar
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 2e-xtrategy srl - www.e-xtrategy.netTechBar
TechBar è il nome con cui abbiamo pensato di chiamare questo tipo di eventi, in cui si va oltre all'apprendimento di nozioni in modo frontale, come nelle classiche conferenze: si ha la possibilità di sperimentare in prima persona, ad esempio "giocando" direttamente con il codice, e di confrontarsi con gli altri, il tutto con un tono molto colloquiale, come amici al bar!
Twitter: @TechBarIt (https://twitter.com/TechBarIt)Facebook: https://www.facebook.com/groups/techbar/
Cos'è un TechBar?
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 3e-xtrategy srl - www.e-xtrategy.netTechBar
Esperienze con Titanium? Esperienza con Javascript? Esperienze sviluppo Mobile con altre piattaforme/framework?
http://www.flickr.com/photos/duskolo/2777742751/
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 4e-xtrategy srl - www.e-xtrategy.netTechBar
Appcelerator Titanium
Titanium is an open source framework for building Native, Hybrid and Mobile Web apps from a single JavaScript-based SDK
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 5e-xtrategy srl - www.e-xtrategy.netTechBar
Piattaforme Supportate Android
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 6e-xtrategy srl - www.e-xtrategy.netTechBar
Piattaforme Supportate iOS(iPhone/iPad)
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 7e-xtrategy srl - www.e-xtrategy.netTechBar
Piattaforme Supportate - Mobile Web
browser
*richiede Titanium SDK > 1.7.2
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 8e-xtrategy srl - www.e-xtrategy.netTechBar
BlackBerry? Windows Phone? Windows 8?
The goal of Titanium Mobile is to provide a high level, cross-platform JavaScript
runtime and API for mobile development (today we support iOS, Android, and
the browser, with BlackBerry 10 and Windows Phone coming soon and
eventually, respectively).
(Maggio, 2012 - http://developer.appcelerator.com/blog/2012/05/comparing-titanium-and-phonegap.html)
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 9e-xtrategy srl - www.e-xtrategy.netTechBar
Write once, run DEBUG everywhere iOS/Android
Titanium is built on two assertions about mobile development:
● There is a core of mobile development APIs which can be normalized across
platforms. These areas should be targeted for code reuse.
● There are platform-specific APIs, UI conventions, and features which developers
should incorporate when developing for that platform. Platform-specific code
should exist for these use cases to provide the best possible experience.
So for those reasons, Titanium is not an attempt at “write once, run everywhere”. We
think there are great, user-experience enhancing features across multiple platforms that
developers should be using. We think that native apps should, where appropriate,
take advantage of familiar, high-performance native UI widgets. However, we think
it is unnecessary that native developers need to learn platform-specific APIs to
draw a rectangle, or make an HTTP request.
(Maggio, 2012 - http://developer.appcelerator.com/blog/2012/05/comparing-titanium-and-phonegap.html)
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 10e-xtrategy srl - www.e-xtrategy.netTechBar
Performance vs. Flexibility
http://www.titaniumninja.com
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 11e-xtrategy srl - www.e-xtrategy.netTechBar
it's only javascript, baby
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 12e-xtrategy srl - www.e-xtrategy.netTechBar
it's only javascript, baby
http://www.titaniumninja.com
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 13e-xtrategy srl - www.e-xtrategy.netTechBar
API
● Contacts
● Database
● Filesystem
● Geolocation
● Map
● Media
● Network
● UI
● Accelerometer
● Gesture
● ....
Supports 5,000+ native APIs
http://docs.appcelerator.com/titanium/2.0/index.html#!/api
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 14e-xtrategy srl - www.e-xtrategy.netTechBar
cloud services
● Users
● photos
● push notifications
● email template
● custom objects
● places
● ratings, reviews, like
● analytics
● .....
SDK > 2.0
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 15e-xtrategy srl - www.e-xtrategy.netTechBar
Extending api
why?
● Accessing specific OS features
● Leveraging existing native
libraries
● Optimizing critical portions of
the app
● Extending portions of the
Titanium Mobile framework
how?
● Creating one or more native
modules throught the Titanium
Module SDK
● Great flexibility
● Easy to distribute (Open Source,
Binary packages, Appcelerator
Marketplace)
http://www.appcelerator.com/marketplace
http://www.slideshare.net/omorandi/extending-appcelerator-titanium-mobile-through-native-modules
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 16e-xtrategy srl - www.e-xtrategy.netTechBar
Titanium Studio
Titanium Studio Eclipse-based IDE. (ex Aptana)
● Use Titanium Studio build, test, package and publish mobile and web
applications.
● Code assisting, ACS integration, module management, Git integration,
publishing workflow and a full-featured editor.
● Manage Titanium projects,
test your mobile apps in the
simulator or on device,
automate app packaging
deploy to a public or private App
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 17e-xtrategy srl - www.e-xtrategy.netTechBar
Titanium Project
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 18e-xtrategy srl - www.e-xtrategy.netTechBar
tiapp.xml
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 19e-xtrategy srl - www.e-xtrategy.netTechBar
Demo
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 20e-xtrategy srl - www.e-xtrategy.netTechBar
Watch your step
● su iOs ok :-) Android crash :-(android first
● sul simulatore va sul device nonon fidarsi troppo del simulatore
● risoluzioni diverse dei devicedp e misure relative
● performancemoduli nativi
● non prevede una suite di testjasmine con node (forse Anvil)
● gestione memoriabest practices js
● bug di titaniumarmarsi di pazienza (aggirarli o correggerli è open source)
http://www.flickr.com/photos/modowd/352920834/
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 21e-xtrategy srl - www.e-xtrategy.netTechBar
links
● http://docs.appcelerator.com/titanium/2.0/index.html
● http://developer.appcelerator.com/questions/newest
● http://docs.appcelerator.com/titanium/2.0/index.html#!/guide
● http://docs.appcelerator.com/titanium/2.0/index.html#!/video
● https://wiki.appcelerator.org/display/guides/Managing+Memory+and+Finding+Lea
● @LearningTi
● @appcelerator
● https://github.com/appcelerator (KitchenSink)
● http://titaniumninja.com/
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 22e-xtrategy srl - www.e-xtrategy.netTechBar
Hands on
1)Creiamo una Tabella con dei dati fissi (es: una lista della spesa)
2)Facciamo provenire questi dati da un database (popolato con valori di default all'avvio
dell'app se vuoto)
3)Diamo la possibilità di aggiungere una riga (togliendo il ripristino db all'avvio e
rendendo l'app usabile)
suggerimenti:
la window iniziale viene sostituita da un tabGroup e viene usata per la lista
aggiungiamo una seconda window per gestire l'aggiunta del nuovo prodotto
4)Gestiamo il refresh della lista per vedere le modifiche (attualmente viene popolata
solo all'avvio dell'app)
5)Cancelliamo tutti i prodotti con uno shake
6)Ottimizzazioni, spunti e conquista del mondo con un click :-)
https://github.com/e-xtrategy/titanium-shopping-list
4° TechBar – Sviluppo di applicazioni mobile con Titanium Appcelerator | pag. 23e-xtrategy srl - www.e-xtrategy.netTechBar
Contatti