Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceSample API crash #8

Open
rentzzz opened this issue Aug 27, 2019 · 5 comments
Open

DeviceSample API crash #8

rentzzz opened this issue Aug 27, 2019 · 5 comments

Comments

@rentzzz
Copy link

rentzzz commented Aug 27, 2019

Hi,
The DeviceSampleAPI in particular the Battery activity is crashing already within the onCreate.

--------- beginning of crash 2019-08-27 14:26:54.980 26184-26184/com.datalogic.examples.devicesampleapi E/AndroidRuntime: FATAL EXCEPTION: main Process: com.datalogic.examples.devicesampleapi, PID: 26184 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.datalogic.examples.devicesampleapi/com.datalogic.examples.devicesampleapi.BatteryActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.datalogic.device.battery.DLBatteryManager.getIntProperty(com.datalogic.device.battery.BatteryInfo)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2805) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6523) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.datalogic.device.battery.DLBatteryManager.getIntProperty(com.datalogic.device.battery.BatteryInfo)' on a null object reference at com.datalogic.examples.devicesampleapi.BatteryActivity.getBatteryInfo(BatteryActivity.java:70) at com.datalogic.examples.devicesampleapi.BatteryActivity.setText(BatteryActivity.java:43) at com.datalogic.examples.devicesampleapi.BatteryActivity.onCreate(BatteryActivity.java:37) at android.app.Activity.performCreate(Activity.java:7023) at android.app.Activity.performCreate(Activity.java:7014) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2758) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6523)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)  2019-08-27 14:26:54.986 987-1307/? W/ActivityManager: Force finishing activity com.datalogic.examples.devicesampleapi/.BatteryActivity 2019-08-27 14:26:54.990 987-1307/? W/ActivityManager: Force finishing activity com.datalogic.examples.devicesampleapi/.DeviceAPITest

It seems that there is an issue around this line:
DLBatteryManager deviceBattery = DLBatteryManager.getInstance();

Info:

  • Memor 10
  • IDE: AndroidStudio with Datalogic SDK v1 Revision 20

My general goal is to accomplish to get additional BatteryInfo like CAPACITY_FULL, PRODUCTION_YEAR, SERIAL_NUMBER and so on.
Thanks for any help.

KR

@mpennasilico
Copy link
Contributor

Hi Mattias,

thank you for your reporting. Take into account that the version of Memor10 installed on your device could not support the Datalogic SDK v1.20 released on August.
Please, could you share us the build number of sw version installed on your Memor10 Android 8 device? I will check which version of Datalogic SDK is support by your Memor10 device.

thank you,
MP

@rentzzz
Copy link
Author

rentzzz commented Sep 2, 2019

Hi,

Thanks for quick reply. I'm sorry I mixed something. I'm using v1.20 within my application, the Datalogic DeviceSample APi is using 1.17.

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.github.datalogic:datalogic-android-sdk:1.17'
}

Thanks upfront.

@mpennasilico
Copy link
Contributor

Thank you Mattias for the clarification.
May you share with us the build number of sw version installed on your Memor10 Android 8 device?
This is very important to allow us to check and address your issue.

Thanks,
MP

@rentzzz
Copy link
Author

rentzzz commented Sep 2, 2019

Hi,

build number: 0.02.07.20180810
Datalogic services: 1.1.10.6 r3

KR Mattias

@mpennasilico
Copy link
Contributor

Your device supports Datalogic SDK v1.08, as you can check from the Settings. But the features of com.datalogic.battery (reported by your error log) have been introduced by Datalogic SDK v1.13. So, you should update your device with a newer sw version, if you need to interface with new feature of Datalogic SDK.

MP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants