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
FlutterでMLKitを使ってみる.pdf
Search
sayurikunugi
August 28, 2018
2
1.3k
FlutterでMLKitを使ってみる.pdf
flutterでFirebase MLKitを使ってみる
sayurikunugi
August 28, 2018
Tweet
Share
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Cult of Friendly URLs
andyhume
78
6.2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Automating Front-end Workflow
addyosmani
1367
200k
4 Signs Your Business is Dying
shpigford
182
22k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
A designer walks into a library…
pauljervisheath
205
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Fireside Chat
paigeccino
34
3.2k
Transcript
Flutterで ML Kitを使ってみる
自己紹介 • エンジニア • 会社:HealtheeOne https://healtheeone.com • Android 7年くらい • Ios/Xcodeは未経験
• Flutterは2週間くらい…(初心者ですすみません) 簡単なOCRのモックプロジェクト作って、apk作るまでを1 週間くらいでやったので、その雑感をまとめます。
Flutterを始めたきっかけ • UI/画面遷移が単純な新規アプリを、Android/IOSで作る必 要が出てきた →Flutterで作れるかも? • 前からIOS興味あったし、 • Google I/Oでも取り上げられていたし、
どうせならモックからFlutterで作ってみよう!
ML Kitとは • 画像認識システム。機械学習機能も。 https://firebase.google.com/products/ml-kit/?hl=j a 「Image Labeling」-画像に写っているものをリス トアップできる 「Text
recognition 」 -文字を認識できる 「Face detection 」 -顔を認識する 「Barcode scanning 」 -バーコードを認識する 「Landmark detection 」 -有名な場所を認識する
Flutterで ML Kit • プラグイン https://pub.dartlang.org/packages/firebase_ml_ vision ※使った方 ⭐️ https://pub.dartlang.org/packages/mlkit
※official
Firebaseの設定 • https://codelabs.developers.google.com/codela bs/flutter-firebase/#4 • 注意 6. Platform-specific Firebase configuration
の手 中、 順 iOSは6まででOK ※6.Continuing in Firebase, follow the instructions to download the config file GoogleService-Info.plist.
サンプルプロジェクト紹介① https://github.com/sayurikunugi/flutter_mlkit_sample
サンプルプロジェクト紹介②
サンプルプロジェクト紹介③
大変だったところ① • Androidではデバッグアプリ動くんだけど、 iOSでビルドが通らない… • officialプラグインも非officialもダメ。 →githubで、両方ともissueしてみた • officialの方は「flutter doctorの結果を載せて」と返事
※issue時はflutter doctorの結果はマストらしい • 非officialの方は直してくれた 「 ios mlkit library has updated. I'll fix it soon! 」 • officialも更新してるので動きそう … プラグインのアップデート管理大変そう
大変だったところ② • APKのビルド https://flutter.io/android-release/ flutter build apk • apkを動かすとアプリがクラッシュ couldn't
find "libflutter.so" • flutter build apk --release --target-platform android-arm64 →使用端末では動いた • が、別の端末でcouldn't find "libflutter.so" →つづく
大変だったところ③ • CPUが32bitの端末らしい https://github.com/flutter/flutter/issues/18494 • 3.1.3以上のAndroidStudio使う or 32bit向けにapkをbuild build.gradle defaultConfig
{ ndk{ abiFilters "armeabi-v7a" }… } flutter build apk --release --target-platform android-arm
Flutter、 Dartの感想 • newはあっても無くてもどっちでもいいらしい • constがわかりにくい コンパイル時に作られるので、変数をパラメータにもったりす るとクラッシュしたり? • StatefulWidget:setState()するとbuild(onResume
みたいな)が走って画面が再描画される • file名!=クラス名。1ファイルに何クラスあってもok • レイアウトファイルがない
最後に • 始めたばかりだけど、おもしろい • UIパーツもプラグインも充実している • Issueは積極的に • 難読化、iOS向けリリースは今後のTODO •
これからもFlutterやってこうと思っているので、 よろしくお願いします!