I want to capture a picture and upload it to Cloudinary directly. How can I know the name of the pic to set it at the upload statement cloudinary.uploader().upload("nameofthepic", Cloudinary.emptyMap());
.
Here is my code:
public class Camera extends ActionBarActivity implements View.OnClickListener {
Button b;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera);
b= (Button) findViewById(R.id.button);
b.setOnClickListener(this);
}
public static final int TAKE_PHOTO_REQUEST = 0;
@Override
public void onClick(View v) {
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(takePhotoIntent, TAKE_PHOTO_REQUEST);
Map config = new HashMap();
config.put("cloud_name", "dkepfkeuu");
config.put("api_key", "552563677649679");
config.put("api_secret", "7n8wJ42Hr_6nqZ4aOMDXjTIZ4P0");
Cloudinary cloudinary = new Cloudinary(config);
try {
cloudinary.uploader().upload("", Cloudinary.emptyMap());
} catch (IOException e) {
e.printStackTrace();
}
}
}