# เริ่มต้นใช้งาน Android SDK อย่างรวดเร็ว

เริ่มต้นใช้งาน Pushwoosh Android SDK โดยใช้ตัวอย่างที่ง่ายและรวดเร็วนี้

## ข้อกำหนดเบื้องต้น

ในการผสาน Pushwoosh Android SDK เข้ากับแอปของคุณ คุณจะต้องมีสิ่งต่อไปนี้:

<TranslatedFragment id="prerequisites-android" />

## ดาวน์โหลดโปรเจกต์ตัวอย่าง

โคลนโปรเจกต์ตัวอย่างจาก GitHub:
```bash
git clone https://github.com/Pushwoosh/pushwoosh-android-sample
```

## กำหนดค่าโปรเจกต์

1. วางไฟล์ **google-services.json** ของคุณในไดเรกทอรี pushwoosh-demoapp/app

2. ในไฟล์ **build.gradle** ของคุณ (Module: app) ให้อัปเดต `applicationId` ให้ตรงกับชื่อแพ็กเกจของคุณ

3. ใน **res/values/strings.xml** ให้แทนที่ค่า placeholder ด้วยรายละเอียดเฉพาะของคุณ:
  - `pushwoosh_app_id`: ใช้ Pushwoosh App Code ของคุณ
  - `pushwoosh_api_token`: ใช้ [Pushwoosh Device API Token](/th/developer/api-reference/api-access-token/#device-api-token) ของคุณ
```xml title="strings.xml"
<resources>
    <string name="app_name">demoapp</string>
    <string name="title_home">Actions</string>
    <string name="title_notifications">Settings</string>
    <string name="pushwoosh_app_id">_YOUR_PUSHWOOSH_APP_ID_</string>
    <string name="pushwoosh_api_token">_YOUR_PUSHWOOSH_DEVICE_API_TOKEN_</string>
</resources>
```

## รันโปรเจกต์

1. บิวด์และรันโปรเจกต์
2. แอปจะมีสองแท็บ: "Actions" และ "Settings" ไปที่แท็บ **Settings**
3. แตะปุ่ม **Register for Pushes**
4. ให้สิทธิ์สำหรับการแจ้งเตือนแบบพุช อุปกรณ์จะถูกลงทะเบียนกับ Pushwoosh

คุณควรจะเห็นรายการบันทึก (log) ลักษณะนี้:
```plaintext title="Logcat"
Log level: INFO
[RequestPermissionHelper] Requesting permissions
Pushwoosh SDK initialized successfully
HWID: __HWID_OF_YOUR_DEVICE__
APP_CODE: __YOUR_PUSHWOOSH_APP_ID__
PUSHWOOSH_SDK_VERSION: __PUSHWOOSH_SDK_VERSION_INSTALLED__
FIREBASE_PROJECT_ID: __YOUR_FIREBASE_PROJECT_ID__
PUSH_TOKEN:
User ID "__USER_ID_OF_THE_DEVICE__" successfully set

[NotificationManager] Registered for push notifications: __DEVICE_PUSH_TOKEN__
```

## ส่งการแจ้งเตือนแบบพุช

กลับไปที่ Pushwoosh Control Panel และ [ส่งการแจ้งเตือนแบบพุช](/th/product/messaging-channels/push-notifications/send-push-notifications/one-time-push) ไปยังอุปกรณ์ที่ลงทะเบียนไว้ของคุณ

## ขั้นตอนถัดไป
หากต้องการเรียนรู้เพิ่มเติม โปรดดูที่ [คู่มือการผสานรวมพื้นฐาน](/th/developer/pushwoosh-sdk/android-sdk/firebase-integration/integrate-pushwoosh-android-sdk/)