close
Insert the latest version of firebase into the dependencies of the Gradle
dependencies {
// ...
// Import the Firebase BoM
implementation platform ( 'com.google.firebase:firebase-bom:29.0.3' )
// When using the BoM, you don't specify versions in Firebase library dependencies
// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics'
// Declare the dependencies for any other desired Firebase products
// For example, declare the dependencies for Firebase Authentication and Cloud Firestore
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
}
It took some time for synchronization and then popped up a form in the Chrome web browser as shown below
The default name of Firebase project is called NewWords, ie. Android Studio project name.
public class Member {
String vocabulary;
String descriptionEng;
String descriptionChi;
String sentence;
public String getVocabulary() {
return vocabulary;
}
public void setVocabulary(String vocabulary) {
this.vocabulary = vocabulary;
}
public String getDescriptionEng() {
return descriptionEng;
}
public void setDescriptionEng(String descriptionEng) {
this.descriptionEng = descriptionEng;
}
public String getDescriptionChi() {
return descriptionChi;
}
public void setDescriptionChi(String descriptionChi) {
this.descriptionChi = descriptionChi;
}
public String getSentence() {
return sentence;
}
public void setSentence(String sentence) {
this.sentence = sentence;
}
}
<LinearLayout xmlns: android ="http://schemas.android.com/apk/res/android"
xmlns: app ="http://schemas.android.com/apk/res-auto"
xmlns: tools ="http://schemas.android.com/tools"
android :layout_width ="match_parent"
android :layout_height ="match_parent"
tools :context =".MainActivity"
android :orientation ="vertical" >
<EditText
android :id ="@+id/et_vocabulary"
android :layout_width ="match_parent"
android :layout_height ="wrap_content"
android :hint ="Enter a new word"
/>
<EditText
android :id ="@+id/et_descriptionEng"
android :layout_width ="match_parent"
android :layout_height ="wrap_content"
android :hint ="Enter an English description"
/>
<EditText
android :id ="@+id/et_descriptionChi"
android :layout_width ="match_parent"
android :layout_height ="wrap_content"
android :hint ="Enter a Chinese description"
/>
<EditText
android :id ="@+id/et_sentence"
android :layout_width ="match_parent"
android :layout_height ="wrap_content"
android :hint ="Enter a sample sentence"
/>
<Button
android :id ="@+id/btn_send"
android :layout_width ="match_parent"
android :layout_height ="50dp"
android :text ="Send" />
</LinearLayout>
1. How to connect android with Firebase database || Android and Firebase || Firebase + android #1
2. Insert data into firebase database in android || how to insert data in firebase database android #2
3. How to insert Data in to firebase as auto increment in Android || Auto increment || Firebase #3
全站熱搜
留言列表