Skip to content

Demo Android application built for Helsinki Android meetup (30.08.2016)

Notifications You must be signed in to change notification settings

jerryjj/firebase-storage-demo-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Demo

Firebase Storage Demo application presented in Helsinki Android meetup. I'm not a full-time Android developer, so please forgive me about the demo code quality :)

Demo App

You can download the APK for the demo app from here: https://github.com/jerryjj/firebase-storage-demo-android/raw/master/debug-release/app-debug.apk The source code is available under the RealTrans-folder.

Firebase console configurations

Download the Android config file (google-services.json) from the console and put it in the RealTrans/app/ -folder.

Authentication

  • Enable the Anonymous Sign-In provider

Database rules

  • Create the following database rules:
{
  "rules": {
    ".read": false,
    ".write": false,
    "uploads": {
      ".read": "auth != null",
      ".write": "auth != null",
      "$id": {
        ".validate": "newData.hasChildren(['dUrl', 'nickname', 'uid', 'createdAt'])",
        ".indexOn": ["createdAt", "starCount"]
      }
    },
    "user-uploads": {
      "$uid": {
        ".read": "auth != null",
        ".write": "$uid === auth.uid",
        "$upload_id": {
          // This is not the best way to do this, but didn't find better one yet
          ".write": "auth != null && (data.exists() || $uid === auth.uid)"
        }
      }
    },
    "users": {
      ".write": "auth != null",
      "$uid": {
        ".read": "$uid === auth.uid"
      }
    }
  }
}

Storage rules

  • Create the following storage rules:
service firebase.storage {
  match /b/realtrans-6e37f.appspot.com/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

About

Demo Android application built for Helsinki Android meetup (30.08.2016)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages