title: Application class for static variables and MultiDex applications
body: <p>This guide here tell you how to create an Application class:</p>
  
  <p><a href="http://www.intridea.com/blog/2011/5/24/how-to-use-application-object-of-android" rel="nofollow">http://www.intridea.com/blog/2011/5/24/how-to-use-application-object-of-android</a></p>
  
  <p>It mentions that you need to define the name of your Application class in your manifest:</p>
  
  <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:name="MyApplication"&gt;
  </code></pre>
  
  <p>I think Application class are useful to hold static variables / objects like for example, GoogleApiClient so that you do not have to reconnect with Google each time your activity ends, instead if you put it in your application class, you will only need to connect once when your app starts up and disconnect when it closes.</p>
  
  <p>I have a multidex app: <a href="https://developer.android.com/tools/building/multidex.html" rel="nofollow">https://developer.android.com/tools/building/multidex.html</a></p>
  
  <p>Multidex apps requires me to also give a constant name of <code>"android.support.multidex.MultiDexApplication"</code> to the application in the manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.android.multidex.myapplication"&gt;
      &lt;application
          ...
          android:name="android.support.multidex.MultiDexApplication"&gt;
          ...
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>If I have to give <code>android:name="android.support.multidex.MultiDexApplication"</code> as the application name, I cannot also give <code>android:name="MyApplication"</code>. As far as I know, an application cannot have two names.</p>
  
  <p>Is it possible to have both multidex and a custom application class in an app?</p>