Multimedia Notes
Multimedia Notes
For audio/video files, you need to create a new folder/directory called ‘raw’ inside ‘res’
directory and place your files inside the ‘raw’ directory
Or you can access files from your SD card or phone memory for playing, if you don't want to
include them in your application
iv = (ImageView) findViewById(R.id.imageView1);
Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, 0);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Finally you need to provide permission to your App so that it can use camera of the phone
Open you AndroidManifest.xml file and add a new User Permission and select
android.permission.CAMERA from the drop down