Commit 175e723f authored by Donald Jackson's avatar Donald Jackson

Added extraction of deviceName to Android

parent b23552e6
...@@ -48,7 +48,17 @@ public class RNDeviceModule extends ReactContextBaseJavaModule { ...@@ -48,7 +48,17 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
String deviceName = "Unknown";
try {
BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();
deviceName = myDevice.getName();
} catch(Exception e) {
e.printStackTrace();
}
constants.put("deviceName", deviceName);
constants.put("systemName", "Android"); constants.put("systemName", "Android");
constants.put("systemVersion", Build.VERSION.RELEASE); constants.put("systemVersion", Build.VERSION.RELEASE);
constants.put("model", Build.MODEL); constants.put("model", Build.MODEL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment