我想用我的NexusS从网络摄像机捕获RTSP视频流。使用VideoView和媒体播放器观看流没有问题。我试着这样保存:URLurl=newURL("rtsp://192.168.4.222:554/ipcam.sdp");URLConnectionucon=url.openConnection();ucon.connect();InputStreamis=ucon.getInputStream();fos=newFileOutputStream(VideoFile);bis=newBufferedInputStream(is);isRecording=true;baf=newByte
在我们的代码中,我们使用如下所示的getPhoto方法:publicvoidgetPhoto(Viewview){Intentintent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);captureFile=newFile(getCaptureFilePath());captureUri=Uri.fromFile(captureFile);intent.putExtra(MediaStore.EXTRA_OUTPUT,captureUri);startActivityForResult(intent,CAPTURE_IMAGE);}和onAct
我想根据API将应用程序从Camera1扩展到Camera2。该应用程序的一个核心机制在于以每秒约20张图片的速度拍摄预览图片。使用Camera1,我意识到通过创建一个SurfaceView,在其支架上添加一个回调,并在创建表面后通过定期setOneShotPreviewCallbacks访问预览图片。这非常简单可靠。现在,在研究Camera2时,我“从头开始”并设法将YUV420_888转换为位图(参见YUV420_888toBitmapConversion)。但是,我现在正在为“捕获技术”而苦苦挣扎。从Google示例中,我看到您需要使用CameraDevice.TEMPLATE_
我需要捕获当前屏幕的屏幕截图,所以我采用了下面的代码protectedvoidonPause(){//TODOAuto-generatedmethodstubsuper.onPause();LinearLayoutv=(LinearLayout)findViewById(R.id.mainLayout);v.setDrawingCacheEnabled(true);//thisistheimportantcode:)//Withoutittheviewwillhavea//dimensionof0,0andthebitmapwill//benullv.measure(MeasureSp
几天来我一直在寻找这个问题的解决方案,但我不知道该怎么做:(我有一个使用native相机拍照的应用程序,但问题是,有时,只有在某些设备上,当我拍照并保存并返回时,我的应用程序才会重新启动。它是一个webview,很多逻辑是在服务器端进行的,但是使用javascript接口(interface)来处理相机等native功能。它很难捕捉到,因为它只发生在某些设备上,即使它们是同一型号,我有两个galaxyace,其中一个几乎总是发生,而另一个很少发生(这些不是唯一的设备我测试过)我认为这与相机的方向或类似的东西有关。因为当我在保存/丢弃屏幕(拍照后)旋转设备时似乎更常发生这是我的一些代码:
当我打开带有Intent的相机时,我遇到了GalaxyTab限量版(GoogleI/O)的问题。这是我的代码:IntentimageCaptureIntent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(newFile(mSavedFilePath)));startActivityForResult(imageCaptureIntent,REQUEST_IMAGE_CAPTURE);在摩托罗拉Xoom上,此代码运行良
我用一个基于intent录制视频的例子Intentintent=newIntent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);startActivityForResult(intent,REQUEST_VIDEO_CAPTURED);对于时间限制,我使用了:intent.putExtra("android.intent.extra.durationLimit",5);此记录5秒,然后自动停止。我使用了URL中的示例:http://android-er.blogspot.cz/2011/04/start-video-recordi
我有一个相当简单的应用程序,可以从菜单启动相机。相机启动正常,但当我拍完照片后点击确定时,我的nexusone出现了NPE:E/AndroidRuntime(3891):java.lang.RuntimeException:FailuredeliveringresultResultInfo{who=null,request=0,result=-1,data=null}toactivity{net.asplode.tr/net.asplode.tr.PostImage}:java.lang.NullPointerExceptionE/AndroidRuntime(3891):atandr
我正在使用这样的Intent打开android相机:IntentcameraIntent=newIntent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT,mCapturedImageURI);startActivityForResult(cameraIntent,CAMERA_PIC_REQUEST);但相机总是打开6mp分辨率(我认为它的设备最大相机分辨率)我想打开它较低的分辨率,如2mp。有没有办法做到这一点感谢您的任何建议。
我正在使用以下代码告诉系统我要拍照:Intentintent=newIntent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE,null);intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,Uri.fromFile(newFile(filePath)));startActivityForResult(intent,TAKE_PHOTO_ACTIVITY);第一次使用时,它就像冠军一样工作。随后的尝试产生以下异常:E/CameraHolder(8300):java.lang