com.flurry.android.FlurryAgent Java Examples

The following examples show how to use com.flurry.android.FlurryAgent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GodotFlurry.java    From godot_modules with MIT License 6 votes vote down vote up
public void _log_event(String p_name, Dictionary p_params, boolean p_timed) {

		if (!active) return;
		
		if (p_params.size() == 0) {
			FlurryAgent.logEvent(p_name, null, p_timed);
			return;
		};

		Map<String, String> params = new HashMap<String, String>();
		String[] keys = p_params.get_keys();
		for (String key : keys) {
			params.put(key, p_params.get(key).toString());
		};
		FlurryAgent.logEvent(p_name, params, p_timed);
	}
 
Example #2
Source File: FlurryEventLogger.java    From aptoide-client-v8 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void log(String eventName, Map<String, Object> data, AnalyticsManager.Action action,
    String context) {
  if (data != null) {
    FlurryAgent.logEvent(eventName, map(data));
  } else {
    FlurryAgent.logEvent(eventName);
  }
  logger.logDebug(TAG, "log() called with: "
      + "eventName = ["
      + eventName
      + "], data = ["
      + data
      + "], action = ["
      + action
      + "], context = ["
      + context
      + "]");
}
 
Example #3
Source File: AppViewActivity.java    From aptoide-client with GNU General Public License v2.0 6 votes vote down vote up
private void setShareTimeLineButton() {
    final CheckBox btinstallshare = (CheckBox) getView().findViewById(R.id.btinstallshare);
    if (Preferences.getBoolean(Preferences.TIMELINE_ACEPTED_BOOL, false)) {
        btinstallshare.setVisibility(View.VISIBLE);
        btinstallshare.setChecked(Preferences.getBoolean(Preferences.SHARE_TIMELINE_DOWNLOAD_BOOL, true));
        btinstallshare.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                final Map<String, String> shareTimelineParams = new HashMap<String, String>();
                shareTimelineParams.put("Share_Timeline", String.valueOf(isChecked));
                FlurryAgent.logEvent("App_View_Clicked_On_Share_Timeline_Checkbox", shareTimelineParams);
                Preferences.putBooleanAndCommit(Preferences.SHARE_TIMELINE_DOWNLOAD_BOOL, isChecked);
            }
        });
    } else {
        btinstallshare.setVisibility(View.INVISIBLE);
    }
}
 
Example #4
Source File: AppViewActivity.java    From aptoide-client with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int i = item.getItemId();
    if (i == android.R.id.home) {
        getActivity().onBackPressed();
        return true;
    } else if (i == R.id.menu_share) {
        FlurryAgent.logEvent("App_View_Clicked_On_Share_Button");

        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.install) + " \"" + appName + "\"");
        sharingIntent.putExtra(Intent.EXTRA_TEXT, wUrl);

        if (wUrl != null) {
            startActivity(Intent.createChooser(sharingIntent, getString(R.string.share)));
        }
    } else if (i == R.id.menu_schedule) {
        new AptoideDatabase(Aptoide.getDb()).scheduledDownloadIfMd5(packageName, md5sum, versionName, storeName, appName, iconUrl);
    }

    return super.onOptionsItemSelected(item);
}
 
Example #5
Source File: ServicePlayer.java    From freemp with Apache License 2.0 6 votes vote down vote up
public void onPlayError(String e) {
    // Update Properties
    this.duration = 0.0;
    this.progress = 0.0;

    // Notify activity
    if (activity != null && tracks != null && tracks.size() > position) {
        activity.onFileLoaded(tracks.get(position), this.duration, "", "", 0, 0);
        activity.onProgressChanged(progress);
        activity.onUpdatePlayPause();
    }

    stopUpdateProgress();

    //skip 1st n errors on play
    if (errorCount < 3) {
        errorCount++;
        playNext();
    } else {
        FlurryAgent.onError("onPlayError", e, "");
        stop();
    }
}
 
Example #6
Source File: BassPlayer.java    From freemp with Apache License 2.0 6 votes vote down vote up
@Override
public void DOWNLOADPROC(ByteBuffer buffer, int length, Object user) {
    //&& (Integer)user == req
    if (filePath != null) {
        try {
            if (buffer != null) {
                if (fc == null)
                    fc = new FileOutputStream(new File(filePath)).getChannel();
                fc.write(buffer);
            } else if (fc != null) {
                fc.close();
                fc = null;
            }
        } catch (IOException e) {
            FlurryAgent.onError("5", "5", e);
        }
    }

}
 
Example #7
Source File: LetvBaseActivity.java    From letv with Apache License 2.0 6 votes vote down vote up
protected void onStart() {
    if (mHomeKeyEventReceiver != null && mHomeKeyEventReceiver.isHomeClicked()) {
        BaseApplication.setAppStartTime(System.currentTimeMillis());
    }
    super.onStart();
    if (hasApplyPermissions()) {
        LeMessageManager.getInstance().dispatchMessage(new LeMessage(LeMessageIds.MSG_FLOAT_BALL_REQUEST_DATA));
        FlurryAgent.onStartSession(this, LetvConfig.getFlurryKey());
        if (mHomeKeyEventReceiver != null && mHomeKeyEventReceiver.isHomeClicked()) {
            StatisticsUtils.sHasStatisticsLaunch = false;
            isLoginStatatistics = false;
            statisticsLaunch(0, true);
            LogInfo.LogStatistics("app start from home");
        }
    }
}
 
Example #8
Source File: FlurryTest.java    From foam with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Test
public void testLogEvent() {
    PowerMockito.mockStatic(FlurryAgent.class);

    Context mockContext = mock(Context.class);

    Flurry flurry = new Flurry(null);
    flurry.logEvent(mockContext, "test_event");

    //Switch to verify mode
    PowerMockito.verifyStatic();

    FlurryAgent.onStartSession(eq(mockContext));
    FlurryAgent.logEvent(eq("test_event"));
    FlurryAgent.onEndSession(eq(mockContext));
}
 
Example #9
Source File: Analytics.java    From ExtensionsPack with MIT License 6 votes vote down vote up
public static void start(Context ctx, String flurryKey, String localyticsKey)
{
  Log.d(tag, "Starting Localytics");
  if (localytics == null)
  {
    localytics = new LocalyticsSession(ctx, localyticsKey);
  }

  localytics.open();
  localytics.upload();

  Log.d(tag, "Starting Flurry");
  FlurryAgent.onStartSession(ctx, flurryKey);
  FlurryAgent.setLogEvents(true);

  Log.d(tag, "Analytics started");
}
 
Example #10
Source File: FlurryModule.java    From react-native-flurry-sdk with Apache License 2.0 6 votes vote down vote up
@ReactMethod
public void build(String apiKey) {
    FlurryAgent.addOrigin(ORIGIN_NAME, ORIGIN_VERSION);

    Context context = getCurrentActivity();
    if (context == null) {
        context = getReactApplicationContext();
    }
    mFlurryAgentBuilder
            .withListener(new FlurryAgentListener() {
                @Override
                public void onSessionStarted() {
                }
            })
            .withSessionForceStart(true)
            .build(context, apiKey);
}
 
Example #11
Source File: LetvBaseActivity.java    From letv with Apache License 2.0 5 votes vote down vote up
protected void onStop() {
    super.onStop();
    if (hasApplyPermissions()) {
        if (this.mRedPacketEntry != null) {
            this.mRedPacketEntry.stop();
        }
        FlurryAgent.onEndSession(this);
    }
}
 
Example #12
Source File: Analytics.java    From ExtensionsPack with MIT License 5 votes vote down vote up
public static void logEvent(String eventId, String params)
{
  Map<String, String> m = new HashMap<String, String>();
  m.put("params", params);

  FlurryAgent.logEvent(eventId, m);
  localytics.tagEvent(eventId, m);
}
 
Example #13
Source File: GodotFlurry.java    From godot_modules with MIT License 5 votes vote down vote up
public GodotFlurry(Activity p_activity) {
		registerClass("Flurry", new String[] {"log_event", "log_timed_event", "end_timed_event"});
		
		activity=p_activity;
		if (!active) return;

		activity.runOnUiThread(new Runnable() {
			public void run() {
				String key = GodotLib.getGlobal("flurry/api_key");
				FlurryAgent.init(activity, key);
//				FlurryAgent.onStartSession(activity, key); on android api >= 14 onStartSession / onEndSession are handled automatically
			}
		});
	}
 
Example #14
Source File: TutorialActivity.java    From aptoide-client with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void finish() {

    FlurryAgent.logEvent("Wizard_Added_Apps_As_Default_Store");
    Intent data = new Intent();
    data.putExtra("addDefaultRepo", true);
    setResult(RESULT_OK, data);
    Log.d("Tutorial-addDefaultRepo", "true");

    AptoideUtils.AppUtils.checkPermissions(this);
    Analytics.Tutorial.finishedTutorial(mViewPager.getCurrentItem()+1);
    super.finish();
}
 
Example #15
Source File: TutorialActivity.java    From aptoide-client with GNU General Public License v2.0 5 votes vote down vote up
@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int i = item.getItemId();
        if (i == R.id.menu_skip) {
            FlurryAgent.logEvent("Wizard_Skipped_Initial_Wizard");

//            if (currentFragment == lastFragment) {
//                getFragmentsActions();
//                runFragmentsActions();
//            }
            finish();
        }
        return super.onOptionsItemSelected(item);
    }
 
Example #16
Source File: Analytics.java    From ExtensionsPack with MIT License 5 votes vote down vote up
public static void stop(Context ctx)
{
  Log.d(tag, "Stopping Flurry");
  FlurryAgent.onEndSession(ctx);

  Log.d(tag, "Analytics stopped");
}
 
Example #17
Source File: TrackingApplication.java    From KinoCast with MIT License 5 votes vote down vote up
@Override
public void onCreate() {
    //TODO Select Parser depending on settings
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    Parser.selectParser(this, preferences.getInt("parser", KinoxParser.PARSER_ID));
    Log.i("selectParser", "ID is " + Parser.getInstance().getParserId());

    new FlurryAgent.Builder()
            .withLogEnabled(true)
            .build(this, getString(R.string.FLURRY_API_KEY));

    Fabric.with(this, new Crashlytics());

    super.onCreate();
}
 
Example #18
Source File: FlurryAnalyticsModule.java    From react-native-flurry-analytics with MIT License 5 votes vote down vote up
@ReactMethod
public void endTimedEvent(String eventName, ReadableMap parameters) {
  if (parameters == null) {
    FlurryAgent.endTimedEvent(eventName);
  } else {
    FlurryAgent.endTimedEvent(eventName, toMap(parameters));
  }
}
 
Example #19
Source File: AptoideApplicationAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
public void setPackageDimension(String packageName) {
  Bundle bundle = new Bundle();
  bundle.putString(APTOIDE_PACKAGE, packageName);
  AppEventsLogger.updateUserProperties(bundle, response -> Logger.getInstance()
      .d("Facebook Analytics: ", response.toString()));
  FlurryAgent.addSessionProperty(APTOIDE_PACKAGE, packageName);
}
 
Example #20
Source File: AptoideApplicationAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
public void setVersionCodeDimension(String versionCode) {
  Bundle bundle = new Bundle();
  bundle.putString("version code", versionCode);
  AppEventsLogger.updateUserProperties(bundle, response -> Logger.getInstance()
      .d("Facebook Analytics: ", response.toString()));
  FlurryAgent.addSessionProperty("version code", versionCode);
}
 
Example #21
Source File: MoPubAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
public void setMoPubAbTestGroup(boolean isControlGroup) {
  Bundle bundle = new Bundle();
  bundle.putString("ASV-1377-MoPub-Ads", isControlGroup ? "a_without_mopub" : "b_with_mopub");
  AppEventsLogger.updateUserProperties(bundle, response -> Logger.getInstance()
      .d("Facebook Analytics: ", response.toString()));
  FlurryAgent.addSessionProperty("ASV-1377-MoPub-Ads",
      isControlGroup ? "a_without_mopub" : "b_with_mopub");
}
 
Example #22
Source File: MoPubAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
public void setAdsVisibilityUserProperty(
    WalletAdsOfferManager.OfferResponseStatus offerResponseStatus) {
  Bundle bundle = new Bundle();
  String ads = mapToAdsVisibility(offerResponseStatus).getType();
  bundle.putString(ADS_STATUS_USER_PROPERTY, ads);
  AppEventsLogger.updateUserProperties(bundle, response -> Logger.getInstance()
      .d("Facebook Analytics: ", response.toString()));
  FlurryAgent.addSessionProperty(ADS_STATUS_USER_PROPERTY, ads);

  String adsStatusByRakamValue = mapAdsVisibilityToRakamValues(offerResponseStatus);
  Rakam.getInstance()
      .setSuperProperties(createRakamAdsSuperProperties(adsStatusByRakamValue));
}
 
Example #23
Source File: FirstLaunchAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Responsible for setting facebook analytics user properties
 */
private void setUserProperties(String key, String value) {
  Bundle parameters = new Bundle();
  parameters.putString(key, value);
  AppEventsLogger.updateUserProperties(parameters,
      response -> logger.logDebug("Facebook Analytics: ", response.toString()));
  FlurryAgent.addSessionProperty(key, value);
}
 
Example #24
Source File: FirstLaunchAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
private void setUserProperties(String utmSource, String utmMedium, String utmCampaign,
    String utmContent, String entryPoint) {
  setUserPropertiesWithBundle(
      createUserPropertiesBundle(utmSource, utmMedium, utmCampaign, utmContent, entryPoint));
  FlurryAgent.addSessionProperty(UTM_SOURCE, utmSource);
  FlurryAgent.addSessionProperty(UTM_MEDIUM, utmMedium);
  FlurryAgent.addSessionProperty(UTM_CAMPAIGN, utmCampaign);
  FlurryAgent.addSessionProperty(UTM_CONTENT, utmContent);
  FlurryAgent.addSessionProperty(ENTRY_POINT, entryPoint);
}
 
Example #25
Source File: FirstLaunchAnalytics.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
private void setUTMDimensionsToUnknown() {
  Bundle data = new Bundle();
  data.putString(UTM_SOURCE, UNKNOWN);
  data.putString(UTM_MEDIUM, UNKNOWN);
  data.putString(UTM_CAMPAIGN, UNKNOWN);
  data.putString(UTM_CONTENT, UNKNOWN);
  data.putString(ENTRY_POINT, UNKNOWN);
  setUserPropertiesWithBundle(data);
  FlurryAgent.addSessionProperty(UTM_SOURCE, UNKNOWN);
  FlurryAgent.addSessionProperty(UTM_MEDIUM, UNKNOWN);
  FlurryAgent.addSessionProperty(UTM_CAMPAIGN, UNKNOWN);
  FlurryAgent.addSessionProperty(UTM_CONTENT, UNKNOWN);
  FlurryAgent.addSessionProperty(ENTRY_POINT, UNKNOWN);
}
 
Example #26
Source File: FlurryProvider.java    From AnalyticsKit-Android with Apache License 2.0 5 votes vote down vote up
/**
 * @see AnalyticsKitProvider
 */
@Override
public void sendEvent(@NonNull AnalyticsEvent event) throws IllegalStateException
{
	Map<String, String> eventParams = stringifyParameters(event.getAttributes());

	if (event.isTimed())
	{
		// start the Flurry SDK event timer for the event
		if (eventParams != null)
		{
			FlurryAgent.logEvent(event.name(), eventParams, true);
		}
		else
		{
			FlurryAgent.logEvent(event.name(), true);
		}
	}
	else
	{
		if (eventParams != null)
		{
			FlurryAgent.logEvent(event.name(), eventParams);
		}
		else
		{
			FlurryAgent.logEvent(event.name());
		}
	}
}
 
Example #27
Source File: LuckyMoney.java    From luckymoney with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    new FlurryAgent.Builder().withLogEnabled(false)
            .build(this, "37T6NSWDQZ28FNJSWYBB");
}
 
Example #28
Source File: Flurry.java    From foam with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Perform Flurry setup/init
 */
void initFlurryAgent() {
    //FlurryAgent.setLogEnabled(true);
    FlurryAgent.setVersionName(utils.getVersionName(context));
    FlurryAgent.setUserId(utils.getAndroidId(context));
    FlurryAgent.setCaptureUncaughtExceptions(true);  // Crashes will also be reported
    FlurryAgent.init(context, applicationKey);
}
 
Example #29
Source File: HomeActivity.java    From zidoorecorder with Apache License 2.0 5 votes vote down vote up
@Override
protected void onStop() {
    super.onStop();
    try {
        FlurryAgent.onEndSession(this);
    } catch (Exception e) {
        // TODO: handle exception
    }
}
 
Example #30
Source File: FlurryAnalyticsHelper.java    From q-municate-android with Apache License 2.0 5 votes vote down vote up
public static void pushAnalyticsData(Context context) {
    // init Flurry
    FlurryAgent.setLogEnabled(true);
    FlurryAgent.init(context, "P8NWM9PBFCK2CWC8KZ59");

    Map<String, String> params = new HashMap<>();

    //param keys and values have to be of String type
    params.put("app_id", QBSettings.getInstance().getApplicationId());
    params.put("chat_endpoint", QBSettings.getInstance().getChatEndpoint());

    //up to 10 params can be logged with each event
    FlurryAgent.logEvent("connect_to_chat", params);
}