小编Sp4*_*4Rx的帖子

如何检查我的小部件屏幕何时在像 Android 中的 onResume 这样的颤动中可见

在android中,如果活动可见,onResume则调用。什么是相当于方法onResume颤振

我需要知道我的小部件屏幕何时可见,以便我可以根据它自动播放视频。我可能会转到另一个小部件屏幕,当我回来时它应该会自动播放。

我的方法是播放视频,didUpdateWidgetdidUpdateWidget每次即使小部件屏幕不可见也会被调用。

注意:我不是在问didChangeAppLifecycleStatefromWidgetsBindingObserver因为它为onResume应用程序生命周期提供等回调而不是特定的小部件屏幕。

android flutter

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

Npm 安装因 docker buildx linux/arm64 失败

x86_64我正在从一台机器为部署服务器构建一个 docker 映像,该服务器是arm64. 为了进行测试,我使用下面的 docker 文件。

FROM node:14.16.0-buster

RUN npm install pm2@latest -g
Run Code Online (Sandbox Code Playgroud)

由于某种原因,npm install我也尝试过npm -v但失败了。请检查下面我的控制台日志以获得更清楚的信息。

$~ docker buildx create --platform linux/arm64 --use --name arm64
arm64

$~ docker buildx ls
NAME/NODE DRIVER/ENDPOINT             STATUS   PLATFORMS
arm64 *   docker-container
  arm640  unix:///var/run/docker.sock inactive linux/arm64*
default   docker
  default default                     running  linux/amd64, linux/386
  
$~ docker buildx build --platform linux/arm64 -t fos-node --load .
[+] Building 146.3s (7/7) FINISHED
 => [internal] booting buildkit                                                                                                                                                       29.7s
 => => pulling image moby/buildkit:buildx-stable-1 …
Run Code Online (Sandbox Code Playgroud)

node.js npm docker dockerfile

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

无法解决:com.google.firebase:firebase-core:9.6.0

根据FB文档在这里做了一切但编译时仍然出现以下错误:

Error:(44, 13) Failed to resolve: com.google.firebase:firebase-core:9.6.0
Run Code Online (Sandbox Code Playgroud)

我的SDK管理员说一切都是最新的:

Google Play services Rev. 33 installed
Google Repository Rev. 35 installed
Run Code Online (Sandbox Code Playgroud)

这是我的build.gradle内容:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "xxxx.xxxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 14
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    // Support libraries
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    // Google APIs
    // Note: Avoid compiling the entire play-services package.
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
    compile 'com.google.android.gms:play-services-location:9.4.0' …
Run Code Online (Sandbox Code Playgroud)

android firebase

6
推荐指数
3
解决办法
7246
查看次数

针对Java应用程序的Firebase用户身份验证(非Android)

我想使用firebase 为我的java应用程序创建一个用户身份验证表单.可以使用连接到实时数据库的依赖项,这里详细记录了Firebase Admin的使用.

但目前Firebase Admin仅支持Node.js的用户身份验证,此处将对此进行说明.

这是我的测试代码.

public class Login {
    private JPanel jPanel;

    public static void main(String[] args) {
//        Show My Form
        JFrame jFrame = new JFrame("Login");
        jFrame.setContentPane(new Login().jPanel);
        jFrame.pack();
        jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        jFrame.setVisible(true);

//        Firebase
        FirebaseOptions options = null;
        try {
            options = new FirebaseOptions.Builder()
                    .setServiceAccount(new FileInputStream("xxx.json"))
                    .setDatabaseUrl("https://xxx.firebaseio.com/")
                    .build();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        if (options != null) {
            FirebaseApp.initializeApp(options);
            DatabaseReference ref = FirebaseDatabase.getInstance().getReference("Clip");
            ref.addValueEventListener(new ValueEventListener() {
                public void onDataChange(DataSnapshot …
Run Code Online (Sandbox Code Playgroud)

java firebase firebase-authentication

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

如何减小 apk 大小(应用程序大小太大)

检查下面我的gradle配置。

    android {
    signingConfigs {
        config {
            keyAlias 'xxx'
            keyPassword 'xxx'
            storeFile file('/home/xxx/AndroidStudioProjects/key/key.jks')
            storePassword 'xxx'
        }
    }
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "app.examinations.com"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner     "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            debuggable false
            signingConfig signingConfigs.config
        }
        debug {
            signingConfig signingConfigs.config
        }
    }
}
repositories {

    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(include: ['*.jar'], …
Run Code Online (Sandbox Code Playgroud)

android proguard apk

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