Kudos to the Android team for this. My experience is that this sort of checking avoids a lot of problems and really makes a difference in application quality.
I haven't tried it yet, but I do expect my code to ALMOST pass -- but are things like preferences and database access considered disk accesses, in this environment with flash memory instead of "disks"? It would be helpful if the documentation were clear about which system APIs with implicit file IO would be affected by the policy -- and perhaps some tuning in this regard. Perhaps rather than "any file IO", give the ability to control how much, either in data size or IO time? To make it even more useful, can I suggest some overrides: * On the device, per application, so developers and concerned users can investigate already-installed applications. * In the AVDs, per AVD, so developers can choose to always test in this mode. * In the launch configurations -- where perhaps the default should be to be the strictest, complete with crash. * In the manifest -- where the manifest editor will help people discover the option And perhaps: * In the market, which would give you a hard time about it is your application does not have a "safe and sane" setting in the manifest? "Safe and sane" is currently documented to be "off", but I think would better be some combination of detecting network, ignoring disk, and not crashing the app. I bet we'd see a lot better applications as a result. In the meantime, when people ask in this group about ANRs, or post code that has relevant problems, we should direct them to turn on StrictMode. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

