├── .gitignore
├── .idea
├── .name
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── glowingsoft
│ │ └── carplaterecognizer
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ │ └── com
│ │ │ └── glowingsoft
│ │ │ └── carplaterecognizer
│ │ │ ├── api
│ │ │ ├── GlobleClass.java
│ │ │ └── WebRequest.java
│ │ │ ├── ui
│ │ │ ├── EditActivity.java
│ │ │ ├── MainActivity.java
│ │ │ └── SettingActivity.java
│ │ │ └── utils
│ │ │ └── InputFilterMinMax.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── ic_add_a_photo_white_24dp.png
│ │ ├── ic_arrow_back_white_24dp.png
│ │ ├── ic_keyboard_arrow_left_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_a400_24dp.png
│ │ ├── ic_mode_edit_white_24dp.png
│ │ ├── ic_settings_white_24dp.png
│ │ └── ic_share_white_24dp.png
│ │ ├── drawable-mdpi
│ │ ├── ic_add_a_photo_white_24dp.png
│ │ ├── ic_arrow_back_white_24dp.png
│ │ ├── ic_keyboard_arrow_left_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_a400_24dp.png
│ │ ├── ic_mode_edit_white_24dp.png
│ │ ├── ic_settings_white_24dp.png
│ │ └── ic_share_white_24dp.png
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable-xhdpi
│ │ ├── ic_add_a_photo_white_24dp.png
│ │ ├── ic_arrow_back_white_24dp.png
│ │ ├── ic_keyboard_arrow_left_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_a400_24dp.png
│ │ ├── ic_mode_edit_white_24dp.png
│ │ ├── ic_settings_white_24dp.png
│ │ └── ic_share_white_24dp.png
│ │ ├── drawable-xxhdpi
│ │ ├── ic_add_a_photo_white_24dp.png
│ │ ├── ic_arrow_back_white_24dp.png
│ │ ├── ic_keyboard_arrow_left_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_a400_24dp.png
│ │ ├── ic_mode_edit_white_24dp.png
│ │ ├── ic_settings_white_24dp.png
│ │ └── ic_share_white_24dp.png
│ │ ├── drawable-xxxhdpi
│ │ ├── ic_add_a_photo_white_24dp.png
│ │ ├── ic_arrow_back_white_24dp.png
│ │ ├── ic_keyboard_arrow_left_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_500_36dp.png
│ │ ├── ic_mode_edit_light_blue_a400_24dp.png
│ │ ├── ic_mode_edit_white_24dp.png
│ │ ├── ic_settings_white_24dp.png
│ │ └── ic_share_white_24dp.png
│ │ ├── drawable
│ │ ├── cam.png
│ │ ├── edittext_background.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── loadingimage.gif
│ │ ├── nothingtoshow.png
│ │ ├── numpl.jpg
│ │ ├── photo.png
│ │ └── upload.png
│ │ ├── font
│ │ └── poppins.xml
│ │ ├── layout
│ │ ├── activity_edit.xml
│ │ ├── activity_main.xml
│ │ └── activity_setting.xml
│ │ ├── menu
│ │ └── main_menu.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ └── logo.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── font_certs.xml
│ │ ├── preloaded_fonts.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── glowingsoft
│ └── carplaterecognizer
│ └── ExampleUnitTest.java
├── assets
└── screenshot.jpg
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | Plate Recognizer
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | xmlns:android
11 |
12 | ^$
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | xmlns:.*
22 |
23 | ^$
24 |
25 |
26 | BY_NAME
27 |
28 |
29 |
30 |
31 |
32 |
33 | .*:id
34 |
35 | http://schemas.android.com/apk/res/android
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | .*:name
45 |
46 | http://schemas.android.com/apk/res/android
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | name
56 |
57 | ^$
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | style
67 |
68 | ^$
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | .*
78 |
79 | ^$
80 |
81 |
82 | BY_NAME
83 |
84 |
85 |
86 |
87 |
88 |
89 | .*
90 |
91 | http://schemas.android.com/apk/res/android
92 |
93 |
94 | ANDROID_ATTRIBUTE_ORDER
95 |
96 |
97 |
98 |
99 |
100 |
101 | .*
102 |
103 | .*
104 |
105 |
106 | BY_NAME
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## LPR Android App
2 |
3 | - **Download** the [APK package](https://github.com/parkpow/alpr-anpr-android/releases).
4 | - You can also build it from source. We recommand using [Android Studio](https://developer.android.com/studio).
5 | - Get an **API token** from [Plate Recognizer](https://platerecognizer.com/) and put it in the app settings.
6 | - You may also want to check a [similar project](https://github.com/kjbaker-uk/platerecognizer-android-example) in Kotlin.
7 |
8 | 
9 |
10 | ## Automatic License Plate Recognition (ALPR, ANPR) on Mobile App - Android
11 | Get high-accuracy, developer-friendly **automatic license plate recognition** ([ALPR](https://platerecognizer.com/?utm_source=github&utm_medium=website)) or automatic number plate recognition ([ANPR](https://platerecognizer.com/?utm_source=github&utm_medium=website)) on a mobile app in Android!
12 |
13 | Our machine-learning software:
14 |
15 | - Works on **dark, low-res, blurry images** and tough angles, all vehicle types, etc. See our full [ALPR results](https://platerecognizer.com/alpr-results/?utm_source=github&utm_medium=website).
16 | - Decodes **license plate** , vehicle type (e.g. SUV, van, pickup truck), [**vehicle make model**](https://platerecognizer.com/vehicle-make-model-recognition-with-color/?utm_source=github&utm_medium=website) (e.g. Honda Accord), color, and orientation. Ignores bumper stickers, car signs, etc.
17 | - Is optimized for all [50 USA States](https://platerecognizer.com/alpr-for-usa/?utm_source=github&utm_medium=website), [India](https://platerecognizer.com/anpr-for-india?utm_source=github&utm_medium=website), [Brazil](https://platerecognizer.com/anpr-for-brazil/?utm_source=github&utm_medium=website) and [**90+ countries worldwide**](https://platerecognizer.com/countries/?utm_source=github&utm_medium=website).
18 |
19 | Using this Android Mobile App, you can easily take a photo with your phone camera and the app will decode the license plate seen in the photo.
20 |
21 | Sign up for a [**Free Trial**](https://app.platerecognizer.com/accounts/signup/?utm_source=github&utm_medium=website) now (no credit card required) or **learn more** at [https://platerecognizer.com](https://platerecognizer.com/).
22 |
23 | 
24 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "30.0.2"
6 | defaultConfig {
7 | applicationId "com.glowingsoft.carplaterecognizer"
8 | minSdkVersion 19
9 | targetSdkVersion 30
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(dir: 'libs', include: ['*.jar'])
24 | implementation 'androidx.appcompat:appcompat:1.1.0'
25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
26 | testImplementation 'junit:junit:4.12'
27 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
28 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
29 |
30 | implementation 'com.github.jrvansuita:PickImage:2.5.1'
31 | implementation 'id.zelory:compressor:2.1.0'
32 | implementation 'com.squareup.picasso:picasso:2.5.2'
33 | implementation 'com.loopj.android:android-async-http:1.4.11'
34 | implementation 'com.google.android.material:material:1.1.0'
35 | }
36 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/glowingsoft/carplaterecognizer/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.glowingsoft.carplaterecognizer", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
19 |
23 |
27 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
42 |
45 |
46 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/api/GlobleClass.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.api;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | public class GlobleClass extends Application {
7 | private static final String TAG="Global class";
8 | public static final String BASE_URL = "https://api.platerecognizer.com/";
9 | public static GlobleClass singleton;
10 |
11 | @Override
12 | public void onCreate() {
13 | super.onCreate();
14 | Log.d("response", "onCreate: url sent");
15 | singleton=this;
16 | }
17 | public static GlobleClass getInstance(){
18 | return singleton;
19 | }
20 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/api/WebRequest.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.api;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.preference.PreferenceManager;
6 | import android.util.Log;
7 |
8 | import com.glowingsoft.carplaterecognizer.ui.MainActivity;
9 | import com.loopj.android.http.AsyncHttpClient;
10 | import com.loopj.android.http.RequestParams;
11 | import com.loopj.android.http.ResponseHandlerInterface;
12 |
13 | public class WebRequest {
14 | public static AsyncHttpClient client;
15 |
16 | static {
17 | //create object of loopj client
18 | //443 will save you from ssl exception
19 | client = new AsyncHttpClient(true, 80, 443);
20 |
21 |
22 | }
23 |
24 | //concatenation of base url and file name
25 | // private static String getAbsoluteUrl(String relativeUrl) {
26 | // Log.d("response URL: ", GlobleClass.BASE_URL + relativeUrl+" ");
27 | // return GlobleClass.BASE_URL + relativeUrl;
28 | // }
29 | public static void post(Context context, String url, RequestParams params, ResponseHandlerInterface responseHandler) {
30 | client.post(context, url,params, responseHandler);
31 | Log.d("response", "post: request sent");
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/ui/EditActivity.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.ui;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.annotation.SuppressLint;
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 | import android.widget.ImageButton;
12 |
13 | import com.glowingsoft.carplaterecognizer.R;
14 |
15 | import javax.sql.StatementEvent;
16 |
17 | public class EditActivity extends AppCompatActivity {
18 | EditText plate,region,vihical;
19 | Button saveResult;
20 | ImageButton back;
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_edit);
25 | getSupportActionBar().hide();
26 | back=findViewById(R.id.back_btn_type);
27 | back.setOnClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View v) {
30 | finish();
31 | }
32 | });
33 | plate = findViewById(R.id.car_plate_edit);
34 | region = findViewById(R.id.region_code_edit);
35 | vihical = findViewById(R.id.vihical_type_edit);
36 | Intent intent = getIntent();
37 | plate.setText(intent.getStringExtra("car_plate"));
38 | region.setText(intent.getStringExtra("region_code"));
39 | vihical.setText(intent.getStringExtra("car_type"));
40 | saveResult = findViewById(R.id.save_btn);
41 | saveResult.setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View v) {
44 | saveDate();
45 | }
46 | });
47 | }
48 |
49 | private void saveDate() {
50 | String plate_edit=plate.getText().toString();
51 | String region_edit=region.getText().toString();
52 | String car_edit=vihical.getText().toString();
53 | Intent data = new Intent();
54 | data.putExtra("car_plate",plate_edit );
55 | data.putExtra("region_code",region_edit );
56 | data.putExtra( "car_type",car_edit);
57 | setResult(RESULT_OK, data);
58 | finish();
59 |
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/ui/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.ui;
2 | import androidx.annotation.Nullable;
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.appcompat.widget.LinearLayoutCompat;
5 | import androidx.cardview.widget.CardView;
6 | import cz.msebera.android.httpclient.Header;
7 | import android.annotation.SuppressLint;
8 | import android.content.Context;
9 | import android.content.Intent;
10 | import android.content.SharedPreferences;
11 | import android.graphics.Bitmap;
12 | import android.graphics.BitmapFactory;
13 | import android.graphics.BlurMaskFilter;
14 | import android.graphics.Canvas;
15 | import android.graphics.Matrix;
16 | import android.graphics.Paint;
17 | import android.graphics.PorterDuff;
18 | import android.graphics.drawable.BitmapDrawable;
19 | import android.graphics.drawable.Drawable;
20 | import android.media.ExifInterface;
21 | import android.net.Uri;
22 | import android.os.Bundle;
23 | import android.os.Environment;
24 | import android.util.Log;
25 | import android.view.Gravity;
26 | import android.view.Menu;
27 | import android.view.MenuInflater;
28 | import android.view.MenuItem;
29 | import android.view.View;
30 | import android.widget.Button;
31 | import android.widget.ImageButton;
32 | import android.widget.ImageView;
33 | import android.widget.ProgressBar;
34 | import android.widget.TextView;
35 | import android.widget.Toast;
36 |
37 | import com.glowingsoft.carplaterecognizer.R;
38 | import com.glowingsoft.carplaterecognizer.api.WebRequest;
39 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
40 | import com.loopj.android.http.JsonHttpResponseHandler;
41 | import com.loopj.android.http.RequestParams;
42 | import com.squareup.picasso.Callback;
43 | import com.squareup.picasso.Picasso;
44 | import com.vansuita.pickimage.bean.PickResult;
45 | import com.vansuita.pickimage.bundle.PickSetup;
46 | import com.vansuita.pickimage.dialog.PickImageDialog;
47 | import com.vansuita.pickimage.enums.EPickType;
48 | import com.vansuita.pickimage.listeners.IPickResult;
49 | import org.json.JSONArray;
50 | import org.json.JSONException;
51 | import org.json.JSONObject;
52 | import java.io.File;
53 | import java.io.FileInputStream;
54 | import java.io.FileNotFoundException;
55 | import java.io.FileOutputStream;
56 | import java.io.IOException;
57 | import java.text.DateFormat;
58 | import java.text.SimpleDateFormat;
59 | import java.util.Date;
60 | import java.util.Locale;
61 | import java.util.TimeZone;
62 |
63 | public class MainActivity extends AppCompatActivity implements IPickResult,View.OnClickListener {
64 | ImageView imageView,emptyImage;
65 | TextView plate_txt,region_txt,vihical_txt;
66 | Context context;
67 | ImageButton editResult;
68 | Button nextImage;
69 | ProgressBar progressBar;
70 | SharedPreferences sharedPreferences;
71 | String SHARED_PREF_NAME ="user_pref";
72 | String token = "";
73 | String countrycode="";
74 | Date date;
75 | DateFormat df;
76 | String plate_type="",region_type="",car_type="",last_digits="",timeStamp="";
77 | CardView plateCard,regionCard,vihicalCard;
78 | FloatingActionButton floatingActionButton;
79 | String imagepath;
80 |
81 |
82 |
83 |
84 | @Override
85 | protected void onCreate(Bundle savedInstanceState) {
86 | super.onCreate(savedInstanceState);
87 | context=this;
88 | setContentView(R.layout.activity_main);
89 | sharedPreferences=getSharedPreferences(SHARED_PREF_NAME,MODE_PRIVATE);
90 | date = new Date();
91 | df = new SimpleDateFormat("MM/dd/");
92 | // Use London time zone to format the date in
93 | df.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
94 | nextImage=findViewById(R.id.next_image);
95 | nextImage.setOnClickListener(this);
96 | floatingActionButton=findViewById(R.id.fab);
97 | floatingActionButton.setOnClickListener(this);
98 | progressBar=findViewById(R.id.homeprogress);
99 | plate_txt = findViewById(R.id.car_plate);
100 | region_txt = findViewById(R.id.region_code);
101 | vihical_txt = findViewById(R.id.vihicle_type);
102 | emptyImage=findViewById(R.id.empty_image);
103 | plateCard=findViewById(R.id.cardView);
104 | vihicalCard=findViewById(R.id.cardView3);
105 | regionCard=findViewById(R.id.cardView2);
106 | editResult=findViewById(R.id.setting_edit_btn);
107 | editResult.setOnClickListener(this);
108 | imageView = findViewById(R.id.imageView);
109 | imageView.setOnClickListener(this);
110 | }
111 | //dialoag box setup
112 | @SuppressLint("WrongConstant")
113 | PickSetup setup = new PickSetup()
114 | .setTitle("Choose")
115 | .setCancelText("Cancel")
116 | .setFlip(true)
117 | .setMaxSize(50)
118 | .setWidth(50)
119 | .setHeight(50)
120 | .setProgressText("Loading Image")
121 | .setPickTypes(EPickType.GALLERY, EPickType.CAMERA)
122 | .setCameraButtonText("Camera")
123 | .setGalleryButtonText("Gallery")
124 | .setIconGravity(Gravity.TOP)
125 | .setButtonOrientation(LinearLayoutCompat.HORIZONTAL)
126 | .setSystemDialog(false)
127 | .setGalleryIcon(R.drawable.photo)
128 | .setCameraIcon(R.drawable.cam);
129 |
130 | //to change token value
131 | @Override
132 | protected void onResume() {
133 | super.onResume();
134 | // String editvisibility=plate_txt.getText().toString();
135 | if( sharedPreferences.contains("checked") && sharedPreferences.getBoolean("checked", false)) {
136 | editResult.setVisibility(View.VISIBLE);
137 | }
138 | else {
139 | editResult.setVisibility(View.GONE);
140 | }
141 | last_digits=sharedPreferences.getString("LastDigits", "");
142 | // Toast.makeText(MainActivity.this, last_digits, Toast.LENGTH_SHORT).show();
143 | token=sharedPreferences.getString("CarToken", "");
144 | if (token.equals("")){
145 | Toast.makeText(context, "Token Not Found", Toast.LENGTH_SHORT).show();
146 | }else {
147 | WebRequest.client.addHeader("Authorization","Token "+token);
148 | }
149 | }
150 | //pick result method to get image after getting image form gallary or camera
151 | @Override
152 | public void onPickResult(PickResult r) {
153 | if (r.getError() == null) {
154 | RequestParams params=new RequestParams();
155 | String file=r.getPath();
156 | String compressed=compressImage(file);
157 | countrycode=sharedPreferences.getString("RegionCode","");
158 | String baseurl=sharedPreferences.getString("BaseUrl","https://api.platerecognizer.com/v1/plate-reader/");
159 |
160 |
161 | Log.d("response", "filepath: "+file+" ");
162 | try {
163 | params.put("upload", new File(compressed));
164 | } catch (FileNotFoundException e) {
165 | e.printStackTrace();
166 | }
167 | params.put("regions",countrycode);
168 | Log.d("response", "image to upload: "+params+" ");
169 | WebRequest.post(context,baseurl,params,new JsonHttpResponseHandler()
170 | {
171 | @Override
172 | public void onStart() {
173 | progressBar.setVisibility(View.VISIBLE);
174 | region_txt.setText(null);
175 | plate_txt.setText(null);
176 | vihical_txt.setText(null);
177 | imageView.setImageResource(R.drawable.upload);
178 |
179 | Log.d("response", "onStart: ");
180 | super.onStart();
181 | }
182 | @Override
183 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
184 | super.onSuccess(statusCode, headers, response);
185 |
186 | Log.d("response ",response.toString()+" ");
187 | try {
188 | //image path
189 | imagepath="https://us-east-1.linodeobjects.com/platerec-api/uploads/"+df.format(date)+response.getString("filename");
190 | //json array or results
191 | JSONArray Jsresults = response.getJSONArray("results");
192 | if (Jsresults.length()>0)
193 | {
194 | for (int i = 0; i < Jsresults.length(); i++) {
195 | JSONObject tabObj = Jsresults.getJSONObject(i);
196 | plate_txt.setText(tabObj.getString("plate"));
197 | region_txt.setText(tabObj.getJSONObject("region").getString("code"));
198 | vihical_txt.setText(tabObj.getJSONObject("vehicle").getString("type"));
199 | timeStamp=response.getString("timestamp");
200 | Picasso.with(context)
201 | .load(imagepath)
202 | .into(imageView, new Callback() {
203 | @Override
204 | public void onSuccess() {
205 | progressBar.setVisibility(View.GONE);
206 | }
207 | @Override
208 | public void onError() {
209 |
210 | }
211 | });
212 | regionCard.setVisibility(View.VISIBLE);
213 | plateCard.setVisibility(View.VISIBLE);
214 | vihicalCard.setVisibility(View.VISIBLE);
215 | nextImage.setVisibility(View.VISIBLE);
216 | floatingActionButton.setVisibility(View.VISIBLE);
217 | emptyImage.setVisibility(View.GONE);
218 | }
219 |
220 | }
221 | } catch (JSONException e) {
222 | e.printStackTrace();
223 | }
224 | }
225 | @Override
226 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
227 | super.onFailure(statusCode, headers, throwable, errorResponse);
228 | Log.d("response1", "onFailure: " + errorResponse + " ");
229 | progressBar.setVisibility(View.GONE);
230 | editResult.setVisibility(View.GONE);
231 | regionCard.setVisibility(View.GONE);
232 | plateCard.setVisibility(View.GONE);
233 | vihicalCard.setVisibility(View.GONE);
234 | nextImage.setVisibility(View.GONE);
235 | floatingActionButton.setVisibility(View.GONE);
236 | emptyImage.setVisibility(View.VISIBLE);
237 | Toast.makeText(MainActivity.this, errorResponse+"", Toast.LENGTH_SHORT).show();
238 | }
239 | @Override
240 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONArray errorResponse) {
241 | super.onFailure(statusCode, headers, throwable, errorResponse);
242 | Log.d("response2", "onFailure: "+errorResponse+" ");
243 | progressBar.setVisibility(View.GONE);
244 | editResult.setVisibility(View.GONE);
245 | regionCard.setVisibility(View.GONE);
246 | plateCard.setVisibility(View.GONE);
247 | vihicalCard.setVisibility(View.GONE);
248 | nextImage.setVisibility(View.GONE);
249 | emptyImage.setVisibility(View.VISIBLE);
250 | Toast.makeText(MainActivity.this,errorResponse.toString()+"",Toast.LENGTH_LONG).show();
251 | }
252 | @Override
253 | public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
254 | super.onFailure(statusCode, headers, responseString, throwable);
255 | Log.d("response3", "onFailure: "+responseString+" ");
256 | progressBar.setVisibility(View.GONE);
257 | editResult.setVisibility(View.GONE);
258 | regionCard.setVisibility(View.GONE);
259 | plateCard.setVisibility(View.GONE);
260 | vihicalCard.setVisibility(View.GONE);
261 | nextImage.setVisibility(View.GONE);
262 | emptyImage.setVisibility(View.VISIBLE);
263 | Toast.makeText(MainActivity.this,responseString+"No Internet Connection",Toast.LENGTH_LONG).show();
264 | }
265 | });
266 | } else {
267 | //Handle possible errors
268 | //TODO: do what you have to do with r.getError();
269 | Toast.makeText(this, r.getError().getMessage(), Toast.LENGTH_LONG).show();
270 | }
271 | }
272 |
273 | @Override
274 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
275 | super.onActivityResult(requestCode, resultCode, data);
276 | //check if request code is for inserting new list then perform insertion
277 | if (requestCode == 123 && resultCode == RESULT_OK) {
278 | String plate = data.getStringExtra("car_plate");
279 | String region = data.getStringExtra("region_code");
280 | String car = data.getStringExtra("car_type");
281 | Log.d("response", "onActivityResult: "+plate+" ");
282 | plate_txt.setText(plate);
283 | region_txt.setText(region);
284 | vihical_txt.setText(car);
285 | Toast.makeText(this, "Results saved", Toast.LENGTH_SHORT).show();
286 | }
287 | }
288 | @Override
289 | public void onClick(View v) {
290 | if (v.getId()==R.id.imageView)
291 | {
292 | if (token.isEmpty()) {
293 | Toast.makeText(this,"Go to Settings to Set Your Token", Toast.LENGTH_LONG).show();
294 | return;
295 | }
296 | PickImageDialog.build(setup).show(MainActivity.this);
297 | }
298 | if (v.getId()==R.id.setting_edit_btn)
299 | {
300 |
301 | plate_type = plate_txt.getText().toString();
302 | region_type=region_txt.getText().toString();
303 | car_type=vihical_txt.getText().toString();
304 | if (plate_type.isEmpty())
305 | {
306 | Toast.makeText(MainActivity.this,"Nothing to Edit Now",Toast.LENGTH_SHORT).show();
307 | }
308 | else {
309 | Intent intent = new Intent(MainActivity.this, EditActivity.class);
310 | intent.putExtra("car_plate", plate_type);
311 | intent.putExtra("region_code", region_type);
312 | intent.putExtra("car_type", car_type);
313 | startActivityForResult(intent, 123);
314 | }
315 | }
316 | if (v.getId()==R.id.next_image)
317 | {
318 | PickImageDialog.build(setup).show(MainActivity.this);
319 | }
320 | if (v.getId()==R.id.fab)
321 | {
322 | String plate = plate_txt.getText().toString();
323 | String region = region_txt.getText().toString();
324 | String car = vihical_txt.getText().toString();
325 | Uri bmpUri = getLocalBitmapUri(imageView);
326 | //set it as current date.
327 | String share="Date & TimeStamp: "+timeStamp+"\nCar Plate: "+plate+"\nRegion Code: "+region+"\nVihicle Type: "+car+"\nToken Code: "+last_digits;
328 | Log.d("response", "onActivityResult: "+plate+" ");
329 | if (bmpUri != null) {
330 | Uri imageUri = Uri.parse("android.resource://" + getPackageName()
331 | + "/drawable/" + "ic_launcher");
332 | Intent shareIntent = new Intent();
333 | shareIntent.setAction(Intent.ACTION_SEND);
334 | shareIntent.putExtra(Intent.EXTRA_TEXT, share);
335 | shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
336 | shareIntent.setType("image/jpeg");
337 | shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
338 | startActivity(Intent.createChooser(shareIntent, "send"));
339 | }
340 | else {
341 | Log.d("response", "onFailure:");
342 | }
343 | }
344 | }
345 |
346 |
347 | @Override
348 | public boolean onCreateOptionsMenu(Menu menu) {
349 | MenuInflater inflater = getMenuInflater();
350 | inflater.inflate(R.menu.main_menu, menu);
351 | return true;
352 | }
353 | @Override
354 | public boolean onOptionsItemSelected(MenuItem item) {
355 | if (item.getItemId()==R.id.settings)
356 | {
357 | Intent intent =new Intent(MainActivity.this,SettingActivity.class);
358 | startActivity(intent);
359 | return true;
360 | }
361 | return super.onOptionsItemSelected(item);
362 | }
363 | public Uri getLocalBitmapUri(ImageView imageView) {
364 | // Extract Bitmap from ImageView drawable
365 | Drawable drawable = imageView.getDrawable();
366 | Bitmap bmp = null;
367 | if (drawable instanceof BitmapDrawable){
368 | bmp = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
369 | } else {
370 | return null;
371 | }
372 | // Store image to default external storage directory
373 | Uri bmpUri = null;
374 | try {
375 | File file = new File(Environment.getExternalStorageDirectory().getPath(),
376 | ".Foldername/PlateRecognizer" + System.currentTimeMillis() + ".jpeg");
377 | file.getParentFile().mkdirs();
378 | FileOutputStream out = new FileOutputStream(file);
379 | bmp.compress(Bitmap.CompressFormat.JPEG, 100, out);
380 | out.close();
381 | bmpUri = Uri.fromFile(file);
382 | } catch (IOException e) {
383 | e.printStackTrace();
384 | }
385 | return bmpUri;
386 | }
387 |
388 | public String compressImage(String filePath) {
389 |
390 | int resized=sharedPreferences.getInt("Resize", -1);
391 |
392 | Bitmap scaledBitmap = null;
393 | BitmapFactory.Options options = new BitmapFactory.Options();
394 | options.inJustDecodeBounds = true;
395 | Bitmap bmp = BitmapFactory.decodeFile(filePath, options);
396 |
397 | int actualHeight = options.outHeight;
398 | int actualWidth = options.outWidth;
399 |
400 | float maxHeight =resized*7.0f;
401 | float maxWidth = resized*12.0f;
402 | float imgRatio = actualWidth / actualHeight;
403 | float maxRatio = maxWidth / maxHeight;
404 |
405 | if (actualHeight > maxHeight || actualWidth > maxWidth)
406 | {
407 | if (imgRatio < maxRatio) {
408 | imgRatio = maxHeight / actualHeight;
409 | actualWidth = (int) (imgRatio * actualWidth);
410 | actualHeight = (int) maxHeight;
411 |
412 | } else if (imgRatio > maxRatio) {
413 | imgRatio = maxWidth / actualWidth;
414 | actualHeight = (int) (imgRatio * actualHeight);
415 | actualWidth = (int) maxWidth;
416 | } else {
417 | actualHeight = (int) maxHeight;
418 | actualWidth = (int) maxWidth;
419 | }
420 | }
421 | options.inSampleSize = calculateInSampleSize(options, actualWidth,
422 | actualHeight);
423 | // inJustDecodeBounds set to false to load the actual bitmap
424 | options.inJustDecodeBounds = false;
425 | // this options allow android to claim the bitmap memory if it runs low on memory
426 | options.inPurgeable = true;
427 | options.inInputShareable = true;
428 | options.inTempStorage = new byte[16 * 1024];
429 | try {
430 | // load the bitmap from its path
431 | bmp = BitmapFactory.decodeFile(filePath, options);
432 | } catch (OutOfMemoryError exception) {
433 | exception.printStackTrace();
434 | }
435 | try {
436 | scaledBitmap = Bitmap.createBitmap(actualWidth,
437 | actualHeight,Bitmap.Config.ARGB_8888);
438 | } catch (OutOfMemoryError exception) {
439 | exception.printStackTrace();
440 | }
441 | float ratioX = actualWidth / (float) options.outWidth;
442 | float ratioY = actualHeight / (float) options.outHeight;
443 | float middleX = actualWidth / 2.0f;
444 | float middleY = actualHeight / 2.0f;
445 |
446 | Matrix scaleMatrix = new Matrix();
447 | scaleMatrix.setScale(ratioX, ratioY, middleX, middleY);
448 |
449 | Canvas canvas = new Canvas(scaledBitmap);
450 | canvas.setMatrix(scaleMatrix);
451 | canvas.drawBitmap(bmp, middleX - bmp.getWidth() / 2, middleY - bmp.getHeight() / 2, new Paint(Paint.FILTER_BITMAP_FLAG));
452 | // check the rotation of the image and display it properly
453 | ExifInterface exif;
454 | try {
455 | exif = new ExifInterface(filePath);
456 | int orientation = exif.getAttributeInt(
457 | ExifInterface.TAG_ORIENTATION, 0);
458 | Log.d("EXIF", "Exif: " + orientation);
459 | Matrix matrix = new Matrix();
460 | if (orientation == 6) {
461 | matrix.postRotate(90);
462 | Log.d("EXIF", "Exif: " + orientation);
463 | } else if (orientation == 3) {
464 | matrix.postRotate(180);
465 | Log.d("EXIF", "Exif: " + orientation);
466 | } else if (orientation == 8) {
467 | matrix.postRotate(270);
468 | Log.d("EXIF", "Exif: " + orientation);
469 | }
470 | scaledBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0,
471 | scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix,
472 | true);
473 | } catch (IOException e) {
474 | e.printStackTrace();
475 | }
476 | FileOutputStream out = null;
477 | String filename = getFilename(this);
478 | try {
479 | out = new FileOutputStream(filename);
480 | // write the compressed bitmap at the destination specified by filename.
481 | scaledBitmap.compress(Bitmap.CompressFormat.JPEG, resized, out);
482 |
483 | } catch (FileNotFoundException e) {
484 | e.printStackTrace();
485 | }
486 | return filename;
487 | }
488 | public static String getFilename(Context context) {
489 | File file = new File(context.getFilesDir().getPath(), ".Foldername/PlateRecognizerHistory");
490 |
491 | if (!file.exists()) {
492 | file.mkdirs();
493 | }
494 | String uriSting = (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".jpg");
495 |
496 | return uriSting;
497 |
498 | }
499 |
500 | public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
501 |
502 | final int height = options.outHeight;
503 |
504 | final int width = options.outWidth;
505 |
506 | int inSampleSize = 1;
507 |
508 | if (height > reqHeight || width > reqWidth) {
509 |
510 | final int heightRatio = Math.round((float) height/ (float)
511 | reqHeight);
512 |
513 | final int widthRatio = Math.round((float) width / (float) reqWidth);
514 |
515 | inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;
516 |
517 | } final float totalPixels = width * height;
518 |
519 | final float totalReqPixelsCap = reqWidth * reqHeight * 2;
520 |
521 | while (totalPixels / (inSampleSize * inSampleSize) > totalReqPixelsCap) {
522 | inSampleSize++;
523 | }
524 | return inSampleSize;
525 | }
526 | }
527 |
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/ui/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.ui;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.constraintlayout.widget.ConstraintLayout;
5 |
6 | import android.content.SharedPreferences;
7 | import android.os.Bundle;
8 | import android.text.InputFilter;
9 | import android.view.View;
10 | import android.widget.AdapterView;
11 | import android.widget.ArrayAdapter;
12 | import android.widget.Button;
13 | import android.widget.CheckBox;
14 | import android.widget.EditText;
15 | import android.widget.ImageButton;
16 | import android.widget.Spinner;
17 | import android.widget.TextView;
18 | import android.widget.Toast;
19 |
20 | import com.glowingsoft.carplaterecognizer.utils.InputFilterMinMax;
21 | import com.glowingsoft.carplaterecognizer.R;
22 |
23 | import java.util.ArrayList;
24 |
25 | public class SettingActivity extends AppCompatActivity {
26 | EditText apitoken,regionCodeEdit;
27 | Button applychanged;
28 | String SHARED_PREF_NAME ="user_pref";
29 | SharedPreferences pref;
30 | ImageButton imageButton;
31 | TextView currenttoken;
32 | SharedPreferences.Editor editor;
33 | ConstraintLayout currentlayout,editlayout;
34 | String token = "";
35 | // String token = "ddecd03711e795147f3feb345ec198eff5d957b6";
36 | String defaultUrl="https://api.platerecognizer.com/v1/plate-reader/";
37 | String regioncode="";
38 | CheckBox checkBox;
39 | EditText urlEdit;
40 | Spinner resizeImageEdit;
41 | ArrayAdapter adapter;
42 |
43 | @Override
44 | protected void onCreate(Bundle savedInstanceState) {
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.activity_setting);
47 | getSupportActionBar().hide();
48 | currentlayout=findViewById(R.id.current_token_layout);
49 | editlayout=findViewById(R.id.edit_current_token_layout);
50 | imageButton=findViewById(R.id.setting_edit_btn);
51 | currenttoken=findViewById(R.id.current_token);
52 | checkBox=findViewById(R.id.checkBox);
53 | resizeImageEdit = findViewById(R.id.spinner);
54 | // Create an ArrayAdapter using the string array and a default spinner layout
55 | adapter = ArrayAdapter.createFromResource(this,
56 | R.array.size, android.R.layout.simple_spinner_item);
57 | // Specify the layout to use when the list of choices appears
58 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
59 | // Apply the adapter to the spinner
60 | resizeImageEdit.setAdapter(adapter);
61 | urlEdit=findViewById(R.id.default_url);
62 | urlEdit.setText(defaultUrl);
63 |
64 | imageButton.setOnClickListener(new View.OnClickListener() {
65 | @Override
66 | public void onClick(View v) {
67 | currentlayout.setVisibility(View.GONE);
68 | editlayout.setVisibility(View.VISIBLE);
69 | }
70 | });
71 |
72 | pref =getSharedPreferences(SHARED_PREF_NAME, MODE_PRIVATE);
73 | editor = pref.edit();;
74 | ImageButton back =findViewById(R.id.backT_btn_type);
75 | back.setOnClickListener(new View.OnClickListener() {
76 | @Override
77 | public void onClick(View v) {
78 | finish();
79 | }
80 | });
81 | apitoken=findViewById(R.id.token_Code);
82 | regionCodeEdit=findViewById(R.id.editText2);
83 | regioncode=pref.getString("RegionCode","");
84 | regionCodeEdit.setText(regioncode);
85 | applychanged=findViewById(R.id.button);
86 | String settoken="";
87 | String edittedtoken ="",gettoken="";
88 | edittedtoken=pref.getString("CarToken", "");
89 | apitoken.setText(edittedtoken);
90 | if (edittedtoken.isEmpty())
91 | {
92 | currenttoken.setText("No Token");
93 | apitoken.setText(token);
94 | }
95 | if (!edittedtoken.isEmpty()) {
96 | gettoken = apitoken.getText().toString();
97 | settoken = gettoken.substring(gettoken.length() - 6);
98 | currenttoken.setText("**********" + settoken);
99 | }
100 | applychanged.setOnClickListener(new View.OnClickListener() {
101 | @Override
102 | public void onClick(View v) {
103 | if (apitoken.equals("") || apitoken.length()<1){
104 | apitoken.setError("Add Token");
105 | }else {
106 | String currentToken = apitoken.getText().toString();
107 | editor.putString("CarToken", currentToken).apply();
108 | String regioncodes =regionCodeEdit.getText().toString();
109 | editor.putString("RegionCode",regioncodes).apply();
110 | String lastDigits = currentToken.substring(currentToken.length()-6);
111 | editor.putString("LastDigits",lastDigits).apply();
112 | String reziseString=resizeImageEdit.getSelectedItem().toString();
113 | int resizeInt=Integer.parseInt(reziseString);
114 | editor.putInt("Resize",resizeInt).apply();
115 | String baseurl = urlEdit.getText().toString();
116 | editor.putString("BaseUrl",baseurl);
117 |
118 | // save inputed spinner position to sharedpreferences
119 | int userChoice = resizeImageEdit.getSelectedItemPosition();
120 | editor.putInt("userChoiceSpinner", userChoice);
121 | editor.commit();
122 | finish();
123 | Toast.makeText(SettingActivity.this, "Saved Successfully", Toast.LENGTH_SHORT).show();
124 | }
125 | if(checkBox.isChecked()) {
126 | editor.putBoolean("checked", true);
127 | editor.apply();
128 | }else{
129 | editor.putBoolean("checked", false);
130 | editor.apply();
131 | }
132 | }
133 | });
134 | }
135 |
136 | @Override
137 | protected void onResume() {
138 | super.onResume();
139 | if(pref.contains("checked") && pref.getBoolean("checked",false) == true) {
140 | checkBox.setChecked(true);
141 | }else {
142 | checkBox.setChecked(false);
143 | }
144 | String baseurl=pref.getString("BaseUrl","https://api.platerecognizer.com/v1/plate-reader/");
145 | urlEdit.setText(baseurl);
146 |
147 | int spinnerValue = pref.getInt("userChoiceSpinner",-1);
148 | if(spinnerValue != -1)
149 | // set the value of the spinner
150 | resizeImageEdit.setSelection(spinnerValue);
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/app/src/main/java/com/glowingsoft/carplaterecognizer/utils/InputFilterMinMax.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer.utils;
2 |
3 | import android.text.InputFilter;
4 | import android.text.Spanned;
5 |
6 | public class InputFilterMinMax implements InputFilter {
7 | private int min, max;
8 |
9 | public InputFilterMinMax(int min, int max) {
10 | this.min = min;
11 | this.max = max;
12 | }
13 | @Override
14 | public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
15 | try {
16 | int input = Integer.parseInt(dest.toString() + source.toString());
17 | if (isInRange(min, max, input))
18 | return null;
19 | } catch (NumberFormatException nfe) { }
20 | return "";
21 | }
22 |
23 | private boolean isInRange(int a, int b, int c) {
24 | return b > a ? c >= a && c <= b : c >= b && c <= a;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_add_a_photo_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_add_a_photo_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_keyboard_arrow_left_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_keyboard_arrow_left_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_mode_edit_light_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_mode_edit_light_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_mode_edit_light_blue_a400_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_mode_edit_light_blue_a400_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_mode_edit_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_mode_edit_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_settings_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_settings_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_add_a_photo_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_add_a_photo_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_keyboard_arrow_left_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_keyboard_arrow_left_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_mode_edit_light_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_mode_edit_light_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_mode_edit_light_blue_a400_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_mode_edit_light_blue_a400_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_mode_edit_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_mode_edit_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_settings_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_settings_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-mdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_add_a_photo_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_add_a_photo_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_left_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_left_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_mode_edit_light_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_mode_edit_light_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_mode_edit_light_blue_a400_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_mode_edit_light_blue_a400_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_mode_edit_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_mode_edit_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_add_a_photo_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_add_a_photo_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_left_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_left_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_mode_edit_light_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_mode_edit_light_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_mode_edit_light_blue_a400_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_mode_edit_light_blue_a400_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_mode_edit_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_mode_edit_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_add_a_photo_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_add_a_photo_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_arrow_back_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_arrow_back_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_left_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_left_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_light_blue_500_36dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_light_blue_500_36dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_light_blue_a400_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_light_blue_a400_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/cam.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/edittext_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/loadingimage.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/loadingimage.gif
--------------------------------------------------------------------------------
/app/src/main/res/drawable/nothingtoshow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/nothingtoshow.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/numpl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/numpl.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/photo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/drawable/upload.png
--------------------------------------------------------------------------------
/app/src/main/res/font/poppins.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
55 |
56 |
72 |
73 |
89 |
90 |
107 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
14 |
15 |
18 |
19 |
20 |
35 |
36 |
47 |
48 |
49 |
50 |
60 |
61 |
75 |
76 |
81 |
82 |
86 |
87 |
97 |
98 |
99 |
100 |
101 |
102 |
105 |
106 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
137 |
138 |
142 |
143 |
147 |
148 |
158 |
159 |
160 |
161 |
164 |
165 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
198 |
199 |
203 |
204 |
208 |
209 |
219 |
220 |
221 |
222 |
223 |
224 |
227 |
228 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
266 |
267 |
281 |
282 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
31 |
32 |
38 |
39 |
40 |
44 |
45 |
46 |
49 |
50 |
67 |
68 |
79 |
80 |
96 |
97 |
110 |
111 |
112 |
113 |
129 |
130 |
146 |
147 |
164 |
165 |
181 |
182 |
191 |
192 |
206 |
207 |
219 |
220 |
234 |
235 |
236 |
251 |
252 |
268 |
274 |
275 |
276 |
277 |
290 |
291 |
308 |
309 |
327 |
328 |
341 |
342 |
343 |
344 |
345 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xhdpi/logo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #40C4FF
4 | #2F99C9
5 | #928B8E
6 | #ffff
7 | #000
8 | #FAFAFA
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/poppins
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Plate Recognizer
3 | Plate Recognizer offers FREE Plans with high-accuracy license and plate recognition in over 60 countries worldwide
4 | 2-letter country code separated by a space: gd de it fr USA and Australia can include the state:us-ca au-qld
5 |
6 | - 100
7 | - 90
8 | - 80
9 | - 70
10 | - 60
11 | - 50
12 | - 40
13 | - 30
14 | - 20
15 | - 10
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/glowingsoft/carplaterecognizer/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.glowingsoft.carplaterecognizer;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/assets/screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/assets/screenshot.jpg
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.1'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | maven { url "https://jitpack.io" }
22 |
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/parkpow/alpr-anpr-android/05315858c60415e772bd41affed4d0806ef3a8ef/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jan 26 23:39:58 PKT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name='Plate Recognizer'
3 |
--------------------------------------------------------------------------------