Skip to content

Commit 37fab89

Browse files
committed
add readme
1 parent 5bbf48a commit 37fab89

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,65 @@
1-
# uni-android-intent
1+
# Uni Android Intent
2+
3+
adb shell am start で Android アプリを起動した時に指定された引数を解析する機能
4+
5+
[![](https://img.shields.io/github/release/baba-s/uni-android-intent.svg?label=latest%20version)](https://github.com/baba-s/uni-android-intent/releases)
6+
[![](https://img.shields.io/github/release-date/baba-s/uni-android-intent.svg)](https://github.com/baba-s/uni-android-intent/releases)
7+
![](https://img.shields.io/badge/Unity-2018.3%2B-red.svg)
8+
![](https://img.shields.io/badge/.NET-4.x-orange.svg)
9+
[![](https://img.shields.io/github/license/baba-s/uni-android-intent.svg)](https://github.com/baba-s/uni-android-intent/blob/master/LICENSE)
10+
11+
## バージョン
12+
13+
- Unity 2018.3.11f1
14+
15+
## 使用例
16+
17+
```cs
18+
adb shell am start ^
19+
-n com.baba_s.uniandroidintent/com.unity3d.player.UnityPlayerActivity ^
20+
--ei i 123 ^
21+
--el l 456 ^
22+
-e s ABC ^
23+
--ez b true ^
24+
--eia ia 111,223,343 ^
25+
--ela la 444,555,666 ^
26+
--esa sa AAA,BBB,CCC
27+
```
28+
29+
adb shell am start を使用して、引数付きで Android アプリを起動した場合に
30+
31+
```cs
32+
// int 型の値を取得
33+
Debug.Log( UniAndroidIntent.GetInt( "i" ) );
34+
35+
// long 型の値を取得
36+
Debug.Log( UniAndroidIntent.GetLong( "l" ) );
37+
38+
// string 型の値を取得
39+
Debug.Log( UniAndroidIntent.GetString( "s" ) );
40+
41+
// bool 型の値を取得
42+
Debug.Log( UniAndroidIntent.GetBool( "b" ) );
43+
44+
// int 型の配列を取得
45+
foreach ( var n in UniAndroidIntent.GetIntArray( "ia" ) )
46+
{
47+
Debug.Log( n );
48+
}
49+
50+
// long 型の配列を取得
51+
foreach ( var n in UniAndroidIntent.GetLongArray( "la" ) )
52+
{
53+
Debug.Log( n );
54+
}
55+
56+
// string 型の配列を取得
57+
foreach ( var n in UniAndroidIntent.GetStringArray( "sa" ) )
58+
{
59+
Debug.Log( n );
60+
}
61+
```
62+
63+
このようなコードで引数を解析して使用できます
64+
65+
![](https://cdn-ak.f.st-hatena.com/images/fotolife/b/baba_s/20190502/20190502180332.png)

0 commit comments

Comments
 (0)