I making an app using google drive to store files for user to their google drive I followed google developer guide in https://developers.google.com/drive/api/guides/about-sdk and when i press the button to upload my files i got the err in title this is
my code :
try {
// Load pre-authorized user credentials from the environment.
GoogleCredentials credentials = GoogleCredentials.getApplicationDefault()
.createScoped(Arrays.asList(DriveScopes.DRIVE_FILE));
HttpRequestInitializer requestInitializer = new HttpCredentialsAdapter(
credentials);
Drive service = new com.google.api.services.drive.Drive.Builder(new NetHttpTransport(),
GsonFactory.getDefaultInstance(),
requestInitializer)
.setApplicationName(getString(R.string.app_name))
.build();
File fileMetaDate = new File();
fileMetaDate.setName(getString(R.string.db_name_lists));
File file1 = service.files().create(fileMetaDate, fileContent)
.setFields("id")
.execute();
Toast.makeText(this, file1.getId() + " has been created", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
e.printStackTrace();
}
error
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise - java android