1

I try to get android Device name.

Now I am using package device_info_plus v4.1.2, but it can't get this info.

enter image description here

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;

Output

print('Running on Product ${androidInfo.product}'); --show sdk_gphone_x86_arm
print('Running on Board ${androidInfo.board}'); --show oldfish_x86
print('Running on Device ${androidInfo.device}'); --show generic_x86_arm
print('Running on Model ${androidInfo.model}'); --show AOSP on IA Emulator

Could you guys recommend the other one that can get that info?

RuchDi
  • 250
  • 3
  • 14
  • I also try to use [device_info](https://pub.dev/packages/device_info) cannot get the device name too. – RuchDi Sep 20 '22 at 07:25
  • I also try to use [device_information](https://pub.dev/packages/device_information/install) v0.0.4 cannot get the device name too. – RuchDi Sep 21 '22 at 02:32

1 Answers1

-1

In device_info_plus package after getting the android info, read the values board and product.

Like this:

import 'package:device_info_plus/device_info_plus.dart';

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
print('Running on ${androidInfo.product}');
print('Running on ${androidInfo.board}');
Just a Person
  • 1,276
  • 1
  • 5
  • 23
  • I've update this package to v4.1.2, From you code it show "Running on sdk_gphone_x86_arm", "Running on goldfish_x86" – RuchDi Sep 20 '22 at 02:05
  • Could you try this on a physical device? – Just a Person Sep 20 '22 at 04:41
  • I am running the app on a Samsung note 10 lite. `- androidInfo.product show r7nsxx, - androidInfo.board show exynos9810, - androidInfo.device show r7` – RuchDi Sep 20 '22 at 05:05
  • Do you have any suggestion? – RuchDi Sep 20 '22 at 08:17
  • I don't think any third party libraries currently provide it. So, to get that you have to write native code. Please clarify if that's what you want? I shall post the native code if required. – Just a Person Sep 21 '22 at 05:13
  • Thanks for the answer, but my app was finished. I don't want to develop the new one with native code. I will be waiting for some package that can get the device name info (I wish ^^). – RuchDi Sep 22 '22 at 05:55