Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Better error messages #1100

Merged
merged 4 commits into from
Jun 23, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Android/.DS_Store
Binary file not shown.
Binary file modified Android/.gradle/1.12/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified Android/.gradle/1.12/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified Android/.gradle/1.12/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified Android/.gradle/1.12/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified Android/.gradle/1.12/taskArtifacts/taskArtifacts.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions Android/Canobie_Physics_v2/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.canobiev2"
android:versionCode="11"
android:versionName="2.2.1"
android:versionCode="12"
android:versionName="2.2.2"
android:sharedUserId="edu.uml.cs.isense">

<uses-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public final class BuildConfig {
public static final String PACKAGE_NAME = "edu.uml.cs.isense.canobiev2";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 10;
public static final int VERSION_CODE = 12;
public static final String VERSION_NAME = "";
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.canobiev2"
android:sharedUserId="edu.uml.cs.isense"
android:versionCode="10"
android:versionName="2.2" >
android:versionCode="12"
android:versionName="2.2.2" >

<uses-sdk
android:minSdkVersion="11"
Expand Down
4 changes: 2 additions & 2 deletions Android/Car_Ramp_Physics/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="edu.uml.cs.isense.carphysicsv2"
android:versionCode="22"
android:versionName="3.1.2"
android:versionCode="23"
android:versionName="3.1.3"
android:sharedUserId="edu.uml.cs.isense">

<uses-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public final class BuildConfig {
public static final String PACKAGE_NAME = "edu.uml.cs.isense.carphysicsv2";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 21;
public static final int VERSION_CODE = 23;
public static final String VERSION_NAME = "";
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.carphysicsv2"
android:sharedUserId="edu.uml.cs.isense"
android:versionCode="21"
android:versionName="3.1.1" >
android:versionCode="23"
android:versionName="3.1.3" >

<uses-sdk
android:minSdkVersion="9"
Expand Down
4 changes: 2 additions & 2 deletions Android/DataWalk/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="edu.uml.cs.isense.datawalk_v2"
android:versionCode="22"
android:versionName="2.5.0"
android:versionCode="23"
android:versionName="2.5.1"
android:sharedUserId="edu.uml.cs.isense">

<uses-permission android:name="android.permission.VIBRATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public final class BuildConfig {
public static final String PACKAGE_NAME = "edu.uml.cs.isense.datawalk_v2";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 21;
public static final int VERSION_CODE = 23;
public static final String VERSION_NAME = "";
}
Binary file modified Android/DataWalk/build/intermediates/libs/DataWalk-debug.ap_
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.datawalk_v2"
android:sharedUserId="edu.uml.cs.isense"
android:versionCode="21"
android:versionName="2.4.1" >
android:versionCode="23"
android:versionName="2.5.1" >

<uses-sdk
android:minSdkVersion="9"
Expand Down
4 changes: 2 additions & 2 deletions Android/Data_Collector/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="edu.uml.cs.isense.collector"
android:versionCode="35"
android:versionName="4.1.1"
android:versionCode="36"
android:versionName="4.1.2"
android:sharedUserId="edu.uml.cs.isense">

<uses-sdk
Expand Down
Binary file modified Android/Google_Play_APK_Files/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions Android/Pictures/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.uml.cs.isense.riverwalk"
android:versionCode="9"
android:versionName="2.2.1"
android:versionCode="10"
android:versionName="2.2.2"
android:sharedUserId="edu.uml.cs.isense">

<uses-sdk
Expand Down
87 changes: 28 additions & 59 deletions Android/Pictures/src/edu/uml/cs/isense/riverwalk/Main.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
package edu.uml.cs.isense.riverwalk;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;

import org.json.JSONArray;

import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
Expand All @@ -38,6 +24,7 @@
import android.os.Handler;
import android.provider.MediaStore;
import android.provider.Settings;
import android.support.v4.content.CursorLoader;
import android.util.Log;
import android.view.Display;
import android.view.Menu;
Expand All @@ -50,6 +37,19 @@
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;

import org.json.JSONArray;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;

import edu.uml.cs.isense.comm.API;
import edu.uml.cs.isense.comm.Connection;
import edu.uml.cs.isense.credentials.CredentialManager;
Expand Down Expand Up @@ -308,7 +308,7 @@ public void onClick(View v) {

Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
// intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
startActivityForResult(
Intent.createChooser(intent, "Select Picture"),
SELECT_PICTURE_REQUESTED);
Expand Down Expand Up @@ -774,64 +774,33 @@ private static int getApiLevel() {
return android.os.Build.VERSION.SDK_INT;
}

@SuppressLint("NewApi")
public static File convertImageUriToFile(Uri imageUri, Context c) {
int apiLevel = getApiLevel();
if (apiLevel >= 11) {
Log.e("BOBBY URI !!! ", imageUri.toString());

String[] proj = { MediaStore.Images.Media.DATA,
MediaStore.Images.Media._ID,
MediaStore.Images.ImageColumns.ORIENTATION };
MediaStore.Images.Media._ID };

String selection = null;
String[] selectionArgs = null;
String sortOrder = null;

CursorLoader cursorLoader = new CursorLoader(c, imageUri,
proj, selection, selectionArgs, sortOrder);
CursorLoader cursorLoader = new CursorLoader(c, imageUri,
proj, selection, selectionArgs, sortOrder);

Cursor cursor = cursorLoader.loadInBackground();
Cursor cursor = cursorLoader.loadInBackground();

int file_ColumnIndex = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
int orientation_ColumnIndex = cursor
.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.ORIENTATION);
if (cursor.moveToFirst()) {
@SuppressWarnings("unused")
String orientation = cursor.getString(orientation_ColumnIndex);
return new File(cursor.getString(file_ColumnIndex));
File file = null;
try {
file = new File(cursor.getString(file_ColumnIndex));
} catch (Exception e) {
System.out.println(e.toString());
}
return file;
}
return null;

} else {

Cursor cursor = null;
try {
String[] proj = { MediaStore.Images.Media.DATA,
MediaStore.Images.Media._ID,
MediaStore.Images.ImageColumns.ORIENTATION };
ContentResolver cr = c.getContentResolver();
cursor = cr.query(imageUri, proj, // Which columns
// to return
null, // WHERE clause; which rows to return (all rows)
null, // WHERE clause selection arguments (none)
null); // Order-by clause (ascending by name)
int file_ColumnIndex = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
int orientation_ColumnIndex = cursor
.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.ORIENTATION);
if (cursor.moveToFirst()) {
@SuppressWarnings("unused")
String orientation = cursor
.getString(orientation_ColumnIndex);
return new File(cursor.getString(file_ColumnIndex));
}
return null;
} finally {
if (cursor != null) {
cursor.close();
}
}
}
}

private void postRunnableWaffleError(final String message) {
Expand Down
Loading