7 ms·
This is related to http://developer.android.com/guide/developing/tools/monkey.html http://developer.android.com/guide/developing/tools/monkey.h..., where you ca
by jnhnum1 15y ago
This 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
- willvarfar 15y agoAll this is discoverable in static code analysis. It is entirely possible to make tools that check the docs cover all these cases. There are probably tools they can buy to do it. Google should check it all, every release.
- inoop 15y agoThat's actually a great idea. Can you recommend one such tool? I'd like to run it on the Android framework source and see what else I've been missing.
- copper 15y agoCoverity's Prevent[1]? I use it for C++, and while it's not free, the pricing is /very/ reasonable. [1] http://www.coverity.com/html/prevent-for-java.html http://www.coverity.com/html/prevent-for-java.html