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

  • Home
  • SEARCH
  • 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 8160005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:06:32+00:00 2026-06-06T18:06:32+00:00

Google has an example on analytic data for mobile devices. The code is provided

  • 0

Google has an example on analytic data for mobile devices. The code is provided here. I added the jar file and everything compiles fine, but I get an error up running the app.
I took out the UA ID for security reasons (not sure if that matters or not)

LogCat provides me with this information:
E/AndroidRuntime(1175): java.lang.NoClassDefFoundError: com.google.android.apps.analytics.GoogleAnalyticsTracker
AND
E/AndroidRuntime(1130):at com.google.android.apps.analytics.sample.TestActivity.onCreate(TestActivity.java:19)

From what it says, it can’t find the googleAnalyticTracker? But if it compiles fine why can’t it find it?

package com.google.android.apps.analytics.sample;

import com.google.android.apps.analytics.GoogleAnalyticsTracker;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class TestActivity extends Activity {

    GoogleAnalyticsTracker tracker;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        tracker = GoogleAnalyticsTracker.getInstance();

        // Start the tracker in manual dispatch mode...
        // tracker.startNewSession("", this);

        // ...alternatively, the tracker can be started with a dispatch interval
        // (in seconds).
        tracker.startNewSession("", 20, this);

        setContentView(R.layout.main);
        Button createEventButton = (Button) findViewById(R.id.NewEventButton);
        createEventButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                tracker.trackEvent("Clicks", // Category
                        "Button", // Action
                        "clicked", // Label
                        77); // Value
            }
        });

        Button createPageButton = (Button) findViewById(R.id.NewPageButton);
        createPageButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                // Add a Custom Variable to this pageview, with name of "Medium"
                // and value "MobileApp"
                tracker.setCustomVar(1, "Medium", "Mobile App");
                // Track a page view. This is probably the best way to track
                // which parts of your application
                // are being used.
                // E.g.
                // tracker.trackPageView("/help"); to track someone looking at
                // the help screen.
                // tracker.trackPageView("/level2"); to track someone reaching
                // level 2 in a game.
                // tracker.trackPageView("/uploadScreen"); to track someone
                // using an upload screen.
                tracker.trackPageView("/testApplicationHomeScreen");
            }
        });

        Button quitButton = (Button) findViewById(R.id.QuitButton);
        quitButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        Button dispatchButton = (Button) findViewById(R.id.DispatchButton);
        dispatchButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                // Manually start a dispatch, not needed if the tracker was
                // started with a dispatch
                // interval.
                tracker.dispatch();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        // Stop the tracker when it is no longer needed.
        tracker.stopSession();
    }
}
  • 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-06T18:06:34+00:00Added an answer on June 6, 2026 at 6:06 pm

    I too had the same problem after I updated my android SDK. I resolved it by doing the following:

    Right Click on your project -> Build Path -> Configure Build Path -> Select Order and Export Tab -> Check the GoogleAnalyticsJar.jar -> Press OK.

    This helped me resolve the problem. Hope it helps you also.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a Google Maps example code , this : http://www.wolfpil.de/v3/drag-from-outside.html which has
In an example provided by Google ( http://code.google.com/p/analytics-api-samples/ ), it doesn't show how to
I was going through this sample package which Google has provided with it's sdk.
Has anybody tried this before? How can i amend the google analytics tracking code
I have a website on www.example.com and use Google Analytics. This website has lots
Google has a Python tutorial, and they describe boilerplate code as unfortunate and provide
I found this wonderful example of pulling data from a Google spreadsheet in JSON:
I'm trying to mimic the login page from the example http://tipfy-auth.appspot.com (source http://code.google.com/p/tipfy/source/browse/examples/auth/app/ )
Google has taken up the implementation of WebRTC in Chrome very seriously as indicated
Does Google has a service similar to Yahoo! Placemaker: Developers specify structured and unstructured

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.