Use Google Drive as a WebService

1

Hello.

Someone could help me, I'm trying to create an app and I'm trying to use google drive as a webService for this app, I want to store files in the my account of the drive (eg audio and img ) and qd the user of the app click on a button the download of a file from my drive be done to his cel. However I try to connect, api displays the dialog for the user to choose the drive account to connect to, which I should actually inform my account programming (from where the download will be made) and the user should not be aware of it. (just hit the download button and you're done) does anyone know how to report this account in my code?

My code:

@Override
    protected void onResume() {
        super.onResume();
        if (mGoogleApiClient == null) {
            mGoogleApiClient = new GoogleApiClient.Builder(this)
                    .addApi(Drive.API)
                    .addScope(Drive.SCOPE_FILE)
                    .addScope(Drive.SCOPE_APPFOLDER)
                    .addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this)
                    .build();
        }
        mGoogleApiClient.connect();//vai dar falha pq nenhuma conta foi informada
    }

and in onFail the code launches the dialog (this part should be subst by the information of my account ... but how?)

@Override
    public void onConnectionFailed(ConnectionResult result) {
        if (!result.hasResolution()) {
            Log.i(TAG, "Erro! " + result.toString());
            return;
        }

        try {
            //esse cod lança o dialog
            result.startResolutionForResult(this, REQUEST_CODE_RESOLUTION);
        } catch (SendIntentException e) {

        }
    }

Would anyone know what I need to do? Or would you have any other ideas on how to report this account via programming?

Thank you.

    
asked by anonymous 17.07.2016 / 16:51

0 answers