~cmiller/ubuntuone-android-music/goog-analytics

« back to all changes in this revision

Viewing changes to src/net/sourceforge/subsonic/androidapp/activity/VoiceQueryReceiverActivity.java

  • Committer: Chad Miller
  • Date: 2011-07-29 21:06:49 UTC
  • Revision ID: chad.miller@canonical.com-20110729210649-n0kvp4tt92tckj7k
Start adding analytics to Music app.  I don't know how some of these traits will graph, so I'll revisit these later.

Remove the build rule from build.xml because it is unnecessary and it breaks libs/ usage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import net.sourceforge.subsonic.androidapp.util.Util;
29
29
import net.sourceforge.subsonic.u1m.androidapp.provider.SearchSuggestionProvider;
30
30
 
 
31
import net.sourceforge.subsonic.u1m.androidapp.Analytics;
 
32
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
 
33
 
31
34
/**
32
35
 * Receives voice search queries and forwards to the SearchActivity.
33
36
 *
36
39
 * @author Sindre Mehus
37
40
 */
38
41
public class VoiceQueryReceiverActivity extends Activity {
 
42
    private static final String TAG = VoiceQueryReceiverActivity.class.getSimpleName();
 
43
    private GoogleAnalyticsTracker tracker;
39
44
 
40
45
    @Override
41
46
    public void onCreate(Bundle savedInstanceState) {
42
47
        super.onCreate(savedInstanceState);
43
48
 
 
49
        this.tracker = GoogleAnalyticsTracker.getInstance();
 
50
        this.tracker.trackPageView(TAG);
 
51
 
44
52
        String query = getIntent().getStringExtra(SearchManager.QUERY);
45
53
 
46
54
        if (query != null) {
 
55
            this.tracker.trackPageView(TAG);
 
56
 
47
57
            SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this, SearchSuggestionProvider.AUTHORITY,
48
58
                                                                              SearchSuggestionProvider.MODE);
49
59
            suggestions.saveRecentQuery(query, null);
50
60
 
 
61
 
51
62
            Intent intent = new Intent(VoiceQueryReceiverActivity.this, SearchActivity.class);
52
63
            intent.putExtra(Constants.INTENT_EXTRA_NAME_QUERY, query);
53
64
            intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true);