Reputation: 30715
When Device is connected to the computer the name is displayed as folder of Device (e.g. SAMSUNG_Android) How can I get that name?
Edited: I think we can't get that name. For some devices it is displayed, e.g. for Samsung Galaxy S3, but for others it is not.
Upvotes: 2
Views: 12334
Reputation: 446
IIRC the name which appears when you connect Android as a disk is the SD card volume label, at least on the devices with real (non-emulated) SD cards. It can be changed via dosfslabel when connected to Linux. There's no reliable way to read it. I think the best idea is to use Build.MODEL as default and allow user to change it manually in your application.
Upvotes: 0
Reputation: 8426
I think what your referring to is how to get the Build Properties of device
http://developer.android.com/reference/android/os/Build.html
Build.PRODUCT
is probably what you're looking for. Usually that is displayed on the computer when you connect it.
It gives full Product name
Upvotes: 0
Reputation: 2519
the below method will help you :
public String getDeviceName() {
String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL;
if (model.startsWith(manufacturer)) {
return model;
} else {
return manufacturer + " " + model;
}
}
Upvotes: 6