title: GoogleAnalyticsTracker cannot be resolved to a type in android
body: <p>I tried to use Google Analytics in my app. I created a account, registered for an app and got the reg number. Added the libGoogleAnalyticsV2.jar to my app build path. I tried to use the following code. </p>
  
  <pre><code>GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
  tracker.setDebug(true);
  tracker.startNewSession("UA code",10, this);
  </code></pre>
  
  <p>But I can't import GoogleAnalyticsTracker. It says </p>
  
  <blockquote>
    <p>"GoogleAnalyticsTracker cannot be resolved to a type"</p>
  </blockquote>
  
  <p><strong>Update1</strong></p>
  
  <p>I used version1 of Google analytics. And used the following code. From P.T's answer, I waited for more than 24 hours. Still I can't see the user in RealTime overview.
  I used the following code in my class file.</p>
  
  <pre><code>GoogleAnalyticsTracker tracker;
  tracker = GoogleAnalyticsTracker.getInstance();    
          tracker.startNewSession("UA code", 20,this);
          tracker.trackPageView("/BS_Splash");
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>I tired with V2. Used the following code.</p>
  
  <pre><code>Context mCtx = this; // Get current context.
          GoogleAnalytics myInstance = GoogleAnalytics.getInstance(mCtx.getApplicationContext());
          myInstance.setDebug(true);
          Tracker myNewTracker = myInstance.getTracker("UA code");
          myInstance.setDefaultTracker(myNewTracker);
  </code></pre>
  
  <p>In log cat I got the following, <strong>connection to service failed 1</strong></p>
  
  <pre><code>12-08 13:40:20.423: I/GAV2(22947): Thread[Service Reconnect,5,main]: connecting to Analytics service
  12-08 13:40:20.423: I/GAV2(22947): Thread[Service Reconnect,5,main]: connect: bindService returned false for Intent { act=com.google.android.gms.analytics.service.START (has extras) }
  12-08 13:40:20.423: W/GAV2(22947): Thread[Service Reconnect,5,main]: Connection to service failed 1
  12-08 13:40:20.423: I/GAV2(22947): Thread[Service Reconnect,5,main]: falling back to local store
  12-08 13:40:20.433: V/GAV2(22947): Thread[GAThread,5,main]: dispatch running...
  12-08 13:40:20.623: V/GAV2(22947): Thread[GAThread,5,main]: ...nothing to dispatch
  12-08 13:40:20.633: I/GAV2(22947): Thread[GAThread,5,main]: PowerSaveMode initiated.
  </code></pre>