android deprecated camera class -


i'm using deprecated android camera object. read here: https://source.android.com/devices/camera/versioning.html

that though camera object deprecated should still work android 5.0+ version. ask this, because released app uses deprecated camera object , friends downloaded app , crashes. reported errors , see in trace stack camera can't open. app works on phone , phone version 5.0+. maybe i'm not opening camera correctly??? or maybe phones can't use deprecated class. here's code opening camera:

@override public void onresume() {     super.onresume();     if(!stoptouch)//ignore condition not relevant problem         startupcam(); }  private void startupcam() {          if(faceproc==null)//ignore             faceproc = facialprocessing.getinstance();         camera=camera.open(getcid()); //crashes here!!! calls getcid() defined below         camera.setpreviewcallback(this);         initpreview(width, height);         startpreview();         starttimer(); }  private int getcid() {     if(camerafront && findfrontfacingcamera()>0)         return findfrontfacingcamera();     return findbackfacingcamera(); }  public static int findbackfacingcamera() {     int cameraid = -1;     int numberofcameras = camera.getnumberofcameras();     (int = 0; < numberofcameras; i++) {         camerainfo info = new camerainfo();         camera.getcamerainfo(i, info);         if (info.facing == camerainfo.camera_facing_back) {             cameraid = i;             break;         }     }     return cameraid; }  public static int findfrontfacingcamera() {     int cameraid = -1;     int numberofcameras = camera.getnumberofcameras();     (int = 0; < numberofcameras; i++) {         camerainfo info = new camerainfo();         camera.getcamerainfo(i, info);         if (info.facing == camerainfo.camera_facing_front) {             cameraid = i;             break;         }     }     return cameraid; } 

anyone else having issues deprecated camera class when release app? ideas i'm doing wrong here??

if tried run in android marshmallow need ask permission dynamically rather declaring camera permission in manifest. here's list of permissions need asked dynamically marshmallow http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

python - cx_oracle unable to find Oracle Client -