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
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Designing for Performance
lara
610
69k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
A better future with KSS
kneath
239
18k
Making Projects Easy
brettharned
120
6.4k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
How STYLIGHT went responsive
nonsquared
100
5.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
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やってこうと思っているので、 よろしくお願いします!