@@ -0,0 +1,1915 @@
+package com.incidentlocator.client;%0A%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.content.pm.PackageManager;%0Aimport android.content.pm.ResolveInfo;%0Aimport android.provider.MediaStore;%0Aimport android.os.Environment;%0Aimport android.util.Log;%0Aimport android.net.Uri;%0Aimport java.lang.AssertionError;%0Aimport java.util.List;%0Aimport java.util.Date;%0Aimport java.text.SimpleDateFormat;%0Aimport java.io.File;%0A%0Apublic final class PhotoHelper %7B%0A    private static final String TAG = %22IncidentLocator%22;%0A%0A    private PhotoHelper() %7B%0A        throw new AssertionError();%0A    %7D%0A%0A    public static boolean isCameraAppAvailable(Context context) %7B%0A        final PackageManager pm = context.getPackageManager();%0A        final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);%0A        List%3CResolveInfo%3E list =%0A            pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);%0A        return list.size() %3E 0;%0A    %7D%0A%0A    public static boolean hasCamera(Context context) %7B%0A        final PackageManager pm = context.getPackageManager();%0A        return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);%0A    %7D%0A%0A    public static Uri getNewPhotoFileUri() %7B%0A        final File photoDir = Environment.getExternalStoragePublicDirectory(%0A            Environment.DIRECTORY_PICTURES);%0A        final File mediaStorageDir = new File(photoDir, TAG);%0A%0A        if (! mediaStorageDir.exists()) %7B%0A            if (! mediaStorageDir.mkdirs()) %7B%0A                Log.e(TAG, %22failed to create photo directory%22);%0A                return null;%0A            %7D%0A        %7D%0A%0A        final String timeStamp = new SimpleDateFormat(%22yyyyMMdd_HHmmss%22).format(new Date());%0A        final File mediaFile = new File(mediaStorageDir.getPath() + File.separator +%0A            %22IMG_%22 + timeStamp + %22.jpg%22);%0A%0A        Log.d(TAG, %22created file: %22+mediaFile.getAbsolutePath());%0A        return Uri.fromFile(mediaFile);%0A    %7D%0A%7D%0A

add photo helper for common photo related functions