Starting video capture on one click in android -


i want start camera , automatically start recording clicking app in android. have code start camera not know how start auto capture of video. please help. code have launching camera-

@override  protected void oncreate(bundle savedinstancestate) {    super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_c1_main);    intent intent = new intent("android.media.action.video_capture");    startactivityforresult(intent,capture_video_activity); } 

i found view.performclick not know how use camera

use mediarecorder purpose. though require more work give more control. follow link http://android-er.blogspot.tw/2011/04/start-video-recording-using.html. since don't reuire button click recording, keep delay before starting camera. this

mybutton.setpressed(true); //you won't click button mybutton.invalidate(); mybutton.postdelayed(new runnable() {       public void run() {                mybutton.setpressed(false);           mybutton.invalidate();          releasecamera();   //release camera preview before mediarecorder starts         if(!preparemediarecorder()){             toast.maketext(androidvideocapture.this,"could not prepare mediarecorder",toast.length_long).show();             finish();         }         mediarecorder.start();     } },5000); //causes delay of 5 seconds befor recording starts 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -