Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nativescript - Building truly native apps with Javascript
Search
Márcio Vicente
October 08, 2016
Programming
0
100
Nativescript - Building truly native apps with Javascript
Márcio Vicente
October 08, 2016
Tweet
Share
More Decks by Márcio Vicente
See All by Márcio Vicente
Nativescript - Front in Maceió
marciovicente
0
94
Other Decks in Programming
See All in Programming
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
700
見た目から始める生産性向上
ikumatadokoro
10
1.5k
業務ツールとして使うPostman
msys75
0
120
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
850
JavaScript Closure
asoluka
0
1.2k
Ruby GitHub Packages
bkuhlmann
0
650
Open AI APIを使う前に知っておきたいアカウントTier の話
akki_megane
0
110
Compose-View Interop in Practice (mDevCamp 2024)
stewemetal
0
170
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
2
210
使ってみよう Azure AI Document Intelligence
kosmosebi
2
370
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
930
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
140
Featured
See All Featured
Thoughts on Productivity
jonyablonski
60
3.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
0
45
Faster Mobile Websites
deanohume
300
30k
A Modern Web Designer's Workflow
chriscoyier
689
190k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
39
2.5k
Making the Leap to Tech Lead
cromwellryan
125
8.5k
Automating Front-end Workflow
addyosmani
1357
200k
How GitHub (no longer) Works
holman
305
140k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
A designer walks into a library…
pauljervisheath
201
23k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Transcript
NativeScript Building truly native mobile apps with javascript
None
} $ whoami Co-founder Software Developer Márcio Vicente marciovicente
} The problem Native UX Native APIs Web Easy to
learn Reuse Code (desktop/mobile) Hybrid
} What is NativeScript? What is NativeScript? "An open source
framework for building truly native mobile apps with JavaScript. Use web skills, like TypeScript, Angular and CSS, and get native UI and performance on iOS and Android"
Cordova Plugins > Behind the scenes >
Not like Hybrid Apps There’s no DOM to manipulate or
style No WebView }
Not like React Native Unlimited API Faster }
Not like Xamarin No cross-compile No bindings required to access
native APIs }
Stack } or/and or/and 2
Architectural pattern No more MVC M V VM Model View
View-Model Data logic UI Application Logic }
Layout system } Absolute Dock Grid Stack Wrap
Extensible } Plugins
Full access to Android and iOS APIs
} //Accessing Native APIs
}
None
J V M Javascript Virtual Machine JavaScriptCore V8
JVM } Foo() _Foo() C++ JNI JAVA OBJ-C
} UI Components
}
}
}
} Custom components
} // app/components/buttons/flat.xml <button>{{ label }}</button> // app/main.xml
<Page xmlns:buttons=“components/buttons“> <buttons:flat label=“{{ btnLabel }}” /> </Page> // Custom components
} // app/page.ts @Component({ selector: ‘flat-btn', template: ‘<button class="flat">{{label}}</button>’ });
// app/page.html <flat-btn label=“Submit”></flat-btn> Custom components
} Wrappers
} //Importing wrappers
} Create your own NS module
} //Custom NS plugins // custom-plugins/device.ios.js module.exports = { version:
UIDevice.currentDevice().systemVersion } // custom-plugins/device.android.js module.exports = { version: Build.VERSION.RELEASE } // app.js import device from ‘./custom-plugins/device’; console.log(device.version);
} Same codebase
} //Same codebase <Button ios:text=“Submit" android:text=“Send" /> // from attributes
if (page.ios) { new UiAlertDialog().show('text'); } else { new CustomJavaDialog('text'); } // from JS
There’s no silver bullet
} Get started $ npm install -g nativescript $
tns create my-app $ tns platform add ios $ tns build ios $ tns livesync ios --emulator --watch
} Some tips • Use VS Code (+ NS extension)
• Create from template • nativescript.rocks
} THX! Questions?