小编Jai*_*odi的帖子

为 Google Analytics 查找跟踪 ID 的问题

我必须在我的 Android 应用程序中集成 Google Analytics。

完成了它的所有代码但是,有一个问题。

问题是从我的 google 分析帐户中获取跟踪 ID

根据文件:

==> 要查找 Google Analytics ID(跟踪 ID):

  1. 登录您的 Google Analytics(分析)帐户。

  2. 单击管理员。

  3. 从帐户列的菜单中选择一个帐户。

  4. 从属性列的菜单中选择一个属性。

  5. 在属性下,单击跟踪信息 > 跟踪代码。您的 Google Analytics ID 显示在页面顶部。

但是,根据步骤编号,我找不到跟踪信息选项或任何跟踪代码:5。

从我在哪里可以得到跟踪ID看起来像这样的:(UA-41888835-6)

注意:我可以在那里找到属性 ID。

android google-analytics google-analytics-api

14
推荐指数
2
解决办法
9493
查看次数

具有自定义FirebaseOptions初始化方法的Firebase Google Analytics(分析)

我必须为我的Android应用程序添加简单的Firebase Google Analytics。

我需要在运行时选择应用程序的Firebase项目。

“这非常罕见,但是有时应用程序必须能够在运行时选择其Firebase项目。这意味着您的应用程序无法使用合并到您应用程序中的FirebaseInitProvider提供的自动初始化。在这种情况下,解决方案有两个任务。”

参考链接:https : //firebase.googleblog.com/2017/03/take-control-of-your-firebase-init-on.html

因此,就我而言,我已完成以下操作:

  1. 创建了一个Application类:

    public class MyApplicationClass extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            FirebaseOptions.Builder builder = new FirebaseOptions.Builder().setApplicationId("1:5478125639014:android:054aa87g102b94aa5").setApiKey("ABcdXyzpQrst_8tlItnC5rcbgxkK_PqrstGWsTKo");
            FirebaseApp.initializeApp(this, builder.build());
        }
    
    Run Code Online (Sandbox Code Playgroud)
  2. 添加了必需的清单Internet权限。

  3. 增加了依赖性:

    实施'com.google.firebase:firebase-analytics:17.1.0'

问题是我在那看不到任何分析数据,并且应用程序在Google Analytic的最后一步没有建立连接。

可能是什么问题或待解决的问题?

android google-analytics firebase firebase-analytics

9
推荐指数
1
解决办法
165
查看次数

为 OpenCv 添加模块依赖项的问题

我正在尝试为 Open Cv 添加模块依赖项。

为此,我从以下链接下载了最新的 OpenCv 库:https ://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.4.3/

然后,在 Android Studio 中,我做了如下操作:

文件 > 新建 > 导入模块

这样,我就为 OpenCv 导入了一个模块/目录。

现在,我必须为添加的模块添加模块依赖项。为此,我正在尝试执行以下操作:

文件 > 项目结构 > 依赖 > + > 模块依赖

但是,它告诉我:选择至少一个模块

可能是什么问题?

dependencies android opencv android-studio

7
推荐指数
1
解决办法
1524
查看次数

React-native:实现奖励推荐(邀请和赚取)

我必须在我的 Android 应用程序中实现邀请和赚取功能。

我要做的是:用户可以将链接分享给社交媒体上的任何人,收到链接后,其他用户可以单击该链接以使用该链接安装应用程序。

在用户使用该链接安装应用程序后,发送者或受邀者可以获得奖励。这怎么可能?

到目前为止,我浏览了 Firebase 的动态链接概念并找到了一些演示。但是,在里面还是一头雾水。

你能指导我完成这样的事情我还必须经历哪些其他事情吗?

在本机反应中是否可能。如果没有,那么我如何在 Android 中实现这一目标?

谢谢

android deep-linking reward-system react-native firebase-dynamic-links

6
推荐指数
1
解决办法
7514
查看次数

Android 中检测手指总触摸次数

我必须计算点击屏幕的手指总数。

使用的触摸事件如下:

relTouch.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {

            switch(event.getPointerCount()){
                case 1:
                    Toast.makeText(MainActivity.this, "Single touch", Toast.LENGTH_SHORT).show();
                    break;
                case 2:
                    Toast.makeText(MainActivity.this, "Double touch", Toast.LENGTH_SHORT).show();
                    break;
                case 3:
                    Toast.makeText(MainActivity.this, "Triple touch", Toast.LENGTH_SHORT).show();
                    break;
            }
            return true;
        }

    });
Run Code Online (Sandbox Code Playgroud)

运行良好。

但是,问题是当我用多个手指点击时,它也会给我单击一下。如果我用 3 个手指点击,它也会给我单击和双击。

如何解决这个问题?

android touch ontouchlistener motionevent

5
推荐指数
0
解决办法
1121
查看次数

此浏览器不支持自动 publicPath

我试图开始我的 webpack 构建,但出现如下错误:

if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser").... Webpack 版本是 v5-3-0。

我第二次见到 Webpack,我感到很困惑。我之前的 webpack.config.js 是一样的,但是 Webpack 版本是 v4-44-2。

你能推荐什么?

webpack

5
推荐指数
1
解决办法
1542
查看次数

setLatestEventInfo()无法在Android Studio中解析

我在Android Studio中工作并尝试生成特定日期和时间的通知.一切正常,但是,在我的Service类中,setLatestEventInfo()方法无法解析.我在eclipse中做过相同的演示,eclipse没有任何问题.我不希望在任何Button的点击或任何手动事件生成上生成通知,但是在我指定的特定日期和时间.

服务类代码如下:

public class MyRemiderService extends Service {
private NotificationManager mManager;

@Override
public IBinder onBind(Intent intent) {

    return null;
}

@Override
public void onCreate() {

    super.onCreate();
}

@Override
@Deprecated
public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);
    mManager = (NotificationManager) getApplicationContext()
            .getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
    Intent intent1 = new Intent(this.getApplicationContext(),
            HomeActivity.class);
    Notification notification = new Notification(R.drawable.notification_template_icon_bg,
            "This is a test message!", System.currentTimeMillis());
    intent1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP
            | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    PendingIntent pendingNotificationIntent = PendingIntent.getActivity(
            this.getApplicationContext(), 0, intent1,
            PendingIntent.FLAG_UPDATE_CURRENT);
    notification.flags |= Notification.FLAG_AUTO_CANCEL;
    notification.setLatestEventInfo(this.getApplicationContext(),
            "AlarmManagerDemo", "This is a …
Run Code Online (Sandbox Code Playgroud)

notifications android android-notifications

4
推荐指数
1
解决办法
2万
查看次数

如何从 Android Studio 运行单个 Kotlin 类

我是 Kotlin 开发新手,我在 Android Studio 中创建了一个单独的 Kotlin 类,如下所示:

  class MainClass{

    fun main(args: Array<String>)  {
        println("Hello World");
    }
 }
Run Code Online (Sandbox Code Playgroud)

但是,我如何运行这个 kotlin 类,以及在哪里生成输出。

android program-entry-point kotlin android-studio-3.0

4
推荐指数
1
解决办法
1592
查看次数

在 kotlin 协程中实现 async-await()

我创建了如下功能:

fun getPercentage(id:String): String {
    var percentage=""
    scope.launch {
        percentage=repo.getPercentage(id)?.get(0)?.percent.toString()
        Log.e("$$$ value >>","$$$ value >>"+percentage)
    }
    Log.e("$$$ value outside >>","$$$ value >>"+percentage)
    return percenatge
}
Run Code Online (Sandbox Code Playgroud)

在这里,我无法使用变量:百分比返回更新后的值。

我得到的日志如下:

$$$ value outside >> 
$$$ value >> 50
Run Code Online (Sandbox Code Playgroud)

意味着我无法返回最新值。流程出了问题。

有人建议我使用 async{} 和await()。但我不知道这对这里有什么帮助?

请指导。谢谢。

android coroutine kotlin kotlin-coroutines

4
推荐指数
1
解决办法
7872
查看次数

Google 应用程序更新 - 关于 Android Live 应用程序的即时更新

我正在按照以下链接在我的 android 实时应用程序中提供应用程序更新体验或功能。

链接在这里:https : //developer.android.com/guide/playcore/in-app-updates#java

从链接内容来看,我正在实施立即应用更新功能。

到目前为止,我已完成以下步骤:

  1. 也降级了我的应用程序版本和版本代码。
  2. 生成新的 Release APK 并将其安装在我的 Android 设备中。
  3. 在我的 Splash Activity 中为应用程序更新功能添加了以下代码。

实现如下代码:

首先添加依赖项: implementation 'com.google.android.play:core:1.7.1'

然后,在 Splash Activity 中,

        // Creates instance of the manager.
        final AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(SplashActivity.this);

        // Returns an intent object that you use to check for an update.
        Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

        // Checks that the platform will allow the specified type of update.
        appUpdateInfoTask.addOnSuccessListener(new OnSuccessListener<AppUpdateInfo>() {
            @Override
            public void onSuccess(AppUpdateInfo appUpdateInfo) {
                if (appUpdateInfo.updateAvailability() == …
Run Code Online (Sandbox Code Playgroud)

android app-update in-app-update google-play-core

3
推荐指数
1
解决办法
461
查看次数