Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript(AngularJS・React.js)で作る iOS・Androidアプ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kazu
July 23, 2016
Technology
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript(AngularJS・React.js)で作る iOS・Androidアプリハンズオン
2016/7/22の勉強会資料
kazu
July 23, 2016
More Decks by kazu
See All by kazu
保険SaaSのORM導入について(2022/6/17、Server-Side Kotlin Meetup vol.3)
kazuhiroyoshimoto
0
3.1k
Other Decks in Technology
See All in Technology
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
170
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
0
190
Snowflakeで実現する全社横断の顧客の声(VOC)分析・活用基盤@Snowflake World Tour Tokyo 2026
yuto16
0
200
Omarchy Quattro の日本語設定周り
simosako
2
160
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
1
330
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
120
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
160
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
380
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
0
680
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
190
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
2.8k
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
120
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
540
Balancing Empowerment & Direction
lara
6
1.3k
Making the Leap to Tech Lead
cromwellryan
135
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
エンジニアに許された特別な時間の終わり
watany
108
250k
Between Models and Reality
mayunak
4
450
Embracing the Ebb and Flow
colly
88
5.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
290
Why Our Code Smells
bkeepers
PRO
340
58k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Transcript
JavaScript(AngularJSɾReact.js)Ͱ࡞Δ iOSɾAndroidΞϓϦϋϯζΦϯɹɹ
ࣗݾհ ɾ٢ຊ߂ ɾגࣜձࣾϏζϦʔνॴଐ ɾαʔόʔαΠυΤϯδχΞ ɾࣄͰ͍ͬͯΔٕज़ ɹɹJavaɺJavaScript(jQuery)ɺHTMLɺCSS ɹɹMySQLɺAWSɺLinux ɹɹiOSΞϓϦ(Objective-C,Swift)ɺAndroidΞϓϦ(Java) ɹɹzuknow –
༑ୡͱΫΠζͰڝ͑ΔֶशΞϓϦ ɹɹɹhttps://www.zuknow.net/ ɹɹΩϟϦΞτϨοΫ–Ϩίϝϯυܕస৬αΠτ ɹɹɹhttps://www.careertrek.com/
ࠓճऔΓѻ͏༰ AngularΞϓϦ(Monaca) ɾϋΠϒϦουΞϓϦ ɾAngularJS 1ܥͰ։ൃ ReactΞϓϦ(Meteor) ɾWebΞϓϦ ɾReact.jsɺES6Ͱ։ൃ ɾMeteorͰϋΠϒϦουΞϓϦԽՄೳ →αϯϓϧͷઆ໌ɺ؆қ൛Λ࡞
→؆қ൛αϯϓϧͷઆ໌
AngularΞϓϦ(Monaca)ͷαϯϓϧ ɾαϯϓϧϓϩδΣΫτΛΠϯϙʔτ ɾ ͙ΔͳͼAPIͷkeyIDΛઃఆ(index.html) ɹɹɹvar keyid = ‘ˎˎˎ';
Monacaͱ ɾΫϥυϕʔεͷ։ൃϓϥοτϑΥʔϜ ɹɹ→ڥߏஙෆཁɺIDEͷػೳॆ࣮ ɾHTML5ͱJavaScriptΛ༻͍Δ͜ͱͰɺ ɹɹiOSͱAndroidͷ྆OSʹରԠͨ͠ ɹɹΫϩεϓϥοτϑΥʔϜͳΞϓϦ։ൃΛ࣮ݱ ɹɹɹ→WEB։ൃͷεΩϧͰΞϓϦ։ൃ͕Ͱ͖Δ ɾReact.jsɺAngularJS2ܥɺES6(Babel)Ͱ։ൃ͢Δ ɹ߹ɺLocalKit(༗ྉ൛ɺϩʔΧϧͷ։ൃڥ)͕ඞཁ
αϯϓϧΞϓϦͷ༷ ɾݱࡏपลͷҿ৯ళͷҰཡΛදࣔ ɾҰཡʹදࣔ͞Εͨҿ৯ళΛ ɹ͓ؾʹೖΓʹՃͰ͖Δ ɾ͓ؾʹೖΓҰཡΛදࣔ ɾ͓ؾʹೖΓΛΫϦΞͰ͖Δ
Onsen UIͱAngularJS1ܥ [Onsen UI] ɹɾAngularJSΛϕʔεʹϞόΠϧΞϓϦ࡞ʹ ɹɹඞཁͳUIΛఏڙ ɹɾଟ࠼ͳUIίϯϙʔωϯτ ɹɾHTMLΛ֦ு͠ɺλάܗࣜͰఏڙ [Angular JS]
ɹɾGoogleʹΑͬͯ։ൃ͞ΕͨJavaScriptͷ ɹɹMVCϑϨʔϜϫʔΫ ɹɾෳࡶԽ͢ΔWebΞϓϦͷϑϩϯτ෦Λޮతʹ ɹɹ͢Δػೳ͕ॆ࣮
Onsen UIͷߏ <ons-page ng-controller="AppController as app"> <ons-tabbar> <ons-tab page=“search.html"></ons-tab> <ons-tab
page=“like.html”></ons-tab> </ons-tabbar> </ons-page> <ons-template id=“search.html"> ɾɾɾ </ons-template> <ons-template id=“like.html”> ɾɾɾ </ons-template> <ons-template id=“result.html”> ɾɾɾ </ons-template> JSͰΓସ͑
Onsen UIʢ̍ʣ ɾons-template ɹɹhtmlͷςϯϓϨʔτΛఆٛ͢Δ ɹɹݺͼग़͢ͱ͖ʹɺςϯϓϨʔτͷIDΛࢦఆɹɹ <ons-template id="foobar.html"> ... </ons-template> ɾons-tabbar
ɹɹࢠཁૉons-tabͷpageଐੑʹ ɹɹλϒͰදࣔ͢ΔϖʔδΛࢦఆ͢Δɹɹ <ons-tabbar> <ons-tab page=”tab1.html" active="true”></ons-tab> <ons-tab page=”tab2.html" active="true”></ons-tab> </ons-tab>
Onsen UIʢ̎ʣ ɾons-listɺons-list-item ɹɹϦετΛදݱ͢ΔͨΊͷίϯϙʔωϯτ <ons-list> <ons-list-header>Header Text</ons-list-header> <ons-list-item>Item1</ons-list-item> <ons-list-item>Item2</ons-list-item> </ons-list>
ৄ͘͠ɺ ɹɾʮOnsen UI 1.xΨΠυʯ(ຊޠ)ɹ(https://ja.onsen.io/v1/guide.html) ɹɾʮOnsen UI 2 Docsʯʢӳޠʣɹ(https://onsen.io/v2/docs/js.html)
AngularJSͷߏ ons.bootstrap().controller('AppController', function($scope, $http) { ɹɹɹɾɾɾ } AppControllerΛఆٛ͢Δ index.html $scope.searchShops
=[shop1, shop2, ɾɾɾ]; $scope.likeShops =[shop1, shop2, ɾɾɾ]; Shop{ name,image_url,isLiked } ΦϒδΣΫτͷߏ
AngularJSͷαʔϏε ແ໊ؔͷҾʹࢦఆͨ͠ม໊Λݩʹɺ ඞཁͳαʔϏεΛมʹ͢ɻ ্هͷ߹ɺ$scopeαʔϏεͱ$httpαʔϏεɻ module.controller('AppController', function($scope, $http) { ɹ$scope.search =
function() { ɾɾɾ ɹ}; }; αʔϏεͱ ɾWebΞϓϦέʔγϣϯڞ௨ͷಛఆͷλεΫΛ࣮ߦ͢Δؔ܈ ɾγϯάϧτϯΦϒδΣΫτ ɾΈࠐΈαʔϏεʮ$ʯ͔Β࢝·Δ ɾಠࣗͷΧελϜαʔϏεΛ࡞Δ͜ͱͰ͖Δ
$scopeαʔϏεͱ$httpαʔϏε $scopeαʔϏε ɹɾΞϓϦέʔγϣϯͷϞσϧΛ ɹɹࢀর͢ΔΦϒδΣΫτ ɹɾσʔλόΠϯσΟϯάͷ؊ͱͳΔ ɹɹɹ→ৄ͘͠ɺ࣍ͷεϥΠυͰ $httpαʔϏε ɹɾXMLHttpRequestΦϒδΣΫτɺJSONP ɹɹΛ௨ͯ͡ɺhttp௨৴Λ͢Δ
σʔλ(js) σʔλόΠϯσΟϯάʢ̍ʣʢAngularJSʣ ը໘(html) {{ data }} σʔλΛมߋ ද͕ࣔมߋ͞ΕΔ $scope.data
σʔλ(js) σʔλόΠϯσΟϯάʢ̎ʣʢAngularJSʣ ը໘(html) <ons-list-item ng-repeat="shop in searchShops”> ɹɹ{{ shop.name }}
ɹɹ{{ shop.address }} </ons-list-item> <ons-list-item ng-repeat="shop in likeShops”> ɹɹ{{ shop.name }} ɹɹ{{ shop.address }} </ons-list-item> $scopeͷσʔλΛมߋ͢Δͱɺ ද͕ࣔมߋ͞ΕΔ $scope. searchShops $scope. likeShops
σΟϨΫςΟϒʢ̍ʣ ɾng-repeat ɹɹྻʹ܁Γฦ͠ॲཧΛ࣮ࢪ͠ɺ ɹɹల։ͨ͠σʔλΛදࣔ͢Δ <ons-list> <ons-list-item ng-repeat=“data in dataList”> {{
data }} </ons-list-item> </ons-list> ɾng-show ɹɹ͕݅trueͷ߹ʹදࣔ͢Δ <ons-list> <ons-list-item ng-repeat=“data in dataList”> <span ng-show=“dataList.length > 0”>{{ data}} </span> </ons-list-item> </ons-list>
σΟϨΫςΟϒʢ̎ʣ ɾng-click ɹɹΫϦοΫ࣌ʹࢦఆͨ͠είʔϓʹ ɹɹఆٛ͞ΕͨؔΛݺͼग़͢ <ons-button ng-click="search()"> ɹݕࡧ͢Δ </ons-button> $scope.search =
function() { ɾɾɾ }; ৄ͘͠ɺ js STUDIO(http://js.studio-kingdom.com/angularjs)
ϩʔΧϧετϨʔδ(HTML5) ɾΛอଘ͢Δ ɹɹwindow.localStrage.setItem([Ωʔ໊],[]) ɾΛऔಘ͢Δ ɹɹwindow.localStrage.getItem([Ωʔ໊]) ɾอଘ͢ΔσʔλΛΩʔόϦϡʔͰཧ ɾͯ͢ͷiOSͱAndroidͰར༻Ͱ͖Δ [ར༻ྫ]
Cordovaʢ̍ʣ HTMLϨΠϠʔ (JavaScript) ɾMonacaͰ։ൃͨ͠ࡌ͞ΕΔϑϨʔϜϫʔΫ ɾσόΠεػೳʹΞΫηε͢ΔͨΊͷ ɹΈΛఏڙ ωΠςΟϒϨΠϠʔ (Objective-CɺSwiftɺJava) ݺͼग़͠
Cordovaʢ̎ʣ ɾInAppBrowser ɹɹΞϓϦͰϒϥβΛ։͘ ɾGeolocation ɹɹҐஔใͷऔಘ navigator.geolocation.getCurrentPosition (geolocationSuccess, [geolocationError],[geolocationOptions]); window.open(url, '_blank',
'location=no'); ɾDevice ɹɹՃηϯαʔͷΞΫηε ɾMedia ɹɹΦʔσΟΦϑΝΠϧͷ࠶ੜɺԻ
͙ΔͳͼAPI [ϦΫΤετύϥϝλ] ɹɾkeyid: ΞΫηεΩʔ ɹɾformat: ʮjsonʯ(ϦΫΤετͷσʔλܗࣜ) ɹɾlatitude: ݱࡏͷҢ ɹɾlongitude: ݱࡏͷܦ
ɹɾrange: ʮ1ʯ(ݕࡧൣғΛ൪߸Ͱࢦఆɻʮ1ʯɺ300m) ɾݕࡧ݁ՌΛදࣔ ɾ͓ؾʹೖΓҰཡΛදࣔ [ϦΫΤετύϥϝλ] ɹɾkeyid: ΞΫηεΩʔ ɹɾformat: ʮjsonʯ(ϦΫΤετͷσʔλܗࣜ) ɹɾid: දࣔ͢ΔళฮIDʢܗࣜɺʮ1,2,3ʯʣ
ϓϩδΣΫτͷ࡞ ɾςϯϓϨʔτ ɹʮOnsen UI V2 Angular1 Tabbarʯ ɾCordovaϓϥάΠϯͷཧ ɹɹԼهͷઃఆΛ༗ޮʹ͢Δ ɹɹɹʮGeolocationʯ
ɹɹɹʮInAppBrowserʯ
ReactΞϓϦ(Meteor)ͷαϯϓϧ ɾMeteorΛΠϯετʔϧ ɹɹcurl https://install.meteor.com/ | sh ɾgithub͔ΒΫϩʔϯ ɹɹgit clone https://github.com/KazuhiroYoshimoto/react-sample
ɾNode.jsͷreact,react-domϞδϡʔϧΛΠϯετʔϧ ɹɹmeteor npm install --save react react-dom ɾMeteorΛىಈ ɹɹmeteor
Meteorͱ ɾnode.jsΛϕʔεͱͨ͠ ɹϑϧελοΫϑϨʔϜϫʔΫ ɾWebΞϓϦέʔγϣϯ։ൃΛૉૣ͘ ɹίετͰߦ͑Δ ɾiOSΞϓϦAndroidΞϓϦʹ ɹ͢Δ͜ͱͰ͖Δ
React.js ɾFacebook͕࡞ͬͨViewͷϥΠϒϥϦ ɾϑϨʔϜϫʔΫͰͳ͘ɺUIϥΠϒϥϦ ɾVirtual DOM ɹɹDOMͷঢ়ଶΛσʔλͱͯ࣋ͪ͠ɺ ɹɹঢ়ଶ͕มԽͨ͠ΒDOMΛ࠶ੜ͢Δ ɹɹʢࠩΛ࡞ʣ ɾίϯϙʔωϯτϕʔε ɾσʔλόΠσΟϯάʢpropsʣ
ɾঢ়ଶཧ(state) React.jsͰVirtual DOMΛఆٛ͢Δ
ίϯϙʔωϯτϕʔε - App.jsx ɹ-Shop.jsx export default class Shop extends Component
{ render() { return ( ɹɹɾɾɾ ); } }); ίϯϙʔωϯτʹ DOMΛఆٛ͠ɺίϯ ϙʔωϯτΛΈ߹Θ ͤΔɻ ίϯϙʔωϯτͷఆٛ ʹै͍ɺDOM͕ੜ ͞ΕΔɻ export default class App extends Component { render() { return ( <div className="commentBox"> ɾɾɾ <Shop /> </div> ); } });
props export default class App extends Component { return (
<div className=”contaner"> <h1>Comments</h1> <Shop shop={this.data} /> </div> ); } }); export default class Shop extends Component { return ( <div className=“Comment"> ɹɹɹɹ{this.props.shop} </div> ); } }); App.jsx Shop.jsx ɾdataͷΛड͚͢ ɾAppͰdataΛߋ৽ͨ͠Βɺ ɹࣗಈతʹdataͷΛड͚͢
state export default class App extends Component { constructor(props) {
super(props); this.state = { isResult: false, shops : Array() }; } render:() { return ( ɾɾɾ ); } }); ɾίϯϙʔωϯτͷঢ়ଶΛͭɺϛϡʔλϒϧʢෆมʣͳ ɾίϯϙʔωϯτࣗͷঢ়ଶΛͭ { shops =[data1, data2] } stateʹରͯ͠ɺ ɾprops ΠϛϡʔλϒϧʢՄมʣͳ ɾpropsͷঢ়ଶΛͭ
propsͱstate export default class App extends Component { render ()
{ return ( <div className=”container"> <Shop shop={this.state.data} /> </div> ); } }); {data: “͓ళ̍”} this.setState({data: “͓ళ2”}); export default class Shop extends Component { render() { return ( <li> <p> {this.props.shop} </p> </li> ); } } {data: “͓ళ2”} <div>͓ళ1</div> <div>͓ళ2</div> state DOM
ɾMeteorΛΠϯετʔϧ ɹɹcurl https://install.meteor.com/ | sh ɾNode.jsͷreact,react-domϞδϡʔϧΛΠϯετʔϧ ɹɹmeteor npm install --save
react react-dom ɾmeteorΛىಈ ɹɹmeteor ϓϩδΣΫτͷ࡞