List<String> () { List<String> res = new ArrayList<>(100); final Foundation.NSAutoreleasePool pool = new Foundation.NSAutoreleasePool(); try { final ID defaults = Foundation.invoke("NSUserDefaults", "standardUserDefaults"); final ID allKeysDict = Foundation.invoke(defaults, "dictionaryRepresentation"); final ID allKeysArr = Foundation.invoke(allKeysDict, "allKeys"); final ID count = Foundation.invoke(allKeysArr, "count"); for (int c = 0; c < count.intValue(); ++c) { final ID nsKeyName = Foundation.invoke(allKeysArr, "objectAtIndex:", c); final String keyName = Foundation.toStringViaUTF8(nsKeyName); // System.out.println(keyName); res.add(keyName); } return res; } finally { pool.drain(); } }