Thanks. We also use build type debug/release, it control logging, enable Google Analytics, etc. But for example crittercism we have enabled on booth debug and release build, but we want to have it of in IDE build, to do not flood statistic with dev crashes.
Dne pondělí, 22. září 2014 22:22:49 UTC+2 Xavier Ducrohet napsal(a): > > I agree with Mark, this is what build types are for. You can have > different BuildConfig constants depending on the build type you are > building. > > That said you can in fact detect if the build was done from the IDE. We > inject a property called android.injected.invoked.from.ide when building > from the IDE > > On Mon, Sep 22, 2014 at 1:00 PM, Mark Murphy <[email protected] > <javascript:>> wrote: > >> On Mon, Sep 22, 2014, at 15:43, Tomáš Procházka wrote: >> > I need it because I have special method App.isIDEBuild() in my app that >> > allow me to setup special debug stuff, like prefill login screen with >> > passwords, skip some screens to speed up development. But if app is >> > builded >> > from command line (on CI server), it must work as usual. So it is much >> > better to use App.isIDEBuild() than change code itself and forgot remove >> > something. >> >> I would differentiate based on build type, either using >> BuildConfig.DEBUG (if I didn't need the CI server to make debug builds) >> or a custom BuildConfig field. Basically, you anoint one build type as >> being the "IDE build", and use other build types on the CI server. >> >> -- >> Mark Murphy (a Commons Guy) >> http://commonsware.com | http://github.com/commonsguy >> http://commonsware.com/blog | http://twitter.com/commonsguy >> >> _The Busy Coder's Guide to Android Development_ Version 6.0: Android >> Studio-ified! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "adt-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Xavier Ducrohet > Android SDK Tech Lead > Google Inc. > http://developer.android.com | http://tools.android.com > > Please do not send me questions directly. Thanks! > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
