Get Android Phone Model programmatically , How to get Device name and model programmatically in android?

I use the following code to get the full device name. It gets model and manufacturer strings and concatenates them unless model string already contains manufacturer name (on some phones it does): public String getDeviceName() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.toLowerCase().startsWith(manufacturer.toLowerCase())) { return capitalize(model); } else { return capitalize(manufacturer) + … Read more

Android Studio doesn’t see device [closed]

I recently had trouble with this, and regardless of what I did(restart adb, edit adb_usb.ini, restart computer+device+swap usb port, reinstall studio etc. etc.) I just couldnt get it to work, and could not even detect my device using ‘adb devices’. Finally after about 2 hours of googling and testing, someone suggested switching to PTP instead … Read more

How to determine the current iPhone/device model?

I made this “pure Swift” extension on UIDevice. If you are looking for a more elegant solution you can use my ยต-framework DeviceKit published on GitHub (also available via CocoaPods, Carthage and Swift Package Manager). Here’s the code: import UIKit public extension UIDevice { static let modelName: String = { var systemInfo = utsname() uname(&systemInfo) … Read more