private void CreateDirectoryForPictures() { AppPath.Dir = new File(AppPath.GetPath()); //get the directory path //if the folder doesn't exist then make it if (!AppPath.Dir.Exists()) { AppPath.Dir.Mkdir(); } }
private void TakePic_Click(object sender, EventArgs e) { //weirdity going on, have to rebuild the path here instead of using the one already in the AppPath class var path = System.IO.Path.Combine(AppPath.GetPath(), "OCR.jpg"); AppPath.OCRfile = new File(path); //return a file //if the path exists then run the camera if (AppPath.OCRfile.Exists()) { //camera action Intent intent = new Intent(MediaStore.ActionImageCapture); //MediaStore – contents of the user’s device: audio (albums, artists, genres, playlists), images (including thumbnails) & video. intent.PutExtra(MediaStore.ExtraOutput, Uri.FromFile(AppPath.OCRfile)); StartActivityForResult(intent, 0); } else { Toast.MakeText(this, "No path working" + AppPath.OCRfile.ToString(), ToastLength.Long).Show(); } }