Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad 2 determine device color

I have tried looking around in the documentation and have been unsuccessful. I am wanting to know if there is a way to determine the iPad 2 color. The application I'm working on, I'd like to change the look of the design based on the color of the iPad.

Any ideas if this is possible?

like image 639
tappd Avatar asked Mar 30 '11 00:03

tappd


3 Answers

There is a way to detect an iPhone's color from its serial number. Perhaps this can be used to detect iPad 2 color as well?

The following is taken from http://itune2iphone.blogspot.com/2011/01/iphone-serial-number-secret-decode.html

Typically, the serial number of iPhone is in the following format:

AABCCDDDEEF
For example, 88025xxxA4T, where the serial information can be decoded as following:
AA = Factory and Machine ID
B = Year of Manufacturing (9 is 2009/2019, 0 is 2010/2020, 1 is 2011 and so on)
CC = Production Week (01 is week 1 of B, 11 is week 11 of B and so on)
DDD = Unique Identifier
EE = Color (A4=black)
F = size (S=16GB, T=32GB)

the last 3 digits of iPhone serial number are indicative of color and size and should be read together

VR0 (iPhone 2G Silver 4GB)
WH8 (iPhone 2G Silver 8GB)
0KH (iPhone 2G Silver 16GB)
Y7H (iPhone 3G Black 8GB)
Y7K (iPhone 3G Black 16GB)
3NP (iPhone 3GS Black 16GB)
3NR (iPhone 3GS Black 32GB)
3NQ (iPhone 3Gs White 16GB)
3NS (iPhone 3Gs White 32GB)
A4S (iPhone 4 Black 16GB)
A4T (iPhone 4 Black 32GB)

I know this is not a complete answer, but perhaps you can compare the serial number of a white iPad2 vs a black iPad2 of the same size and spec (for example, both 64G and and see how different the code is).

I'm going to start by listing the last three digits of my iPad2 serial number:

FJ3 - iPad2 64GB Black 3G

like image 64
adib Avatar answered Nov 07 '22 07:11

adib


There's a private API to retrieve both the DeviceColor and the DeviceEnclosureColor.

UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString([device.systemVersion hasPrefix:@"7"] ? @"_deviceInfoForKey:" :  @"deviceInfoForKey:");
NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);

I've blogged about this and written a sample app to illustrate this:

http://www.futuretap.com/blog/device-colors/

like image 30
Ortwin Gentz Avatar answered Nov 07 '22 05:11

Ortwin Gentz


Perhaps not the best way, but the way I'd choose if this was SUPER important (and I'd ask myself really if you think it is), would be to create a UIAlertView which prompts the user to select their colour of iPad from a finite list.

Enjoy!

like image 21
jer Avatar answered Nov 07 '22 05:11

jer