Skip to content

Instantly share code, notes, and snippets.

@arkangelx
Created August 23, 2015 12:17
Show Gist options
  • Save arkangelx/734727a32964d42a0b13 to your computer and use it in GitHub Desktop.
Save arkangelx/734727a32964d42a0b13 to your computer and use it in GitHub Desktop.
//called in application onCreate
public Cloudinary initCloudinary() {
Map config = new HashMap();
config.put("cloud_name", getString(R.string.cloudinary_name));
config.put("api_key", getString(R.string.cloudinary_key));
config.put("api_secret", getString(R.string.cloudinary_secret));
return new Cloudinary(config);
}
setCloudinaryInstance(initCloudinary());
public static void setCloudinaryInstance(Cloudinary cloudinaryInstance) {
Application.cloudinaryInstance = cloudinaryInstance;
}
//call to upload file
uploadResult= Application.cloudinaryInstance.uploader().upload(new File(path), ObjectUtils.emptyMap());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment