亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? Java java?? ?? Android ?? ?? ??? ???

Android ?? ?? ??? ???

Nov 18, 2024 am 08:46 AM

?? ??? ??? ?? ??? ?? ? ??? ??? ??? ?? ????? ?? ??? ???? ??? ???? ???? ?????. ??? Android??? ? ??? ???? Android ?? ???? ??? ??? ?? FCM(Firebase Cloud Messaging) ?? ???? ?? ??? ?? ? ????. ?? ????? ?? ??? ???? ???? ?? ?? ???? ?? ???? ?? ??? ???? ? ??? ???.

Firebase ???? ???(FCM)? ??? ?? ??? ??? ??? ????? ??? ???? ??? ??? ? ?????. iOS, ? ? Android ???? ?? FCM?? ?????. FCM ?? ??? ???? ??? ????? ?? 4kb? ???? ?? ? ????.

? ????? ?? ??? Android ?? ???? ??? ???? ???? ??? ??? ??? ?? ?????. ?? ??? ??? ????? ???? ? ?? ?? ??? ??? ??? ?????.

Android ?? ?? ??

??? ?? ??? ??? ??, ?? ?? ? ??????? ???? ??? ??? ???? ? ??? ???. ?? ??? ???? ???? ??? ???? ???? ??? ?? ???? ?? ?? ? ????.

?? ??? ??? ???? Android ??? ??? ?? ??? ???? ??? ? ????.

i) ???? ??? ?? ?? ?? ?? ????

ii) ???? ??? ??? ??? ?? ??? ????? ?????.

iii) ????? ??? ?? ??? ??? ??? ??? ????.

iv) ?? ??? ???? ?? ???? ???? ????? ??? ??, ???? ? ??? ?????.

v) ??? ???? ?? ???? ??? ? ??? ??? ??? ???? ?? ???? ? ?? ??? ?? ??? ?????.

Android ??????? ?? ?? ?? ??

?? ??

Android ? FCM?? ?? ??? ????? ????? ?? ??? ???? ?????.

i) Android Studio – Android ??? ???? IDE???.

ii) ?? ?? ? ?? – Android ???? ?? ? ??, ????? ?? ??? ?? ???? ??? ?????.

iii) Firebase ?? – ???? ??? ???? ????? Firebase ??? ??? ???.

iv) ??? ??? – ?? ??? ? Firebase ???? ??? ??? ?????.

1??. Firebase ???? ??

Firebase ??? ?????.

??? ???? ??? ???? ????? ????.

Android Push Notifications Step by Step Guide

?? ??? ?? Google Analytics ???? ??? ?? ?????? ?? ?? ??? ??? ?? ? ????.

??? ????? ???? ??? ???? ???. ??? ????? ?? ? ????.

????? ??? ? ?? ?? ??? ?? ?? ???? ??? ???? ???.

???? ????? ? ??

Android ?? ????? ?????? Android ???? ???? ???. ???? Android ??? ??? ?????. ? ??? ??? ????? ??? ??(?: com.app.demoapp)? ???? ???.

Android Push Notifications Step by Step Guide

???? ?? ???? ?? ?? ???? ??? ?? ????.

?? SHA-1 ?? ?????. ????? SHA-1 ?? ????? ?? ??? ???? ???. ?? SHA-1 ?? ???? Firebase ??? ??????.

./gradlew signingReport

????? '? ??'? ???? ??? ?????.

Android Push Notifications Step by Step Guide

Google ??? ??

? ??? ???? google-services.json ??? ?????? ???? ??? ? ????.

?? Android ????? google-services.json? ???? Android ????? ? ????? ??? ???? ???.

MyApp/
├── app/
│ ├── src/
│ ├── build.gradle
│ ├── google-services.json
├── build.gradle
├── settings.gradle

Firebase SDK ??

???? ????? Firebase SDK? ???? build.gradle?? Google ??? ??? ??? ?????.

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

app/build.gradle?? ?? ???? ?????.-

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    // ...
}

dependencies {
    // Add these lines
    implementation platform('com.google.firebase:firebase-bom:29.0.4')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'
}

? ??? ?? ? Android Studio?? '?? ???'? ???? ????? Firebase? ???? ? ????.

2??. Android ???? ??

???? ?? build.gradle

???? ?? build.gradle ??: Android ????? ?? ????? ???? build.gradle ??? ????.

google() ? mavenCentral() ???? ??? ??? ???? ??? ?????.

buildscript {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
}

build.gradle? ?????.

???? ? ?????? build.gradle ??? ?? ?? ?? ?? ?? google-services ????? ???? ??? ??? Firebase ? Firebase ??? ???? ?????.

./gradlew signingReport

? ??? ???? ?? ??? ?? Firebase ???? ???? ????? Firebase ????? ?????. ?? Firebase ??? ??? ?? ? ? ?? ??? ???????.

3??. FCM ??

FCM ???? ???? ??? ??

FirebaseMessagingService? ???? MyMessagingService?? ? ???? ????.

?? ????? ??? ?? ? ???? ???? ????? onMessageReceived ???? ????? ???. ?? ?? ??? ???? ????? ????? ???? ??? ?????.

MyApp/
├── app/
│ ├── src/
│ ├── build.gradle
│ ├── google-services.json
├── build.gradle
├── settings.gradle

AndroidManifest.xml ??? ??

?????? AndroidManifest.xml ??? ???.

?? FCM ???? ????? ?????? MyMessagingService? ???? ???.

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

4??: FCM ?? ?? ??

?? ??? ???? ?? FCM ?? ??? ??? ???. ? ??? ??? ? ????? ???? ?????.

?? ??? ???? ?? ?

FirebaseMessagingService ?? ?? ?? ??? ???? FCM ?? ??? ??? ? ????. FirebaseMessagingService?? ?? ???? ??? ???????.

MyMessagingService ????:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    // ...
}

dependencies {
    // Add these lines
    implementation platform('com.google.firebase:firebase-bom:29.0.4')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'
}

???? ???? ??? ??? ??? ?? ????? ??? ? ????.

buildscript {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
}

??? ??? ???? Android ??? FCM ?? ??? ?? ? ????. ??? FirebaseMessagingService? ?? ?? ???? ??? ? ????. ? ??? ?? ??? ?? ?? ??? ??? ? ?????.

5??: ?? ?? ???

???? ??? ???? FCM API? POST ??? ?? ???.

?? ?? ?????

  • Firebase ?? → ???? ?? → '???? ??' → '???? ???'??.
  • “???? ?? ??”?? ?? ?? ?? ? ????.

cURL ??: ? cURL ??? ??? ??? ? ?????. ?? ?? ?? ?? ??? FCM ????.

./gradlew signingReport

  • https://fcm.googleapis.com/fcm/send API ?????
  • H "Authorization: key=": ?? ?? ??? ?? ?????.
  • H "Content-Type: application/json": ??? ?? ??.
  • d '{ ... }': ??? ???? ??? JSON ???????.

?? ??

??? ??? ??

??? ???? ??? ?? ?-? ?? ??? ? ?? ??? ???? ?? ???? ??? ?????. ?? ?????? ???, ?????? ???? ???? FirebaseMessagingService ? onMessageReceived ???? ?? ??? ???? ?????.

??? ??? ??? ?

MyMessagingService ????

MyApp/
├── app/
│ ├── src/
│ ├── build.gradle
│ ├── google-services.json
├── build.gradle
├── settings.gradle

?? ?? ??

Android 8.0(API ?? 26)??? ?? ??? ??? ???? ???. ?? ?? ???? ? ??? ?? ??? ??? ? ????.

?? ?? ?? ?

?? ?? ?? ?? ???:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

MainActivity ?? ?????? ????? ? ???? ?????.

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    // ...
}

dependencies {
    // Add these lines
    implementation platform('com.google.firebase:firebase-bom:29.0.4')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'
}

?? NotificationUtils.createNotificationChannel(this)? ??? ?? ????. ?????? ???? ?? ??:

buildscript {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
    dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
        // Check that you have these lines
        google()
        mavenCentral()
    }
}

?? ID? ????? ?? ?? ????:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 33
    defaultConfig {
        applicationId "com.example.myandroidapp"
        minSdkVersion 21
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    // Add Firebase BOM
    implementation platform('com.google.firebase:firebase-bom:29.0.4')
    // Add Firebase Messaging dependency
    implementation 'com.google.firebase:firebase-messaging'
}

// Add this line at the bottom of the file
apply plugin: 'com.google.gms.google-services'

?? ?? ???

?? ??? ???? ???? ?????? ????? ???.

Android Studio??? logcat? ?? ?? > ?? ? > ???.

FirebaseMessagingService ????? ??? ??? ???? logcat ??? ???? ?? ????. ??????? ???? ?? ?????? ?? ???? ??? ???.

??? ???? ??? ?? logcat?? ???? ? ? ????.

import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import androidx.core.app.NotificationCompat;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

public class MyMessagingService extends FirebaseMessagingService {

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        // Handle the received message
        if (remoteMessage.getNotification() != null) {
            // Get the message body
            String messageBody = remoteMessage.getNotification().getBody();
            // Send a notification
            sendNotification(messageBody);
        }
    }

    private void sendNotification(String messageBody) {
        Intent intent = new Intent(this, MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);

        String channelId = getString(R.string.default_notification_channel_id);
        NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId)
                .setSmallIcon(R.drawable.ic_notification)
                .setContentTitle(getString(R.string.app_name))
                .setContentText(messageBody)
                .setAutoCancel(true)
                .setContentIntent(pendingIntent);

        NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            NotificationChannel channel = new NotificationChannel(channelId, "Channel human readable title", NotificationManager.IMPORTANCE_DEFAULT);
            notificationManager.createNotificationChannel(channel);
        }

        notificationManager.notify(0, notificationBuilder.build());
    }
}

??? ???? ??? ?? ? ? ????.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myandroidapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!-- Add this service -->
        <service
            android:name=".MyMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <!-- Other activities and services -->
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

??

? ????? ?? ??? ??? ?? ??? ?? ??? ?? ??????. Firebase ???? ????? ???? ??? Firebase ???? ???? ?? ??? ???? Android ????? Android ??? ??? ??? ?????.

Firebase ????? ???? google-services.json ??? ?????? ???? ???. ?? ?? ? ?? ?? ????? ???? Firebase ???? ????? build.gradle ??? ???? ???.

?? ?? ?? ???? ??? ???? ???? ? ??? ???? AndroidManifest.xml? ???? ???. ????? ??? ???? ??? ? ?? ???? ???? ? ???? FCM ??? ???? ?? ??? ??? ??? ? ????.

Firebase ???? ???? ??? Android Studio? logcat? ???? ??? ?????? ??? ???? ? ????. ?? ? ??? ?????? Firebase ?? ? ? ??? FCM ??? ?? cURL ??? ?????.

?? Android ???? ???? ????? 'FirebaseMessagingService'?? ??? ???? ???? ??? ??? ?? ?? ??? ???? ???.

?? ????? ??? ??? ???? ??? ???? ???? ?? ? ?? ?? ??? ??? ??? ???? ? ?? ?????.

??? ??? ??? ??? ?? Firebase ? Android SDK ??? ?????. ??? ????? ??????? ?? ??? ???? ?? ??? ??? ?? ?? ??? ?????.

? ??? Android ?? ?? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
???
?? ??? ??? ????? ?? ?? ??? ??? ????? ?? Jul 07, 2025 am 02:24 AM

Java? ??? ?? ??, ?? ? ??? (? : Projectreactor) ? Java19? ?? ???? ??? ??? ?????? ?????. 1. CompletableFuture? ?? ??? ?? ?? ??? ? ?? ??? ????? ?? ??????? ? ?? ??? ?????. 2. Projectreactor? ?? ? ??? ??? ???? ?? ???? ? ??? ???? ?? ? ?????? ?????. 3. ?? ???? ??? ??? ??? I/O ??? ? ??? ???? ?? ??? ????? ??? ???? ????. ? ???? ?? ??? ????? ??? ??? ??? ?? ??? ??? ?????? ???? ???? ?? ?? ??? ??????.

???? ??? ?????? ?? ?? ???? ??? ?????? ?? ?? Jul 07, 2025 am 02:35 AM

Java?? ??? ?? ?? ??? ???? ? ?????. ?? ???? ??? ?????. 1. ?? ?? ? ???? ??????? ?? ?? ?? ??? ???? ??? ?????. 2. ?? ??, ???, ??? ?? ?? ?? ???? ????? ?? ??? ??? ??? ?????. 3. ENUMMAP ? ENUMSET? ???? ?? ? ?? ???? ???? ??? ???? ? ?????? ?????. 4. ?? ?, ??? ?? ?? ??? ?? ????? ?? ??? ??? ?????.? ????? ?? ???? ????????. ??? ???? ???? ?? ??? ????? ??? ?? ? ??? ?? ?????? ???????.

Java Nio? ? ??? ????? Java Nio? ? ??? ????? Jul 08, 2025 am 02:55 AM

Javanio? Java 1.4? ?? ? ??? IOAPI???. 1) ?? ? ??? ?????, 2) ??, ?? ? ??? ?? ?? ??, 3) ? ??? ??? ???? 4) ?? ??? ?? IO?? ? ????? ?????. 1) ? ?? IO? ??? ?? ??? ???, 2) ??? ??? ?? ???? ?????, 3) ???? ?????? ???? 4) ??? ?? ??? ?? ?? ? ??? ?????. 1) ??? ??/??? ??? ?? ?????, 2) ???? ???? ???? ?? ???? ???????. 3) ??? ??? ??? ???????.

Java ??? ??? ????? ???? ?? Java ??? ??? ????? ???? ?? Jul 06, 2025 am 02:53 AM

Java? ????? ????? ??? ??? ?? ???? ?? ?? ??????, ?? ? ???? ? ??? ????. ?? ???? ??? ??? ???? ??? ??? ???? ?? ??? ??? ????. ???? ???? ??? ??, ?? ??? ???? ???? ?? ??? ?? ???? ?? ?????. ???? ?? ?? ??? ?? ?? ??? ?????. ?????? ?? ??? ??? ???? ?? ??? ??? ?? ??? ???? ???? ??? ?? ??? ?????? ???? ????? ??? ?? ?? ???, ?? ? ?? ???? ??? ??? ?????. ???? urlclassl? ?? ??? ??? ??? ?? ? ? ????

???? Java ??? ????? ????? ???? Java ??? ????? ????? Jul 05, 2025 am 02:35 AM

Java ?? ??? ??? ?? ? ??? ???? ?? ??? ???? Try-Catch? ???? ????? ????? ???? ????. 1. IoException? ?? ?? ? ??? ???? ?? ??? ??? ?? ???????. 2. NullPointerException? ?? ???? ?? ??? ????? ???? ?? ??? ?? ???? ??? ?????. 3. ??? ?? ? ?? ??? ???? ??? ??? ?? ????? ???????. 4. CODE? ?? ??? ??? ?? ??? ???? ??? ???? ??? ???? ?? ?? ????. 5. ?? ???? ??? ??? ?? ??? ??? ?? ???? ??? ???????.

?? ?? ???? ????? ??? ?????? ?? ?? ???? ????? ??? ?????? Jul 15, 2025 am 03:10 AM

?? ?? Java? ?? ???? ?? ? ? ? ????? ????, ? ??? ??? ??? ??? ???? ? ????. 1. ?? ?? hashcode () ???? ???? ?? ?? ???? ?? ??? ?? ?? ???? ?????. 2. ?? ??? ??? ?? ?? ???? ??? ??? ? ????. ?? ??? ?? ? ??? ??? ?????. JDK8 ? ?? ? ??? ?? ?? (?? ?? 8) ??? ????? ?? ???? ?? ? ??? ?????. 3. ??? ?? ???? ?? ???? ?? equals () ? hashcode () ???? ?? ???????. 4. ?? ?? ??? ???? ?????. ?? ?? ??? ???? ?? ?? (?? 0.75)? ??? ?? ? ???; 5. ?? ?? ??? ??? ??? Multithreaded?? Concu? ???????.

?? : ?? ?? ?????? Java ??? ?? : ?? ?? ?????? Java ??? Jul 05, 2025 am 02:52 AM

???? Java ?? ?? ?????? ?? ?? ? ?????. ??? "??? ?????, ?? ??"? ????. ??, ??? ? ?? ? ?? ??? ?? ?? ??? ??? ???? ?? ?? ? ?????? ?????. 1. ???? ?? ???? ?? ??? ??? ?? ? ?????, ?? ??? ??? ?? ?? ??? ?? ?????. 2. ??? ?? ??, ?? ? ?? ? ?? ??? ? ?? ??? ??????. 3. ?? ?? ?? ??? ??, ??? ?? ? ??? ?? ??? ???? ???? ? ?????. 4. ???? ?? ???? ?? ?? ? ??? ? ?? ? ? ????. ?? ???? ?? ? ??? ??? ????? ???? ??????? ?? ?????? ???????.

Java ?? ? ?? ??? ???? ?? Java ?? ? ?? ??? ???? ?? Jul 07, 2025 am 02:43 AM

Java ??? ??? ???? ??? ??? ??? ?????, ???? ????, ?????? ??? ? ????. 1. ??? ????? ???? ??? ? ? ??? ?? ?? ????? ???? ? ???? ??????. 2. ???? ?? ?? ???? ??? ??? ???? ?? ?? ???? ??? ??? ? ????. 3. ???? ???? ??? ??? ?? ??? ?? ? ? ??????. 4. ?? ?? ?? ??? ? ??? ??? ?? ????? ?? ?? ??? ??? ? ????. 5. ??, ?? ?? ??, ?? ?? ?? ???, ????? ?? ?? ? ???? ??? ????? ??????.

See all articles