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
A Tale of Four Properties
chriscoyier
162
23k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
GraphQLとの向き合い方2022年版
quramy
49
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
KATA
mclloyd
PRO
32
15k
Music & Morning Musume
bryan
46
7k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
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やってこうと思っているので、 よろしくお願いします!