jjzjj

android - Flurry 不会在 android 中记录任何内容

coder 2023-12-12 原文

我以前实现过flurry。它工作正常。今天使用新版本的 sdk,flurry 不会在 logcat 中记录任何内容。

我的代码

乱舞.java

public class Flurry {

private static final String API_KEY = "xxxxxxxxxxxxxxxxxxxxxx";
private static Context mContext;

public static void init(Context c) {
    mContext = c;
}

public static Context getContext() {
    return mContext;
}

public static void onStartSession() {
    if (mContext != null) {
        Debug.e("", "startng flurry session...");

        FlurryAgent.setUserId(Utils.getUserId(mContext));
        FlurryAgent.setVersionName(Utils.getAppVersion(mContext));
        FlurryAgent.setLogEnabled(true);
        FlurryAgent.setLogEvents(true);
        FlurryAgent.onStartSession(mContext, API_KEY);
        // FlurryAgent.initializeAds(mContext);
    } else {
        Debug.e("", "mContext is null");
    }
}

public static void onEndSession() {
    if (mContext != null) {
        Debug.e("", "ending flurry session...");
        FlurryAgent.onEndSession(mContext);
    }
}
}

在 Activity 中

public class MainActivity extends TabActivity implements OnTabChangeListener {
/** Called when the activity is first created. */

TabHost tabHost;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);
    Flurry.init(this);
    Flurry.onStartSession();        

    setTabs();

}

@Override
protected void onDestroy() {
    Flurry.onEndSession();
    super.onDestroy();
}
}

在 manifest.xml 中

<uses-permission android:name="android.permission.INTERNET" />

当我在它显示这样的日志之前实现时,但今天在另一个应用程序中实现时,我没有得到任何 flurry 日志...可能是什么问题??

 4359            FlurryAgent  D  Initializing Flurry session
 4359            FlurryAgent  D  New session
 4359          TitleActivity  V  ::onResume::
 4359               Settings  W  Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
 4359            FlurryAgent  I  loading persistent data: /data/data/com.xxxxxx/files/.flurryagent.-6ee7b2a3
  4359            FlurryAgent  D  Loading API key: ****************xxxx
 4359            FlurryAgent  D  Loading session reports
 4359            FlurryAgent  D  Persistent file loaded
 4359            FlurryAgent  D  generating report
 4359            FlurryAgent  D  Sending report to: http://data.flurry.com/aap.do
 4359            FlurryAgent  D  Report successful
 4359            FlurryAgent  D  Processing report response
 4359            FlurryAgent  D  Done sending initial agent report

最佳答案

我在使用 Flurry Analytics SDK v3.1.0(本周从 Flurry 创建和下载)时收到日志消息。

以下是配置 Flurry 以将消息写入 Android 日志的相关代码:

@Override
protected void onStart() {
    super.onStart();
    FlurryAgent.onStartSession(this, FLURRY_API_KEY);
    FlurryAgent.setLogEnabled(true);
    FlurryAgent.setLogEvents(true);
    FlurryAgent.setLogLevel(Log.VERBOSE);

}

@Override
protected void onStop() {
    super.onStop();
    FlurryAgent.onEndSession(this);
}

这是证据

01-10 11:35:23.310: I/FlurryAgent(3915): loading persistent data: /data/data/com.ader/files/.flurryagent.624f614c
01-10 11:35:23.310: D/FlurryAgent(3915): Loading API key: ****************RY7Z
01-10 11:35:23.320: D/FlurryAgent(3915): Loading phoneId: AND2001447e7dcd4d3b
01-10 11:35:23.320: D/FlurryAgent(3915): Loading session reports
01-10 11:35:23.320: D/FlurryAgent(3915): Session report added: 1
01-10 11:35:23.320: D/FlurryAgent(3915): Session report added: 2
01-10 11:35:23.320: D/FlurryAgent(3915): Persistent file loaded
01-10 11:35:23.560: D/FlurryAgent(3915): generating report
01-10 11:35:23.570: D/FlurryAgent(3915): Sending report to: http://data.flurry.com/aap.do
01-10 11:35:29.610: D/FlurryAgent(3915): Report successful
01-10 11:35:29.610: D/FlurryAgent(3915): Done sending initial agent report

我认为诀窍在于您没有以下电话:

FlurryAgent.setLogLevel(Log.VERBOSE);

关于android - Flurry 不会在 android 中记录任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14190535/

有关android - Flurry 不会在 android 中记录任何内容的更多相关文章

  1. ruby - 如何将脚本文件的末尾读取为数据文件(Perl 或任何其他语言) - 2

    我正在寻找执行以下操作的正确语法(在Perl、Shell或Ruby中):#variabletoaccessthedatalinesappendedasafileEND_OF_SCRIPT_MARKERrawdatastartshereanditcontinues. 最佳答案 Perl用__DATA__做这个:#!/usr/bin/perlusestrict;usewarnings;while(){print;}__DATA__Texttoprintgoeshere 关于ruby-如何将脚

  2. ruby - 将数组的内容转换为 int - 2

    我需要读入一个包含数字列表的文件。此代码读取文件并将其放入二维数组中。现在我需要获取数组中所有数字的平均值,但我需要将数组的内容更改为int。有什么想法可以将to_i方法放在哪里吗?ClassTerraindefinitializefile_name@input=IO.readlines(file_name)#readinfile@size=@input[0].to_i@land=[@size]x=1whilex 最佳答案 只需将数组映射为整数:@land边注如果你想得到一条线的平均值,你可以这样做:values=@input[x]

  3. ruby - Highline 询问方法不会使用同一行 - 2

    设置:狂欢ruby1.9.2高线(1.6.13)描述:我已经相当习惯在其他一些项目中使用highline,但已经有几个月没有使用它了。现在,在Ruby1.9.2上全新安装时,它似乎不允许在同一行回答提示。所以以前我会看到类似的东西:require"highline/import"ask"Whatisyourfavoritecolor?"并得到:Whatisyourfavoritecolor?|现在我看到类似的东西:Whatisyourfavoritecolor?|竖线(|)符号是我的终端光标。知道为什么会发生这种变化吗? 最佳答案

  4. ruby-on-rails - 项目升级后 Pow 不会更改 ruby​​ 版本 - 2

    我在我的Rails项目中使用Pow和powifygem。现在我尝试升级我的ruby​​版本(从1.9.3到2.0.0,我使用RVM)当我切换ruby​​版本、安装所有gem依赖项时,我通过运行railss并访问localhost:3000确保该应用程序正常运行以前,我通过使用pow访问http://my_app.dev来浏览我的应用程序。升级后,由于错误Bundler::RubyVersionMismatch:YourRubyversionis1.9.3,butyourGemfilespecified2.0.0,此url不起作用我尝试过的:重新创建pow应用程序重启pow服务器更新战俘

  5. ruby - Sinatra:运行 rspec 测试时记录噪音 - 2

    Sinatra新手;我正在运行一些rspec测试,但在日志中收到了一堆不需要的噪音。如何消除日志中过多的噪音?我仔细检查了环境是否设置为:test,这意味着记录器级别应设置为WARN而不是DEBUG。spec_helper:require"./app"require"sinatra"require"rspec"require"rack/test"require"database_cleaner"require"factory_girl"set:environment,:testFactoryGirl.definition_file_paths=%w{./factories./test/

  6. ruby-on-rails - 如何在我的 Rails 应用程序 View 中打印 ruby​​ 变量的内容? - 2

    我是一个Rails初学者,但我想从我的RailsView(html.haml文件)中查看Ruby变量的内容。我试图在ruby​​中打印出变量(认为它会在终端中出现),但没有得到任何结果。有什么建议吗?我知道Rails调试器,但更喜欢使用inspect来打印我的变量。 最佳答案 您可以在View中使用puts方法将信息输出到服务器控制台。您应该能够在View中的任何位置使用Haml执行以下操作:-puts@my_variable.inspect 关于ruby-on-rails-如何在我的R

  7. ruby-on-rails - link_to 不显示任何 rails - 2

    我试图在索引页中创建一个超链接,但它没有显示,也没有给出任何错误。这是我的index.html.erb代码。ListingarticlesTitleTextssss我检查了我的路线,我认为它们也没有问题。PrefixVerbURIPatternController#Actionwelcome_indexGET/welcome/index(.:format)welcome#indexarticlesGET/articles(.:format)articles#indexPOST/articles(.:format)articles#createnew_articleGET/article

  8. ruby-on-rails - Rails 5 Active Record 记录无效错误 - 2

    我有两个Rails模型,即Invoice和Invoice_details。一个Invoice_details属于Invoice,一个Invoice有多个Invoice_details。我无法使用accepts_nested_attributes_forinInvoice通过Invoice模型保存Invoice_details。我收到以下错误:(0.2ms)BEGIN(0.2ms)ROLLBACKCompleted422UnprocessableEntityin25ms(ActiveRecord:4.0ms)ActiveRecord::RecordInvalid(Validationfa

  9. ruby-on-rails - RSpec:避免使用允许接收的任何实例 - 2

    我正在处理旧代码的一部分。beforedoallow_any_instance_of(SportRateManager).toreceive(:create).and_return(true)endRubocop错误如下:Avoidstubbingusing'allow_any_instance_of'我读到了RuboCop::RSpec:AnyInstance我试着像下面那样改变它。由此beforedoallow_any_instance_of(SportRateManager).toreceive(:create).and_return(true)end对此:let(:sport_

  10. ruby - 查找字符串中的内容类型(数字、日期、时间、字符串等) - 2

    我正在尝试解析一个CSV文件并使用SQL命令自动为其创建一个表。CSV中的第一行给出了列标题。但我需要推断每个列的类型。Ruby中是否有任何函数可以找到每个字段中内容的类型。例如,CSV行:"12012","Test","1233.22","12:21:22","10/10/2009"应该产生像这样的类型['integer','string','float','time','date']谢谢! 最佳答案 require'time'defto_something(str)if(num=Integer(str)rescueFloat(s

随机推荐