@@ -0,0 +1,1240 @@
+package ca.ualberta.cs.cmput301f14t14.questionapp.view;%0A%0Aimport java.io.File;%0A%0Aimport android.content.Intent;%0Aimport android.net.Uri;%0Aimport android.os.Environment;%0Aimport android.provider.MediaStore;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.widget.ImageButton;%0Aimport ca.ualberta.cs.cmput301f14t14.questionapp.R;%0Aimport ca.ualberta.cs.cmput301f14t14.questionapp.model.Image;%0A%0Apublic class AddImage %7B%0A%09%0A    %0A%09private Uri Urifile;%0A%09ImageButton img;%0A%09%0A%09public Intent takeAPhoto()%7B%0A%09%09String path = Environment.getExternalStorageDirectory().getAbsolutePath() + %22/QAImages%22;%0A%09%09File folder = new File(path);%0A%09%09%0A%09%09if (!folder.exists())%7B%0A%09%09%09folder.mkdir();%0A%09%09%7D%0A%09%09%09%0A%09%09String imagePathAndFileName = path + File.separator + %0A%09%09%09%09String.valueOf(System.currentTimeMillis()) + %22.jpg%22 ;%0A%09%09%0A%09%09File imageFile = new File(imagePathAndFileName);%0A%09%09Urifile = Uri.fromFile(imageFile); %0A%09%09Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);%0A%09%09%0A%09%09intent.putExtra(MediaStore.EXTRA_OUTPUT, Urifile);%0A%09%09%0A%09%09return intent;%0A%09%7D%0A%09%0A%09public Uri getImgUri()%7B%0A%09%09return Urifile;%0A%09%7D%0A%09%0A%09public Intent addPhoto()%7B%0A%09%09Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);%0A%09%09%0A%09%09return intent;%0A%09%7D%0A%7D%0A

add addImage