Skip to content

Commit

Permalink
Merge pull request #3 from danleyb2/run-fixes
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
marcbelmont authored Jun 28, 2021
2 parents 31800f3 + 40dcbe2 commit db2081b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.github.jrvansuita:PickImage:2.2.4'
implementation 'com.github.jrvansuita:PickImage:2.5.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.loopj.android:android-async-http:1.4.9'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public void onPickResult(PickResult r) {
String compressed=compressImage(file);
countrycode=sharedPreferences.getString("RegionCode","");
String baseurl=sharedPreferences.getString("BaseUrl","https://api.platerecognizer.com/v1/plate-reader/");
// Log.d("response", "filepath: "+file+" ");


Log.d("response", "filepath: "+file+" ");
try {
params.put("upload", new File(compressed));
} catch (FileNotFoundException e) {
Expand Down Expand Up @@ -184,7 +186,7 @@ public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
Log.d("response ",response.toString()+" ");
try {
//image path
imagepath="https://app.platerecognizer.com/media/uploads/"+df.format(date)+response.getString("filename");
imagepath="https://us-east-1.linodeobjects.com/platerec-api/uploads/"+df.format(date)+response.getString("filename");
//json array or results
JSONArray Jsresults = response.getJSONArray("results");
if (Jsresults.length()>0)
Expand Down Expand Up @@ -472,7 +474,7 @@ public String compressImage(String filePath) {
e.printStackTrace();
}
FileOutputStream out = null;
String filename = getFilename();
String filename = getFilename(this);
try {
out = new FileOutputStream(filename);
// write the compressed bitmap at the destination specified by filename.
Expand All @@ -483,8 +485,8 @@ public String compressImage(String filePath) {
}
return filename;
}
public static String getFilename() {
File file = new File(Environment.getExternalStorageDirectory().getPath(), ".Foldername/PlateRecognizerHistory");
public static String getFilename(Context context) {
File file = new File(context.getFilesDir().getPath(), ".Foldername/PlateRecognizerHistory");

if (!file.exists()) {
file.mkdirs();
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ org.gradle.jvmargs=-Xmx1536m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

android.enableJetifier=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.

0 comments on commit db2081b

Please sign in to comment.