Globalcode – Open4education
Desenvolvimento Mobile
com NativeScript
Renato Bognar
Principal System Engineer
rbognar@progress.com
Globalcode – Open4education
O que é NativeScript?
É um runtime para construir e executar Apps
Nativos para iOS e Android com um único
código base em JavaScript
(In 2016)
Globalcode – Open4education
Não é PhoneGap…
... nem Ionic
Componentes Reais e Nativos
Não usa o DOM
Não usa HTML como se fossem componentes nativos
Usa componentes Nativos
•Sem DOM
•Uis Nativas
!=
Globalcode – Open4education
Não é Xamarin
Não faz Cross Compiling
Acesso 100% nativo as APIs de forma direta
Não é dependente de código .Net
Não faz cross compilation
!=
Globalcode – Open4education
Não é React Native
Não usa ObjectiveC, Swift ou Java
{n} Javascript tem 100% de acesso nativo e imediato às
APIs e UIs assim que elas são lançadas
Acesso direto às APIs
com JS
!=
Globalcode – Open4education
NativeScript
É totalmente free e open source
Globalcode – Open4education
Saiba mais no site oficial www.nativescript.org
NativeScript
Globalcode – Open4education
Criado e Suportado pela:
Globalcode – Open4education
Apps Cross Platform
iOS
Android
Windows (2016)
Globalcode – Open4education
WrapWrapStack
Layouts Nativos
Absolute Dock Grid Stack
Globalcode – Open4education
Use código pronto
Use milhares de plugins do NPM
Use controles nativos do Cocoapods ou Android Arsenal
Globalcode – Open4education
Arquitetura Flexível
Javascript
Escreva seu
aplicativo usando
Javascript
TypeScript
Aproveite ao máximo a
Orientação a Objetos e
verificação de erros
Angular
Arquitete sua aplicação e
reutilize o código escrito
para Web no Mobile
Globalcode – Open4education
NativeScript + Angular 2
http://bit.ly/nativescript-angular
Globalcode – Open4education
Accesso Nativo à API
Globalcode – Open4education
Output:
Legal!
JavaScript
pode ser usado
para invocar
objetos nativos
no Android!!!
NativeScript + Android
Globalcode – Open4education
JavaScript
também pode ser
usado para fazer
o mesmo em
Objective-C!!!
NativeScript + iOS
Globalcode – Open4education
Globalcode – Open4education
Mas como funciona??
Globalcode – Open4education
O V8 faz a vez:
Globalcode – Open4education
Mas eu não quero escrever
Objetive-C nem Android
Globalcode – Open4education
Código Módulos APIs
Módulos do NativeScript
Globalcode – Open4education
Módulo File-System
Globalcode – Open4education
Exemplo Módulo HTTP
Globalcode – Open4education
https://nativescript.org
@NativeScript
http://tinyurl.com/nativeScriptSlack
Siga o NativeScript
Globalcode – Open4education
{obrigado}
Renato Bognar
Principal System Engineer
rbognar@progress.com

TDC2016SP - Trilha Mobile

Notas do Editor

  • #9 I mention this because, in today’s world, where 10 JavaScript frameworks have been created since I started this presentation, that it’s important to pick an innovative and stable options
  • #16 I'll give your brain a minute or two to parse this, because yes, this JavaScript code instantiates a Java android.text.format.Time() object, calls its set() method, then logs the return value of its format() method, which is the string "01/01/15".
  • #17 This JavaScript code instantiates an Objective-C UIAlertView class, sets its message property, and then calls its addButtonWithTitle() and show() methods. When you run a NativeScript iOS app with this code you'll see the alert below:
  • #20 The call dispatcher executes the call with a dual result: •On the Android Side: we get a new instance of the native File class •On the NativeScript Side: we get a custom JavaScript Object serving as a proxy to the native Android’s object When a method is called on this proxy it is delegated to the underlying native object. <Before the next slide> This is the foundation of the NativeScript framework. The next logical step was to create a platform agnostic abstraction layer. It is really great that you can access native APIs straight form JavaScript. But I can hear you think. … this still doesn’t solve the problem of me having to learn all those Platform APIs. But this is just the foundation of the NativeScript framework.
  • #22 NativeScript comes equipped with modules that provide cross-platform functionality. There are dozens of them and they’re easy to write yourself. NativeScript modules follow Node module’s conventions (CommonJS).