IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

Firebase Deletion - Backend Development #130

Closed Cade5480 closed 4 months ago

Cade5480 commented 4 months ago

Firebase Deletion

Description:

Since we are moving into SQLite, I am going to be going through our code and making sure all things firebase is deleted.

Steps to Reproduce:

N/A

Expected vs. Actual Behavior:

N/A

Code snippets:

`package com.example.mealtime1

import android.os.Bundle import androidx.activity.ComponentActivity import com.google.firebase.FirebaseApp import com.google.firebase.database.*

class GroceryListActivity2 : ComponentActivity() {

private val groceryListRef: DatabaseReference by lazy {
    FirebaseDatabase.getInstance().getReference("groceryList")
}

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    // Initialize Firebase

// FirebaseApp.initializeApp(this)

    // Create a new grocery list and push it to the database
    val newGroceryList = GroceryList(
        "uniqueListID",
        "uniqueUserID",
        "uniqueFoodID",
        System.currentTimeMillis(),
        "Groceries",
        200
    )
    groceryListRef.child(newGroceryList.GroceryListID).setValue(newGroceryList)

    // Retrieve a grocery list from the database
    groceryListRef.child("uniqueListID").addListenerForSingleValueEvent(object : ValueEventListener {
        override fun onDataChange(dataSnapshot: DataSnapshot) {
            if (dataSnapshot.exists()) {
                val retrieveGroceryList = dataSnapshot.getValue(MealData::class.java)
                // Grocery List exists
            } else {
                // Grocery List does not exist
            }
        }

        override fun onCancelled(databaseError: DatabaseError) {
            // Handle error
        }
    })
}

}`

Environment Details:

IDE: Android Studio SDK: 34.1.2

Issue Resolution:

N/A

Current Status: Completed

aaleksandraristic commented 4 months ago

@Cade5480 Sorry for this, but just to remind you that a due date for this issue is tomorrow. Please let me know if we need to expend it.

Cade5480 commented 4 months ago

Need to speak with Aleks and clarify with Aleks what all I can delete Firebase wise before I commit the deletions

aaleksandraristic commented 4 months ago

Sorry I just saw you comment, I haven’t received the notification!

Yes, you can delete everything that uses Firebase, bc we are not using it for anything.

Cade5480 commented 4 months ago

Deleted all firebase usages, closing issue

aaleksandraristic commented 4 months ago

Thank you!!