0

Can I publish my app in market with code like this

try
      {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().detectNetwork().build();
        StrictMode.setThreadPolicy( policy );

        HttpClient httpclient = new DefaultHttpClient();
....        
  }
catch( Throwable ignore )
      {
      .....
      }

I read that strict mode just for debug regime and when I publish app I have to delete it.

Terry
  • 63
  • 3
  • 10
  • Yes, but also read [Why is it not advisable](http://stackoverflow.com/questions/18297485/android-os-networkonmainthreadexception-sending-an-email-from-android/18297516#18297516) – Pararth Jun 16 '14 at 09:55

1 Answers1

3

Yes you can, but it's not recommended since StrictMode.ThreadPolicy is designed to help you find threading issue at the time of development, and there's no sense to have it in production. Furthermore, if you're using penaltyDeath(), you don't want the app to crash while in production.

Egor
  • 39,695
  • 10
  • 113
  • 130