---
title: Android
description: Custom Tabsを使用してAndroidアプリにHuman Token Journeyを統合します — 軽量、安全、WebView不要。
canonical: https://developer.unico.io/ja/human-token/integrations/app/android
locale: ja
generated_by: markdown-export
---

- [/ja/](/ja/)
- [統合](/ja/human-token/integrations)
- アプリ
- Android

**このページの内容AndroidCustom Tabsを使用してAndroidアプリにHuman Token Journeyを統合します。

Custom Tabsは、アプリ内のブラウザタブでHuman Token Journeyを起動します。ジャーニーが完了すると、ブラウザはカスタムURLスキームにリダイレクトし、アプリがそれをインターセプトします。
### 前提条件​

Android 8（API 26）以降
`androidx.browser:browser:1.5.0`
アプリ固有のURLスキーム（例：`myapp`）

### ステップ 1：依存関係を追加する​

`build.gradle`に以下を追加：
```
implementation("androidx.browser:browser:1.5.0")
```

### ステップ 2：URLスキームを定義する​

一意のスキームを選択します（例：`myapp`）。プロセス作成時に`callbackUri`として使用されます：
```
callbackUri: myapp://callback
```

### ステップ 3：アクティビティを作成する​

```
import android.content.Intentimport android.net.Uriimport android.os.Bundleimport androidx.appcompat.app.AppCompatActivityimport androidx.browser.customtabs.CustomTabsIntentclass HumanTokenActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {        super.onCreate(savedInstanceState)        val url = intent.getStringExtra(EXTRA_PROCESS_URL) ?: return finish()        CustomTabsIntent.Builder()            .build()            .launchUrl(this, Uri.parse(url))    }    override fun onNewIntent(intent: Intent) {        super.onNewIntent(intent)        intent.data?.let { uri ->            if (uri.scheme == "myapp") {                // Journey completed — send processId to your backend                val processId = uri.getQueryParameter("id")                handleResult(processId)            }        }    }    private fun handleResult(processId: String?) {        // Fetch the result from your backend via Get Process        finish()    }    companion object {        const val EXTRA_PROCESS_URL = "process_url"    }}
```

### ステップ 4：AndroidManifest.xmlを設定する​

```
<uses-feature android:name="android.hardware.camera" android:required="false" /><uses-permission android:name="android.permission.CAMERA" /><activity    android:name=".HumanTokenActivity"    android:launchMode="singleTop"    android:exported="true">    <intent-filter>        <action android:name="android.intent.action.VIEW" />        <category android:name="android.intent.category.DEFAULT" />        <category android:name="android.intent.category.BROWSABLE" />        <data android:scheme="myapp" android:host="callback" />    </intent-filter></activity>
```

`singleTop`は、Androidが新しいアクティビティを作成する代わりに、既存のアクティビティで`onNewIntent()`を呼び出すことを保証します。
### ステップ 5：ジャーニーを開始する​

```
val intent = Intent(this, HumanTokenActivity::class.java)    .putExtra(HumanTokenActivity.EXTRA_PROCESS_URL, processLink)startActivity(intent)
```

### ファイルの概要​

ファイル目的`build.gradle``androidx.browser`依存関係`HumanTokenActivity.kt`Custom Tabsの起動 + リダイレクト処理`AndroidManifest.xml`URLスキームのIntentフィルター最終更新 2026年10月21日**に