iT邦幫忙

2021 iThome 鐵人賽

DAY 9
0
Mobile Development

刮掉Web Development的我,與撿到的Android Development系列 第 9

[Lesson9] Firebase

首先到下列的網站
https://console.firebase.google.com/?hl=zh-tw

點擊新增專案
https://ithelp.ithome.com.tw/upload/images/20210825/20129566dDEVaB8LrW.png

輸入專案名稱,按下繼續
https://ithelp.ithome.com.tw/upload/images/20210825/20129566cG8RobwbTs.png

按下建立專案(由於是第一次使用,所以就沒有啟用Google Analytics了)
https://ithelp.ithome.com.tw/upload/images/20210825/20129566ZpM0uMXHKX.png

選擇Android
https://ithelp.ithome.com.tw/upload/images/20210825/20129566vU4D9AQYjW.png

在Project複製com.example.firebasetest
https://ithelp.ithome.com.tw/upload/images/20210825/20129566iGSVsVgZJ2.png

貼上第一個輸入框,剩下兩個輸入框就先不輸入,按下註冊應用程式
https://ithelp.ithome.com.tw/upload/images/20210825/20129566J4GU9cWJH3.png

接著按下下載google-services.json,下載完後按下繼續
https://ithelp.ithome.com.tw/upload/images/20210825/20129566kSYwtZipmS.png

到Android Studio裡面,將Android換成Project
https://ithelp.ithome.com.tw/upload/images/20210825/20129566PvoEW5WSsF.png

然後複製下載好的google-services.json檔案,貼到剛換成的Project裡
https://ithelp.ithome.com.tw/upload/images/20210825/20129566mHgk7R4u59.png

接著將Project換回Android,點擊兩下build.gradle(Project)
https://ithelp.ithome.com.tw/upload/images/20210825/201295665zl7Qyqokc.png
https://ithelp.ithome.com.tw/upload/images/20210825/20129566ePKlXStj4g.png

照著網頁上的說明,將需要新增的新增至build.gradle(基本上只要新增classpath 'com.google.gms:google-services:4.3.10),按下右上的Sync now
https://ithelp.ithome.com.tw/upload/images/20210825/20129566FsKBlGEBQt.png
https://ithelp.ithome.com.tw/upload/images/20210825/20129566wuwvnjdeoC.png

接著進入到build.gradle(Module),也是跟上面的方式一樣,Sync now完後按下繼續
https://ithelp.ithome.com.tw/upload/images/20210825/20129566U1bSgS7hJg.png
https://ithelp.ithome.com.tw/upload/images/20210825/20129566yYZfJskljx.png

完成後,就可以前往主控台查看了
https://ithelp.ithome.com.tw/upload/images/20210825/20129566YEy1VUMTYU.png
/images/emoticon/emoticon41.gif


上一篇
[Lesson8] MediaPlayer
下一篇
[Lesson10] Machine Learning
系列文
刮掉Web Development的我,與撿到的Android Development30

尚未有邦友留言

立即登入留言