amorenew / uhf_c72_plugin

BSD 3-Clause "New" or "Revised" License
11 stars 6 forks source link

Not Scanning Rfid Tag In Android Version 11 #6

Open Justin-roy opened 1 year ago

Justin-roy commented 1 year ago

I'm Using C72 Device It's Won't Working On Android 11 but working On Android 8

amorenew commented 1 year ago

@Justin-roy I don't have the hardware of reader c72 as I left the company which I made this plugin for, so I can't help. But if you have the official SDK then you can use this plugin as a guideline to build your own plugin

Justin-roy commented 1 year ago

Like I don't know how integrate/upgrade can u please provide link or resouces for implementation.

amorenew commented 1 year ago

@Justin-roy You need to know some java background to integrate the existing SDK you have from your hardware provider

More info about creating a plugin for Flutter https://codelabs.developers.google.com/codelabs/write-flutter-plugin#0 https://docs.flutter.dev/development/packages-and-plugins/developing-packages

Justin-roy commented 1 year ago

So, can i replace with latest sdk in android/libs with --> cw-deviceapi20191022 to cw-deviceapi20220607

amorenew commented 1 year ago

@Justin-roy I am not sure if it would work or not

Justin-roy commented 1 year ago

Hey please tell me how you integrate native sdk for flutter. like step 1. create folder in libs in android/libs etc. it's really helpful for beginners.

amorenew commented 1 year ago

@Justin-roy The first step is to clean up the existing native sample from your hardware provider. You need to make a helper class like this file which contains all possible functions I needed https://github.com/amorenew/uhf_c72_plugin/blob/master/android/src/main/java/com/amorenew/c72/uhf_plugin/helper/UHFHelper.java

Do you know Java?

Justin-roy commented 1 year ago

Yes I need this all functionality like this and yeah I know java. this is the latest sdk for android 11 how to integrate this. link:-https://www.chainway.net/download/SDKs-Android/demo-uhf_as.rar

amorenew commented 1 year ago

@Justin-roy After replacing the libs jars is it working for you? If the helper is same and you replaced jars then I don't know what could be missing

Justin-roy commented 1 year ago

not working

amorenew commented 1 year ago

@Justin-roy Do you have any errors while running the project? like permission error? And do your example still works after replacing jars on Android 8?

amorenew commented 1 year ago

@Justin-roy I suspect it is permissions issue, I don't have the following code in my library

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { // 先判断有没有权限 if (!Environment.isExternalStorageManager()) { Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); intent.setData(Uri.parse("package:" + getPackageName())); startActivityForResult(intent, 0); finish(); } }

Justin-roy commented 1 year ago

no not working in both can you please add this sdk in your plugin for android 11 support. please

amorenew commented 1 year ago

@Justin-roy Cleaning up this SDK and making a helper class could take me 5 hours, as I have to dig in the code and remove UI from the logic to build the helper class

Justin-roy commented 1 year ago

i will help in ui part please integrate sdk :D

amorenew commented 1 year ago

push the project to GitHub and add me to my account then make a helper class so no UI button call a logic directly but the helper class functions and make sure it works for events you need to make a listener and add it to the helper class like what I have in my helper class let me know once you made the helper class

Justin-roy commented 1 year ago

ok

Justin-roy commented 1 year ago

@amorenew invited

ekaeriana commented 1 year ago

Hai, Mr. @Justin-roy have you fix this issue?

developerflutter commented 1 year ago

Do you have any update on the working solution? @Justin-roy @amorenew

amorenew commented 1 year ago

@developerflutter It requires a new plugin as China Highway made changes to support Android 11 It would take more than 5 hours to make it however that I will not use it as I left the company which I made this plugin for, since 3 years ago

developerflutter commented 1 year ago

So we don't have any option? Any other work around for this?

amorenew commented 1 year ago

No workaround only making a new plugin from the native SDK

HamidMusayev commented 1 year ago

The problem is that android 11 version of this devices have differend libs. After weeks effort I fixed the issue by contact device manufacturers and they sent me lib files which have same implementation as this package and all you need to do some lib file replacing. If you have questions I can help.

I created docs for for full implementation of android 11. If urls won't work reply

https://docs.google.com/document/d/1nf5T2_Et1J27ngdF8ntpgxS9q2C1P1rQ/edit?usp=sharing&ouid=104635957823981061801&rtpof=true&sd=true

Example app (you can find libs and updated plugin here) Note: don't forget to check your project android/libs folder and gradle like picture https://github.com/HamidMusayev/agromis_app

image

amorenew commented 1 year ago

@HamidMusayev Could you make a PR with this fix?

HamidMusayev commented 1 year ago

@HamidMusayev Could you make a PR with this fix?

I'm sorry. I don't have this devices anymore

okkidoggi commented 1 year ago

The problem is that android 11 version of this devices have differend libs. After weeks effort I fixed the issue by contact device manufacturers and they sent me lib files which have same implementation as this package and all you need to do some lib file replacing. If you have questions I can help.

I created docs for for full implementation of android 11. If urls won't work reply

https://docs.google.com/document/d/1nf5T2_Et1J27ngdF8ntpgxS9q2C1P1rQ/edit?usp=sharing&ouid=104635957823981061801&rtpof=true&sd=true

Example app (removed codebase) https://drive.google.com/file/d/1mWnvkcT4IV9bqtzXYZ_dJbenCqLd3yXV/view?usp=sharing

image

Can i have the latest .aar file and also the link to download the plugin? The links are not valid anymore.

HamidMusayev commented 1 year ago

@okkidoggi I uploaded my app and updated link.

okkidoggi commented 1 year ago

@HamidMusayev Thank you so much! but I still couldn't make it work, probably because I am using Chainway C66 instead of C72. I thought they are using same AAR.

HamidMusayev commented 1 year ago

@HamidMusayev Thank you so much! but I still couldn't make it work, probably because I am using Chainway C66 instead of C72. I thought they are using same AAR.

You have to contant to device seller, they will send you device specific aar files

Justin-roy commented 1 year ago

The problem is that android 11 version of this devices have differend libs. After weeks effort I fixed the issue by contact device manufacturers and they sent me lib files which have same implementation as this package and all you need to do some lib file replacing. If you have questions I can help.

I created docs for for full implementation of android 11. If urls won't work reply

https://docs.google.com/document/d/1nf5T2_Et1J27ngdF8ntpgxS9q2C1P1rQ/edit?usp=sharing&ouid=104635957823981061801&rtpof=true&sd=true

Example app (you can find libs and updated plugin here) Note: don't forget to check your project android/libs folder and gradle like picture https://github.com/HamidMusayev/agromis_app

image

Yes Just download latest sdk and replace older one. and follow this steps. then ready to use in android 11 :D

Justin-roy commented 1 year ago

Hey everyone I added android 11 support in Rfid C72 https://github.com/Justin-roy/Rfid_c72_plugin