How to get device model in AndroidManifest and make condition?

Viewed 120

I use Sentry, and last 3 months receive ANR (Application Not Responding) with two devices (Xiaomi Mi A2 Lite, Samsung SM-A605FN). I think the problem with time waiting for respond(problem maybe occurred with hardware or slow internet ), and want to make one condition for those two devices for extend timeout time.

<application>
    <meta-data android:name="io.sentry.anr.timeout-interval-mills" android:value="15000" />
</application>

I want to set this timeout only for two devices.

enter image description here

Thanks

2 Answers

In the Android there is a class called Build, which provide all device information

for more information - check Build Class| Developer.Android

Example - Log.d("Vivek ", "Device -> " + Build.MANUFACTURER + " Brand ->" + Build.BRAND + " Display -> " + Build.DISPLAY); Log.d("Vivek ", " FINGERPRINT -> " + Build.FINGERPRINT + " Model ->" + Build.MODEL + " Bootloader -> " + Build.BOOTLOADER);

Related