title: Android 4.4.2 fully working my App but other versions not working
body: <p>My app is working properly android 4.4.2. But when I install a other version of the application and try to capture an image then the app will crash.</p>
  
  <p>Anyone knows how to solve this?</p>
  
  <p>This is my MainActivity: <br/></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      private Button button;
      private String encoded_string, image_name,getUnitCode,getEmpNo,ImageDate,ImageTime;
      private Bitmap bitmap;
      private File file;
      private Uri file_uri;
      EditText unitCode,empNo;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // Check KJPhotoAudit Folder Available
          checkMyDirectory();
      }
  
      public void CaptureImage(View view){
          unitCode = (EditText)findViewById(R.id.unitCode);
          getUnitCode = unitCode.getText().toString().toUpperCase();
  
          if (TextUtils.isEmpty(getUnitCode)) {
              unitCode.setError("Unit Code is Empty");
              return;
          }
  
          empNo = (EditText)findViewById(R.id.empNo);
          getEmpNo = empNo.getText().toString().toUpperCase();
  
          if (TextUtils.isEmpty(getEmpNo)) {
              empNo.setError("Employee Number is Empty");
              return;
          }
  
          Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
          getFileUri();
  
          i.putExtra(MediaStore.EXTRA_OUTPUT,file_uri);
          startActivityForResult(i,10);
      }
  
      private void getFileUri(){
          //set date to string
          ImageDate = new SimpleDateFormat("yyyy-MM-dd").format( new Date());
          ImageTime = new SimpleDateFormat("HH:mm:ss").format( new Date());
  
          String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format( new Date());
          image_name = "MY_" +"JPEG_" + timeStamp + ".jpg" ;
  
          file = new File(Environment.getExternalStoragePublicDirectory("/Myfolder") + File.separator + image_name);
  
          file_uri = Uri.fromFile(file);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data)   {
          if (requestCode == 10 &amp;&amp; resultCode == RESULT_OK){
              new Encode_image().execute();
          }
      }
  
      private class Encode_image extends AsyncTask&lt;Void,Void,Void&gt; {
          @Override
          protected Void doInBackground(Void... voids){
  
              bitmap = BitmapFactory.decodeFile(file_uri.getPath());
              ByteArrayOutputStream stream = new ByteArrayOutputStream();
              bitmap.compress(Bitmap.CompressFormat.JPEG,20,stream);
  
              byte[] array = stream.toByteArray();
              encoded_string = Base64.encodeToString(array,0);
              bitmap.recycle();
  
              return null;
          }
  
          @Override
          protected void onPostExecute(Void aVoid){
              makeRequest();
          }
      }
  
      private void makeRequest() {
          RequestQueue requestQueue = Volley.newRequestQueue(this);
          StringRequest request = new StringRequest(Request.Method.POST, "http:/www.myweb.com/connection.php", new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  System.out.println("response"+response);
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  System.out.println("error"+error);
              }
          }){
              @Override
              protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                  HashMap&lt;String,String&gt; map = new HashMap&lt;&gt;();
                  map.put("encoded_string",encoded_string);
                  map.put("image_name",image_name);
                  map.put("unit_code",getUnitCode);
                  map.put("emp_no",getEmpNo);
                  map.put("image_date",ImageDate);
                  map.put("image_time",ImageTime);
                  return map;
              }
          };    
  
          System.out.println("req ="+request);
          requestQueue.add(request);
  
          ResetEmpNumber();
      }
  
      public void checkMyDirectory(){
  
          File dir = new File(Environment.getExternalStorageDirectory() + "/Myfolder");
          if(!dir.exists() &amp;&amp; !dir.isDirectory()) {
              File folder = new File(Environment.getExternalStorageDirectory().toString()+"/Myfoldert");
              folder.mkdirs();
          }
      }
  
      public void ResetEmpNumber(){
          //Reset Employee Text Field
          empNo.setText("");
      }
  }
  </code></pre>