UCKDeviceInfo
获取设备信息。
例如,应用程序名称和剩余电池电量。
将 classes
文件夹添加到您的项目中。
UCKDeviceDataManager *deviceDataManager = [[UCKDeviceDataManager alloc] init];
UCKDeviceData *deviceData = deviceDataManager.deviceData;
UCKApplicationData *applicationData = deviceData.applicationData;
UCKBatteryData *batteryData = deviceData.batteryData;
UCKNetworkData *networkData = deviceData.networkData;
UCKSystemData *systemData = deviceData.systemData;
NSMutableString *messageString = [NSMutableString stringWithCapacity:0];
[messageString appendFormat:@"Application name:%@\n", applicationData.applicationName];
[messageString appendFormat:@"Application version:%@\n", applicationData.applicationVersionName];
[messageString appendFormat:@"OS Version:%@\n", systemData.osVersion];
[messageString appendFormat:@"Platform:%@\n", systemData.platform];
[messageString appendFormat:@"Model:%@\n", systemData.model];
[messageString appendFormat:@"Brand:%@\n", systemData.brand];
[messageString appendFormat:@"Free memory:%ld(MB)\n", systemData.freeSpace];
[messageString appendFormat:@"Total memory:%ld(MB)\n", systemData.totalSpace];
[messageString appendFormat:@"Battery level:%d\n", batteryData.level];
[messageString appendFormat:@"Battery status:%@\n", batteryData.statusName];
[messageString appendFormat:@"Network type:%@\n", networkData.networkTypeName];
UIAlertView *alert = [[UIAlertView alloc] init];
alert.title = @"Device info";
alert.message = messageString;
[alert addButtonWithTitle:@"Close"];
[alert show];
UCKDeviceInfo © 2014 Keisuke Uchida (http://uchidak.net) 版权所有。
MIT 许可证。
此软件使用了以下开源软件:
Reachability © Apple Inc. 版权所有。
© 2013 Keisuke Uchida 版权所有。