Sonntag, 22. Februar 2015

Java for OS X: Reading a Mac's (unique) Serialnumber

Each Mac has a unique Serialnumber, that you typically only use to check if you are still under warranty - but you could also use it to identify users (analytics) or to make time limited app trials more effective (as Adobe does it).

The Java code is pretty straightforward, basically it runs 'ioreg' and does some string ops:

BufferedReader in;
try {
 String[] command = { "/bin/sh", "-c",
   "ioreg -l | awk '/IOPlatformSerialNumber/ { print $4; }'" };
 Process p = Runtime.getRuntime().exec(command);

 in = new BufferedReader(new InputStreamReader(p.getInputStream()));
 String sn = in.readLine();
 in.close();
 p.destroyForcibly();
 sn = sn.substring(1, sn.length() - 1);// cut off quote. marks

 System.out.println(sn);
} catch (IOException e) {
 e.printStackTrace();
}

Samstag, 7. Februar 2015

Hey Apple, how about (finally) fixing iOS 8?

Seems like Apple had a really bad start in 2015 (and end of 2014) when it comes to software quality. At this point I should mention that others had problems, too (Android 5.0.0 even kills telephone functions on some devices), but it is still very strange that an once so good software (OS X Mavericks, iOS 7) turned into a disaster (Yosemite, iOS 8). A early market entry is important, but shouldn't final products be delivered instead of sever bugs?
While most people are talking about the Yosemite bugs (and most of them are still not addressed after over 10 iterations!!) not many focus on iOS.



Here is a list ordered by my devices - all bugs listed here are existing since the first iOS 8 dev versions:

iPhone 5S:

  • Phone app: Sometimes gets stuck when using headphones and kills the home button. You can't get out of the phone app then.
    Fix: Reboot phone, might be fixed in latest update
  • Phone app: While listening music, calling someone that is unreachable might place music on earpiece or lower sound quality to GSM-like quality
    Fix: Wait till call is ended.
  • Phone app: Pressing to many numbers in the phone dialler during a call will make the phone app get stuck
    Fix: Wait, wait, wait ...
  • Music App: Album & Song covers are randomly placed over objects that don't have a cover.
    No fix
  • Music App: randomly fast-forwards / rewinds.
    No fix
  • Music App: Putting the phone to landscape mode / album mode will show last selected album in landscape mode instead of current or last selected (in portrait eg.)
    No fix

iPad Mini (1st gen):

  • When deleting apps iPad gets unresponsive and you can't even turn of using the power button
    Fix: Hold down Power & Home button at the same time to turn off, then start again
  • iPad does sometimes not blur some areas (very rare), e.g. swipe down search or notification center
    Fix: Reboot
  • Siri: Sometimes refuses to geolocate, while other apps / services have no problem.
    Fix: Make a raindance. Seriously just wait and one day it will work
At time of writing I had 8.1.3 on my iDevices. It fixed already a lot of stuff (remember WiFi-gate?).
Now please Apple make my stuff enjoyable again ;-)