android - Take a photo with custom camera resolution? -


i writing app allows take photo default camera. problem photo sending server, have reduce them size. (for example 3 mb 1 mb) how take photo:

public void startcameraactivity() {      intent imageintent = new intent(android.provider.mediastore.action_image_capture);     string timestamp = new simpledateformat("yyyymmdd_hhmmss").format(new date());       file imagesfolder = new file(environment.getexternalstoragedirectory(), "path");     imagesfolder.mkdirs();      //string filepath = "path" + timestamp + ".jpg" ;     file image = new file(imagesfolder, "path" + timestamp + ".jpg");     uri urisavedimage = uri.fromfile(image);      nomefilejpg = "path"+timestamp+".jpg";     log.i(tag,"nome del file: "+nomefilejpg);      imageintent.putextra(mediastore.extra_output, urisavedimage);     startactivityforresult(imageintent, 2);  } 

how can add reduce dimension?

you can reduce resolution telling android camera directly. have @ android camera.size more info. safely, might find camera.preferences.getsupportedpicturesizes() useful.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -