Create your Firebase Realtime database Calendar App to store events or reminders - Android 13 API 33

  Рет қаралды 18,254

Programmer World

Programmer World

Күн бұрын

In this video it shows the steps to create your firebase database based Calendar App. This App can be used to store your reminders or events in your firebase database.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: programmerworl... or email at: programmerworld1990@gmail.com
Complete source code and other details/ steps of this video are posted in the below link:
programmerworl...
However, the main Java code is copied below also for reference:
package com.programmerworld.firebasecalendarapp;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CalendarView;
import android.widget.EditText;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class MainActivity extends AppCompatActivity {
private CalendarView calendarView;
private EditText editText;
private String stringDateSelected;
private DatabaseReference databaseReference;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
calendarView = findViewById(R.id.calendarView);
editText = findViewById(R.id.editText);
calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
@Override
public void onSelectedDayChange(@NonNull CalendarView calendarView, int i, int i1, int i2) {
stringDateSelected = Integer.toString(i) + Integer.toString(i1+1) + Integer.toString(i2);
calendarClicked();
}
});
databaseReference = FirebaseDatabase.getInstance().getReference("Calendar");
}
private void calendarClicked(){
databaseReference.child(stringDateSelected).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if (snapshot.getValue() != null){
editText.setText(snapshot.getValue().toString());
}else {
editText.setText("null");
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
public void buttonSaveEvent(View view){
databaseReference.child(stringDateSelected).setValue(editText.getText().toString());
}
}
-

Пікірлер: 21
We Built an App in 24 Hours [No Code]
11:56
Raw Startup
Рет қаралды 428 М.
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 47 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 17 МЛН
Building a Mobile App in 2024: The BEST Technologies
13:31
Dan Ilies
Рет қаралды 33 М.
Google Calendar + Firebase Auth
9:55
Fireship
Рет қаралды 95 М.
Sign-in with Google | Firebase Auth & Credential Manager | Jetpack Compose | Code-Along
28:35
How to Login and Register using Firebase Realtime Database  | Android Firebase Tutorials - 01
28:35
Remember Me Login Function | Android Studio
12:07
Stevdza-San
Рет қаралды 46 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 576 М.
How to create a native module with the Expo modules API
19:09
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 47 МЛН