### Initialize FirebasePlatform (Kotlin) Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Provide an implementation for logging and persistent storage for Firebase services. This example demonstrates an in-memory storage solution. ```kotlin FirebasePlatform.initializeFirebasePlatform(object : FirebasePlatform() { val storage = mutableMapOf() override fun store(key: String, value: String) = storage.set(key, value) override fun retrieve(key: String) = storage[key] override fun clear(key: String) { storage.remove(key) } override fun log(msg: String) = println(msg) }) ``` -------------------------------- ### Initialize Firebase Application (Java) Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Manually configure Firebase options, including Project ID, App ID, and API Key, to initialize the Firebase application. This is required before using Firebase services. ```java // Manually configure Firebase Options. The following fields are REQUIRED: // - Project ID // - App ID // - API Key FirebaseOptions options = new FirebaseOptions.Builder() .setProjectId("my-firebase-project") .setApplicationId("1:27992087142:android:ce3b6448250083d1") .setApiKey("AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw") // setDatabaseURL(...) // setStorageBucket(...) .build(); // Initialize Firebase with a mock Android context import android.app.Application val app = Firebase.initialize(Application(), options) ``` -------------------------------- ### Firebase Auth API Methods Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Lists the supported methods for Firebase Authentication within the minimal Java SDK implementation. This section details the subset of Firebase Auth functionalities available, noting that the full implementation is not open-sourced. ```APIDOC Firebase Auth Supported Methods: - signInAnonymously - signInWithCustomToken - signInWithEmailAndPassword - currentUser - getAccessToken - getUid - addIdTokenListener - removeIdTokenListener - addAuthStateListener - removeAuthStateListener - signOut Note: Parameter details, return types, and specific usage examples for these methods are not provided in the source text. ``` -------------------------------- ### Add Firebase Java SDK via Gradle Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Include the Firebase Java SDK in your Gradle project for Java or Kotlin development. This dependency allows your application to connect to Firebase services. ```kotlin dependencies { implementation("dev.gitlive:firebase-java-sdk:0.4.8") } ``` -------------------------------- ### Add Firebase Java SDK via Maven Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Include the Firebase Java SDK in your Maven project for Java development. This dependency enables your application to integrate with Firebase services. ```xml dev.gitlive firebase-java-sdk 0.4.8 ``` -------------------------------- ### Disable Realtime Database Disk Persistence Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Demonstrates how to disable disk persistence for Firebase Realtime Database. This is a required configuration step due to SDK limitations, ensuring the database is set up correctly without local storage. ```Java FirebaseDatabase.getInstance().setPersistenceEnabled(false); ``` -------------------------------- ### Customize Firestore Offline Database Path Source: https://github.com/gitliveapp/firebase-java-sdk/blob/master/README.md Override the default database path for Firestore offline data persistence by implementing the `getDatabasePath` method in `FirebasePlatform`. This allows you to specify a custom location for storing offline data. ```java open fun getDatabasePath(name: String): File = File("${System.getProperty("java.io.tmpdir")}${File.separatorChar}$name") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.