public GXSerial(Context context) {
if (context == null) {
throw new IllegalArgumentException("context");
}
mContext = context;
GXUsbReceiver mUsbReceiver = new GXUsbReceiver(this);
String name = "gurux.serial";
IntentFilter filter2 = new IntentFilter(name);
filter2.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
filter2.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
mContext.registerReceiver(mUsbReceiver, filter2, Context.RECEIVER_NOT_EXPORTED);
mSyncBase = new GXSynchronousMediaBase(200);
setConfigurableSettings(AvailableMediaSettings.ALL.getValue());
}
this supports only android 8 and above
it is not supporting for android 7 devices i am getting
FATAL EXCEPTION: main
Process: com.iiits.TrmSbd.sit, PID: 6896
java.lang.NoSuchMethodError: No virtual method registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;I)Landroid/content/Intent; in class Landroid/content/Context; or its super classes (declaration of 'android.content.Context' appears in /system/framework/framework.jar)
at gurux.serial.GXSerial.<init>(GXSerial.java:216)
i am having the option of
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(mUsbReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
context.registerReceiver(mUsbReceiver, filter);
}
this but
GXSerial is read only class i want this to support from android 7
Hi, Google ended support for…
Hi,
Google ended support for Android 7 in August 2019. If you want to support Android 7 devices, you can modify the source code to meet your needs.
It's recommended that you update the version seven to newer versions.
BR,
Mikko
to modify in the code…
to modify in the code GXserial is read only class
which is where i am getting exception
i have shared you
mContext.registerReceiver(mUsbReceiver, filter2, Context.RECEIVER_NOT_EXPORTED);
which lies inside GXserial
getting this
FATAL EXCEPTION: main
Process: com.iiits.TrmSbd.sit, PID: 6896
java.lang.NoSuchMethodError: No virtual method registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;I)Landroid/content/Intent; in class Landroid/content/Context; or its super classes (declaration of 'android.content.Context' appears in /system/framework/framework.jar)
exception
Hi, This Tiramisu check is…
Hi,
This Tiramisu check is already in version 2.0.12. What version are you using?
BR,
Mikko
2.0.15 here i am getting the…
2.0.15
here i am getting the issue which is not supporting for android 7
i have to make
context.registerReceiver(mUsbReceiver, filter);
this changes for supporting android 7
which i could not able to do
please provide the solution for android 7
Hi, Google is no longer…
Hi,
Google is no longer supporting Android 7, and we no longer have any Android 7 devices left.
BR,
Mikko