vendredi 13 février 2015

[Q] topic






can anybody help me with how to capture image by front camera in background without using any button in android???
Like in the screenshot below... if i press this "yes" radio button then the image should be captured and saved to another class..
I have tried to do it but i could not do it as i want to frown emoticon
the code which i wrote take picture by user interference i.e by clicking a button.
Here is the code of java class:
public static int cameraID = 0;
public static boolean isBlack = true;
public static ImageView image;

@override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.capturedimage);
image = (ImageView) findViewById(R.id.imgView);
}

public void onFrontClick(View v) {
RadioButton rdbBlack = (RadioButton) findViewById(R.id.rdb_black);
if (rdbBlack.isChecked()) {
isBlack = true;
} else {
isBlack = false;
}
cameraID = 1;
Intent i = new Intent(Picture.this, ViewCam.class);
startActivityForResult(i, 999);
}
and xml screen shot for taking photo from front cam is below..:crying::(








Attached Thumbnails


Click image for larger version<br/><br/>Name:	10460782_612443308886477_5384136499291360984_n.jpg<br/>Views:	N/A<br/>Size:	3.7 KB<br/>ID:	3163485
 

Click image for larger version<br/><br/>Name:	10987319_612477292216412_3329162515041310424_n.jpg<br/>Views:	N/A<br/>Size:	5.3 KB<br/>ID:	3163486
 

















Aucun commentaire:

Enregistrer un commentaire