7
I have a problem in the application it opens the camera but does not upload hold can see where I am missing
follows the code
public class MainActivity extends Activity{
//chamar quando a atividade é a primeira criada
@Override
public void onCreate(Bundle savedIntanceState){
super.onCreate(savedIntanceState);
setContentView(R.layout.activity_main);
Button foto = (Button) findViewById(R.id.buttonToFoto);
Button video = (Button) findViewById(R.id.buttonToVideo);
foto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(intent);
String arquivo = Environment.getExternalStorageDirectory() + "/" + System.currentTimeMillis() + ".jpg";
File file = new File(arquivo);
Uri outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
}
});
video.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent (MediaStore.ACTION_VIDEO_CAPTURE);
startActivity(intent);
String arquivo = Environment.getExternalStorageDirectory() + "/" + System.currentTimeMillis();
File file = new File(arquivo);
Uri outputFileUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
}
});
}
}
Dude, take a look at this article. http://www.thiengo.com.br/utilizando-a-camera-do-smartphone-em-sua-app-android
– Matheus SE
There is nothing in this codex to upload. I think I’m missing something.
– Pablo Almeida
I think you could split it up into two questions.
– viana