Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9010437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:27:32+00:00 2026-06-16T02:27:32+00:00

I tried to use Google Analytics in my app. I created a account, registered

  • 0

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.

GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
tracker.setDebug(true);
tracker.startNewSession("UA code",10, this);

But I can’t import GoogleAnalyticsTracker. It says

“GoogleAnalyticsTracker cannot be resolved to a type”

Update1

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.

GoogleAnalyticsTracker tracker;
tracker = GoogleAnalyticsTracker.getInstance();    
        tracker.startNewSession("UA code", 20,this);
        tracker.trackPageView("/BS_Splash");

Update 2

I tired with V2. Used the following 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);

In log cat I got the following, connection to service failed 1

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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:27:33+00:00Added an answer on June 16, 2026 at 2:27 am

    Try downloading and installing the “legacy” (v1) GA library, or use the new V2 “Advanced” APIs.

    The code you’ve got is assuming the V1 APIs, so its probably easiest to install the V1 library instead. See:

    https://developers.google.com/analytics/devguides/collection/android/resources

    Alternatively, you can find an equivalent snippet (that doesn’t use EasyTracker) in the “Advanced” section of the V2 API documentation. See:

    https://developers.google.com/analytics/devguides/collection/android/v2/advanced

    Specifically, it looks like the global instance lookup now takes an Android Context argument, and its just GoogleAnalytics not GoogleAnalyticsTracker:

    Context mCtx = this; // Get current context.
    GoogleAnalytics myInstance = GoogleAnalytics.getInstance(mCtx.getApplicationContext());
    myInstance.setDebug(true);
    

    The tracker is now separate as the Tracker class:

    Tracker myNewTracker = myInstance.getTracker("UA-XXXX-2") // A new tracking ID.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried following the instructions here: How to use Google app engine with my own
Possible Duplicate: Google Analytics to track FireFox extension use I tried injecting a script
I have tried to use Google Maps API in my app. I have made
i have tryed to make my own app and to use google maps. I
Im tried to use NAudio demo app for MP3 Streaming in Csharp, when i
I began to use Google Map API recently and I tried the hello world
I'm creating an Android app and trying to use Google Places API through Google
Possible Duplicate: How to use Google Analytics with Phonegap without a plugin? I want
I cannot use Google analytics because of their limitations on the API. They will
I have a website on www.example.com and use Google Analytics. I've also set up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.