How to use Firebase with Kotlin?

Asked

Viewed 16 times

-2

I wanted to take the text fields, and save in the bank, only I don’t know how to save in firebase.

TelaOpcoes : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_tela_opcoes)
        setListeners()
    }
    private fun setListeners() {
        nPla?.doAfterTextChanged { text ->
        }
        item?.doAfterTextChanged { text ->
        }
        locaL?.doAfterTextChanged { text ->
        }
        btNCa.setOnClickListener {
            btNCaL(nPla.text.toString())
        }
    }
    private fun btNCaL(item: Any) {
    }Texto pré-formatado
}
  • Duplicate 519052, and as commented on the other question, it is very vague.

1 answer

0

Cara tries to take a look at this Firebase documentation: https://firebase.google.com/docs/firestore/quickstart#kotlin+ktx

I used it to be able to implement Firebase in my project and precisely to save typed text fields in the app.

Tip: I had to create a "Data" class to be able to save the data written by the user and then give a getInstace pro Firebase using the Cloud Firestore.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.