Extended the test app to write the camera parameters to /sdcard/CameraParameters.txt in addition to emailing them. Also bumped the version to 1.1.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1063 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2009-09-25 21:38:26 +00:00
parent 965ea2f3fe
commit 77a263dd91
2 changed files with 17 additions and 2 deletions

View file

@ -16,8 +16,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.androidtest"
android:versionName="1.0"
android:versionCode="1">
android:versionName="1.1"
android:versionCode="2">
<uses-sdk android:minSdkVersion="3"/>
<application android:label="@string/app_name"
android:icon="@drawable/icon"

View file

@ -29,7 +29,10 @@ import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
public final class CameraTestActivity extends Activity implements SurfaceHolder.Callback {
@ -181,12 +184,24 @@ public final class CameraTestActivity extends Activity implements SurfaceHolder.
result.append("\n\n");
result.append(parameters);
File file = new File("/sdcard/CameraParameters.txt");
try {
FileOutputStream stream = new FileOutputStream(file);
stream.write(result.toString().getBytes());
stream.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, EMAIL_ADDRESS);
intent.putExtra(Intent.EXTRA_SUBJECT, "Camera parameters report");
intent.putExtra(Intent.EXTRA_TEXT, result.toString());
intent.setType("text/plain");
startActivity(intent);
finish();
}
}