SandroMachado / openalpr-android

Android Automatic License Plate Recognition library (http://www.openalpr.com) ported for android.
Apache License 2.0
770 stars 272 forks source link

issue in changing package name #29

Closed Aman91Goyal closed 8 years ago

Aman91Goyal commented 8 years ago

HI, I need to change the package name, i have successfully compiled it and added in my project. But when i am changing package name it gives me error in initializing OPEN ALPR. Now i am trying to create the .so file, but i am not able to find .cpp and Android.mk files in this project to generate .so files . Please share link for files, it will be helpful for me. TIA.

Aman91Goyal commented 8 years ago

Hi Sandro,

Actually, i have implements same library in our project, i have added application Id specified in Gradle. If i am changing application id OPEN ALP is not initializing. As per my understanding, if i will keep same application id, my application will not be deployed on play store as their must be a App with same application id. com.sandro.openalprsample

Please suggest me how i can use this library in my project with different application id.

TIA.

SandroMachado commented 8 years ago

Hi @Aman91Goyal,

can you please be more specific? Are you trying to change the package name of the library? Or of the demo project? Did you follow the steps at the readmeof the project to add the library to your project?

Regards

Aman91Goyal commented 8 years ago

Hi Sandro,

I am not changing the package name of library. As you know in android studio, you gave application id which is com.sandro.openalprsample.

I have successfully set up library in my demo and changed the package name of my launcher activity. Launcher activity is same where i am opening camera and scanning image. In my demo i have only one activity.

But now issue is, in gradle file you have mentioned application id, when i am generating build, it takes the reference of application id not the main package of demo.

So i am trying to change the name of application id. After changing the application id, it gives me error in initializing open ALPR and not returning any result.

TIA.

SandroMachado commented 8 years ago

Hi @Aman91Goyal,

did you update the ANDROID_DATA_DIR to match your new package name? Check this section: https://github.com/SandroMachado/openalpr-android#code

Please let me know if that works for your.

Regards

Aman91Goyal commented 8 years ago

HI Sandro

I have initialize ANDROID_DATA_DIR= this.getApplicationInfo().dataDir;

it will always get current package name. /data/data/own package name

defaultConfig {
        applicationId "own package name"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0.1"
    }

In above code if i will enter com.sandro.openalprsample as applicationid its working fine

SandroMachado commented 8 years ago

Hi @Aman91Goyal,

did you also updated the path at the config file?

Regards

Aman91Goyal commented 8 years ago

HI Sandro

Thank you so much. You saved my time.

SandroMachado commented 8 years ago

Great! Thanks