Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Check for <code>IS_DEBUG_MODE</code> flag in your application and add code in that.. </p> <p>Use <code>PackageManager</code> to get an <code>ApplicationInfo</code> object on your application, and check the flags field for <code>FLAG_DEBUGGABLE</code>.</p> <pre><code>boolean isDebuggable = (0 != (getApplicationInfo().flags &amp; ApplicationInfo.FLAG_DEBUGGABLE)); </code></pre> <p><strong>Update:</strong></p> <p>The following solution assumes that in manifest file you always set <code>android:debuggable=true</code> while developing and <code>android:debuggable=false</code> for application release.</p> <p>Now you can check this attribute's value from your code by checking the <code>ApplicationInfo.FLAG_DEBUGGABLE</code> flag in the <code>ApplicationInfo</code> obtained from <code>PackageManager</code>.</p> <p>The following code snippet could help:</p> <pre><code>PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); int flags = packageInfo.applicationInfo.flags; if ((flags &amp; ApplicationInfo.FLAG_DEBUGGABLE) != 0) { // development mode } else { // release mode } </code></pre> <p>So in your manifest file:</p> <p>For debug time,</p> <pre><code>&lt;application android:name=".MyActivity" android:icon="@drawable/myicon" android:label="@string/app_name" android:debuggable="true"&gt; </code></pre> <p>For release time,</p> <pre><code>&lt;application android:name=".MyActivity" android:icon="@drawable/myicon" android:label="@string/app_name" android:debuggable="false"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload