Any help , Ideas I will be appropriated .
Hello Guys, sorry am asking so much question these days.
I designed simple android app that use the camera and show the picture is taken at the layout. Look at the attached pictures.
Once I click the "open the Camera " button it will pop up the camera asking the use to press the camera buttom to shot or take picture. What I need here , once the camera opens, it should take picture by it self with out use the camera button , Idn if is that possible or not.
The next problem as shown in the picture, it requires user interference to press ok if the user like it . here in this step I need to take just one picture once is taken should go back to main activity. and store the picture in Image View .
the last request or ideas guys how to send this pict to the email interference from the user . here is the Code -----------------------------------
public class MainActivity extends Activity {
ImageView viewpict;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewpict=(ImageView) findViewById(R.id.pict_result);
Button btn= (Button)findViewById(R.id.camera);
btn.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
Intent intent = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
// Intent intent = new Intent (getApplicationContext(),MainActivity2.class);
//startActivity(intent);
startActivityForResult(intent,0);
}
});
}
protected void onActivityResult( int requestCode, int resultCode,Intent data)
{
if (requestCode==0)
{
Bitmap theimage = (Bitmap) data.getExtras().get("data");
viewpict.setImageBitmap(theimage);
}
}
}