Morcl174
Morcl174

Reputation: 93

How can i read device model (name / id ?) of ubuntu touch device?

For an app i need the device model name like "SAMSUNG-SM-G930A". Under android i get this information from Build.MODEL and there is also a library named AndroidDeviceNames (https://github.com/jaredrummler/AndroidDeviceNames), which does exactly what i need under ubuntu touch.

what is the best way to get this information/s (model name / device name) in C++ / Qt5 / Ubuntu SDK IDE. If there is a way getting this names from QML it's also okay.

Upvotes: 0

Views: 237

Answers (1)

Muehlkreuz
Muehlkreuz

Reputation: 56

Have you tried the output of uname(2) under C++ e.g.

#include <sys/utsname.h>
struct utsname uts;
uname ( &uts );
std::cerr << uts.sysname << "\n";
... 

You also might take a look at

/etc/writable/machine-info

Its contents might be interesting for you.

Upvotes: 0

Related Questions