Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Build Gradle with FireBase

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19518

    Edward

    Hi!

    I’m struggling with connecting my app to Firebase, it will be using firebase auth for user accounts and firebase RTDB,

    I am pretty certain my build gradle file is a complete mess haha! what would I adjust as it currently still connects to the VPlay test database not mine,

    below is my gradle file, what would I adjust

    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.google.com' }
            maven { url 'https://sdk.felgo.com/maven/' }
        }
    }
    
    apply plugin: 'com.android.application'
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    
        compile "com.android.support:support-core-utils:27.1.0"
        compile "com.android.support:appcompat-v7:27.1.0"
        dependencies {
            ...
        compile 'net.vplay.plugins:plugin-firebase:2.+'
        }
    
    }
    
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
        buildToolsVersion androidBuildToolsVersion
    
        defaultConfig.applicationId = 'com.llabs.wizardEVAP.MyDiary'
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
         apply plugin: 'com.google.gms.google-services'
    }
    
    

     

    #19520

    Alex
    Felgo Team

    Here is how a gradle file with added Firebase looks like:

    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.google.com' }
            maven { url 'https://sdk.felgo.com/maven/' }
        }
    }
    
    apply plugin: 'com.android.application'
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    
        compile "com.android.support:support-core-utils:27.1.0"
        compile "com.android.support:appcompat-v7:27.1.0"
        compile 'net.vplay.plugins:plugin-firebase:2.+'
    
    }
    
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
        buildToolsVersion androidBuildToolsVersion
    
        defaultConfig.applicationId = 'net.vplay.demos.apps.NotesApp'
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    Cheers,
    Alex

    #19522

    Edward

    Amazing, I see where mine was different thanks,

     

    Question, how would mine know to connect to my particular database and firebase project?

     

    Thanks

    Edward

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.