https://github.com/simplejnius/sj-firebase-java
Port Firebase to Pyjnius
https://github.com/simplejnius/sj-firebase-java
Last synced: 10 months ago
JSON representation
Port Firebase to Pyjnius
- Host: GitHub
- URL: https://github.com/simplejnius/sj-firebase-java
- Owner: SimpleJnius
- License: mit
- Created: 2023-12-04T11:47:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-04T13:03:57.000Z (almost 2 years ago)
- Last Synced: 2024-08-05T14:57:15.309Z (almost 2 years ago)
- Language: Java
- Size: 234 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sj-firebase-java

[](https://central.sonatype.com/artifact/io.github.simplejnius/sjfirebase)
[](https://mit-license.org/)
[](https://github.com/SimpleJnius/sj-firebase-java/actions/workflows/publish-release.yaml)
[](https://github.com/SimpleJnius/sj-firebase-java/actions/workflows/publish-snapshot.yaml)
Port Firebase Java SDK to Python
## Usage
### Android gradle project
```groovy
implementation 'io.github.simplejnius:sjfirebase:1.2.0'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-analytics'
```
### Buildozer Android project
```properties
android.gradle_dependencies = io.github.simplejnius:sjfirebase:1.2.0,
com.google.firebase:firebase-auth,com.google.firebase:firebase-database,
com.google.firebase:firebase-firestore,com.google.firebase:firebase-storage,
com.google.firebase:firebase-analytics
```
#### Python(Buildozer) installation
```shell
# pip
pip install sjfirebase
# buildozer.spec
requirements = sjfirebase
```
### Java API
#### SJFirebaseAuthEmail
```java
public class com.simplejnius.sjfirebase.SJFirebaseAuthEmail
```
The entry point of the Firebase Authentication SDK.
First, obtain an instance of this class by calling `get_instance`
(**NOTE** ignore `getInstance` on firebase documentation).
**methods**
- check_user_signed_in
- get_instance
##### Visit [FirebaseAuth Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth) for more API
#### SJFirebaseDatabase
```java
public class com.simplejnius.sjfirebase.SJFirebaseDatabase
```
The entry point for accessing a Firebase Database.
You can get an instance by calling getInstance.
To access a location in the database and read or write data, use `get_ref`
(**NOTE** ignore `getReference` on firebase documentation).
**methods**
- get_db
- get_ref
##### Visit [FirebaseDatabase Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/database/FirebaseDatabase) for more API
#### SJFirebaseFirestore
```java
public class com.simplejnius.sjfirebase.SJFirebaseFirestore
```
**methods**
- get_db
##### Visit [FirebaseFirestore Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore) for more API
#### SJFirebaseUser
```java
public class com.simplejnius.sjfirebase.SJFirebaseUser
```
Represents a user's profile information in your Firebase project's user database.
It also contains helper methods to change or retrieve profile information,
as well as to manage that user's authentication state.
(**NOTE** ignore `getCurrentUser` on firebase documentation and use `get_current_user`).
**methods**
- get_current_user
- profile_change_request_builder
##### Visit [FirebaseUser Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser) for more API
#### SJFirebaseStorage
```java
public class com.simplejnius.sjfirebase.SJFirebaseStorage
```
FirebaseStorage is a service that supports uploading and downloading large objects to Google Cloud
Storage. Pass a custom instance of [FirebaseApp]
(https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp?authuser=0)
to get_instance which will initialize it with a
storage location (bucket) specified via [setStorageBucket]
(https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseOptions.Builder?authuser=0#setStorageBucket(java.lang.String)).
Otherwise, if you call getReference without a FirebaseApp, the FirebaseStorage instance will
initialize with the default FirebaseApp obtainable from getInstance.
The storage location in this case will come the JSON configuration file downloaded from the web.
(**NOTE** ignore `getInstance` on firebase documentation and use `get_instance`).
**methods**
- get_instance
##### Visit [FirebaseStorage Documentation](https://firebase.google.com/docs/reference/android/com/google/firebase/storage/FirebaseStorage?authuser=0) for more API