4 ms·
Android's Log.wtf Method
- eLobato 15y agoLol, funny fact is that I have been collaborating with dpkg team in Debian and they created an identical function in C to report ANY error condition. I've read a lot of //D'OH and //ROFLMAO comments in rhythmbox source code so I guess this is pretty common over open source devs within the Linux community!
- BoppreH 15y agoSee also: public static boolean isUserAMonkey() Returns "true" if the user interface is currently being messed with by a monkey. http://developer.android.com/reference/android/app/ActivityManager.html#isUserAMonkey() http://developer.android.com/reference/android/app/ActivityM...
- jnhnum1 15y agoThis is related to http://developer.android.com/guide/developing/tools/monkey.html http://developer.android.com/guide/developing/tools/monkey.h..., where you can actually test your user interface with a pseudo-monkey.
- CrazedGeek 15y agoAlso related to that: http://www.folklore.org/StoryView.py?story=Monkey_Lives.txt http://www.folklore.org/StoryView.py?story=Monkey_Lives.txt (how a similar tool was used on the original Macintosh)
- JulianMorrison 15y agoAnd this explains isUserAMonkey() Bill Atkinson came up with the idea of defining a system flag called "MonkeyLives" (pronounced with a short "i" but often mispronounced with a long one), that indicated when the Monkey was running. The flag allowed MacPaint and other applications to test for the presence of the Monkey and disable the quit command while it was running, as well as other areas they wanted the Monkey to avoid. This allowed the Monkey to run all night, or even longer, driving the application through every possible situation.
- gcb 15y agoAmazing how android docs fail to link to anything...
- inoop 15y agoAndroid docs are pretty terrible anyway. Have fun finding out what a 'Looper' is for or how it even works without using stack overflow. Then be amazed and horrified. And then there are gems like WiFiManager.getScanResults(), which according to the docs returns a List<ScanResult>. Except that it's actually implemented as try { return [do native call]; } catch (RemoteException ex) { return null; }. So actually it returns a list except sometimes it returns null, which I have seen happen and it caused my app to force-close. There's shit like this all over the place. No wonder so many apps crash on random devices. So now any time I want to call a piece of the Android API I haven't worked with before I have to go find the source to make sure it's not doing something unexpected because I can't trust these Google monkeys to properly document their stuff. Sigh.
- lsb 15y agoYeah, this is why I love Haskell's type system. You'd be able to implement that as a Maybe [WifiResult], maybe Just a list of wifiresults or maybe Nothing, copying directly, but you'd probably want to have your datatype be Either String [WifiResult], either you get on the Left an error string or on the Right the list of wifiresults.
- Deestan 15y agoAnd more importantly, if a function has [WifiResult] as the defined return type, you can be absolutely definitely sure that you get a list back. This is not something inherently unique to Haskell. Any strictly typed language could easily have chosen to not let null be a member of all classes. Or at the very least add some "non-nullable" qualifier to types.
- gcb 15y agomaybe I like this
- 15y ago
- jnhnum1 15y agoAnother gem: http://developer.android.com/reference/android/hardware/SensorManager.html#GRAVITY_DEATH_STAR_I http://developer.android.com/reference/android/hardware/Sens... gives a gravity constant, on the death star, in imperial units...
- daleharvey 15y agoI like the description What a Terrible Failure adb lolcat was another andoid easter egg that made me laugh
- wallflower 15y agoSee also :) android.glitz http://groups.google.com/group/android-developers/browse_thread/thread/3e7d0716e2d29605/f8fae650be9bcbc7 http://groups.google.com/group/android-developers/browse_thr...
- mahmud 15y agoinstead of cutesy shit like that, how about documenting stuff like customizing input methods. the SoftKeyboard sample doesn't have a single usage datum online. I, ahem, googled it. How do I enable a custom keyboard for just one text entry widget? oops, didnt mean to interrupt the cute fest with actual question. fucking morons.