0

I'm currently trying to log a single instance of data, just seeing if a user is in Florida. However, Flurry isn't getting the data on the server side. I'm very new to Flurry and this is my first time working with analytics and sending data to another server. Can someone help me find the source of my issue?

To be noted: When I call FlurryAgent.onStartSession(this,"myid") -> My id is in my code I just didnt want to make it public here. Also, the application is on the store currently, and it has the Android Market ID set in Flurry to the package name of the application. The manifest includes INTERNET and NETWORK STATE permissions for Flurry

Here is LogCat for all Flurry Related Data Across the lifetime of the Activity I'm working on:

10-18 13:49:04.997: V/FLURRY(10471): Loggin Version name and sending to Flurry
10-18 13:49:05.017: V/FLURRY(10471): Flurry is starting
10-18 13:49:05.017: I/FlurryAgent(10471): initSettings, CrashReportingEnabled = true
10-18 13:49:05.017: I/FlurryAgent(10471): initSettings, VersionName = 1.10.17.13
10-18 13:49:05.027: I/FlurryAgent(10471): initSettings, LocationCriteria = null
10-18 13:49:05.027: I/FlurryAgent(10471): initSettings, ReportLocation = true
10-18 13:49:05.037: I/FlurryAgent(10471): initSettings, UseHttps = false
10-18 13:49:05.037: I/FlurryAgent(10471): initSettings, ReportUrl = null
10-18 13:49:05.047: I/FlurryAgent(10471): Location provider subscribed
10-18 13:49:05.047: I/FlurryAgent(10471): Initializing new Flurry session
10-18 13:49:05.077: W/FlurryAgent(10471): Agent cache file doesn't exist.
10-18 13:49:05.077: I/FlurryAgent(10471): initSettings, Gender = -1
10-18 13:49:05.077: I/FlurryAgent(10471): No more reports to send.
10-18 13:49:05.077: I/FlurryAgent(10471): initSettings, UserId = 
10-18 13:49:05.077: I/FlurryAgent(10471): initSettings, LogEvents = true
10-18 13:49:05.077: I/FlurryAgent(10471): initSettings, BirthDate = 0
10-18 13:49:05.077: I/FlurryAgent(10471): initSettings, ContinueSessionMillis = 10000
10-18 13:49:05.077: W/FlurryAgent(10471): Start session
10-18 13:49:05.087: I/FlurryAgent(10471): Agent cache file doesn't exist.
10-18 13:49:05.087: D/FlurryAgent(10471): Referrer file Name if it exists:  /data/data/edu.fsu.cs.mobile.quitandbefree/files/.flurryinstallreceiver.
10-18 13:49:05.087: D/FlurryAgent(10471): generating agent report
10-18 13:49:05.087: I/FlurryAgent(10471): getAgentVersion() = 151
10-18 13:49:05.087: D/FlurryAgent(10471): refMapSize is:  0
10-18 13:49:05.087: D/FlurryAgent(10471): Referrer file Name if it exists:  /data/data/edu.fsu.cs.mobile.quitandbefree/files/.flurryinstallreceiver.
10-18 13:49:05.087: D/FlurryAgent(10471): after loading referrer file:  
10-18 13:49:05.087: D/FlurryAgent(10471): optionsMapSize is:  0
10-18 13:49:05.087: D/FlurryAgent(10471): generated report of size 257 with 0 reports.
10-18 13:49:05.097: I/FlurryAgent(10471): getAgentVersion() = 151
10-18 13:49:05.097: I/FlurryAgent(10471): Writing FlurryDataSenderBlockInfo: /data/data/edu.fsu.cs.mobile.quitandbefree/files/.flurrydatasenderblock.bcf8836e-b98d-437c-8804-9b33391f4cf7
10-18 13:49:05.097: I/FlurryAgent(10471): addBlockInfo
10-18 13:49:05.097: I/FlurryAgent(10471): New Data Key
10-18 13:49:05.097: I/FlurryAgent(10471): write iter 0 dataLength = 36
10-18 13:49:05.097: I/FlurryAgent(10471): write iter 0 dataLength = 29
10-18 13:49:05.147: E/FlurryAgent(10471): java.lang.NullPointerException
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.iw.a(SourceFile:24)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.v(SourceFile:630)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.c(SourceFile:614)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.a(SourceFile:311)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.b(SourceFile:57)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fc.a(SourceFile:272)
10-18 13:49:05.147: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.jf.run(SourceFile:49)
10-18 13:49:05.147: E/FlurryAgent(10471):   at android.os.Handler.handleCallback(Handler.java:587)
10-18 13:49:05.147: E/FlurryAgent(10471):   at android.os.Handler.dispatchMessage(Handler.java:92)
10-18 13:49:05.147: E/FlurryAgent(10471):   at android.os.Looper.loop(Looper.java:150)
10-18 13:49:05.147: E/FlurryAgent(10471):   at android.os.HandlerThread.run(HandlerThread.java:60)
10-18 13:49:05.147: I/FlurryAgent(10471): Number of not sent blocks = 1
10-18 13:49:05.147: I/FlurryAgent(10471): Reading FlurryDataSenderBlockInfo: /data/data/edu.fsu.cs.mobile.quitandbefree/files/.flurrydatasenderblock.bcf8836e-b98d-437c-8804-9b33391f4cf7
10-18 13:49:05.147: I/FlurryAgent(10471): FlurryDataSender: start upload data with id = bcf8836e-b98d-437c-8804-9b33391f4cf7 to http://data.flurry.com/aap.do
10-18 13:49:05.177: I/FlurryAgent(10471): Location provider subscribed
10-18 13:49:05.187: V/FLURRY(10471): Flurry log is set
10-18 13:49:05.187: V/FLURRY(10471): Checking Florida in ONSTART
10-18 13:49:05.197: W/FlurryAgent(10471): --onServerError bcf8836e-b98d-437c-8804-9b33391f4cf7
10-18 13:51:21.420: V/FLURRY(10471): Checking Florida in ONSTOP
10-18 13:51:21.430: D/FlurryAgent(10471): Event count incremented: Florida
10-18 13:51:21.430: V/FLURRY(10471): WE'RE IN FLORIDA
10-18 13:51:21.430: I/FlurryAgent(10471): Location provider unsubscribed
10-18 13:51:21.440: D/FlurryAgent(10471): Attempting to persist AdLogs
10-18 13:51:21.440: D/FlurryAgent(10471): Attempting to persist FreqCap
10-18 13:51:21.440: W/FlurryAgent(10471): Trying to end session
10-18 13:51:31.440: W/FlurryAgent(10471): Ending session
10-18 13:51:31.450: W/FlurryAgent(10471): LocationProvider is going to be unsubscribed
10-18 13:51:31.450: I/FlurryAgent(10471): Location provider unsubscribed
10-18 13:51:31.450: I/FlurryAgent(10471): LocationProvider stoped
10-18 13:51:31.450: I/FlurryAgent(10471): provider = null
10-18 13:51:31.450: I/FlurryAgent(10471): getLocation() = null
10-18 13:51:31.470: E/FlurryAgent(10471): java.lang.NullPointerException
10-18 13:51:31.470: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.iw.a(SourceFile:24)
10-18 13:51:31.470: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.v(SourceFile:630)
10-18 13:51:31.470: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fb.d(SourceFile:57)
10-18 13:51:31.470: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.fe.a(SourceFile:389)
10-18 13:51:31.470: E/FlurryAgent(10471):   at com.flurry.android.monolithic.sdk.impl.jf.run(SourceFile:49)
10-18 13:51:31.470: E/FlurryAgent(10471):   at android.os.Handler.handleCallback(Handler.java:587)
10-18 13:51:31.470: E/FlurryAgent(10471):   at android.os.Handler.dispatchMessage(Handler.java:92)
10-18 13:51:31.470: E/FlurryAgent(10471):   at android.os.Looper.loop(Looper.java:150)
10-18 13:51:31.470: E/FlurryAgent(10471):   at android.os.HandlerThread.run(HandlerThread.java:60)

Here is the source code for that activity:

package com.myapp.Location

import com.flurry.android.FlurryAgent;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.util.Log;    

public class Settings_Settings extends PreferenceActivity {

        //CONSTANTS
        final static long MILLIS_IN_DAY = 86400000;
        final static long MILLIS_IN_HOUR = 3600000;
        final static long MILLIS_IN_MINUTE = 60000;
        //Variables
        long loadedTime;
        int packs;
        float cost;
        long day=0, hour=0, minute=0;


    @SuppressWarnings("deprecation")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTheme(R.style.SettingsTheme);//CHange theme
        setTitle("Settings");
        addPreferencesFromResource(R.layout.activity_settings__settings);
        setRequestedOrientation(1);//Vertical Screen Orientation
        Log.v("FLURRY","Logging Version name and sending to Flurry");
        FlurryAgent.setVersionName("1.10.17.13");

    }

    @Override
    protected void onStart()
    {
        super.onStart();
        Log.v("FLURRY", "Flurry is starting");
        FlurryAgent.onStartSession(this, "MYID");
        FlurryAgent.setLogEnabled(true);
        FlurryAgent.setLogEvents(true);
        FlurryAgent.setLogLevel(Log.VERBOSE);

        Log.v("FLURRY", "Flurry log is set");
        Log.v("FLURRY","Checking Florida in ONSTART");
        checkFlorida();


    }

    @Override
    protected void onStop()
    {
        super.onStop(); 
        Log.v("FLURRY","Checking Florida in ONSTOP");
        checkFlorida();

        FlurryAgent.onEndSession(this);
    }

    public void checkFlorida(){
        //Load Settings Data
                SharedPreferences mySettingsPrefs = PreferenceManager.getDefaultSharedPreferences(this);
                boolean florida = mySettingsPrefs.getBoolean("preferences_florida", false);

                if(florida == true){
                    FlurryAgent.logEvent("Florida");
                    Log.v("FLURRY", "WE'RE IN FLORIDA");
                }

    }
}
Tabrock
  • 1,120
  • 1
  • 20
  • 37
  • you are getting NPE in your code and even this message _ Number of not sent blocks = 1_ can you fix it then try again? just used flurry few days back and even i didnt get its reports instantly sometimes i have to wait an hour or sometimes more than that for the logging events. and even your logs will be sent only after you exit or end that activity because the flurry session ends in onStop() – Maulik Sheth Oct 17 '13 at 18:49
  • call FlurryAgent.onEndSession(this); before checkFlorida() – Maulik Sheth Oct 17 '13 at 18:51
  • Maulik, I've been using Flurry for a few weeks now with no data. Could you describe to me where I should go to fix this? As I'm unsure of even what is causing the NPE. If you don't mind, why should I end the session and then try to log data? I'll give it a try though. – Tabrock Oct 17 '13 at 18:58
  • well. to be honest i dont have an answer as why in onstop onsession to be called first then your method. i saw in various answers regarding flurry that people mentioned to use it that way i mean endsession first and then your code. try it out! – Maulik Sheth Oct 17 '13 at 19:16
  • I have, and the logcat output following it is different, I only see warnings for the onServerError, and I dont see any Errors for NPE's when it runs. So, hopefully we'll get some analytics here. I'll check back every few hours until tomorrow and see what happens. Although, its not even showing session Data either on the site, which would imagine is a key indicator something else may be amiss – Tabrock Oct 17 '13 at 19:40
  • check and reply back! – Maulik Sheth Oct 17 '13 at 20:06
  • Yep, it's definitley not working. Onto Google easy tracker! Thanks for your help though, @MaulikSheth – Tabrock Oct 18 '13 at 13:36

0 Answers0