반응형
-Android Manifest
<activity
android:name=".Activity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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:host="test_web"
android:scheme="test" />
</intent-filter>
</activity>
-Web
var userAgent = navigator.userAgent;
if(userAgent.match(".*Android.*")){
location.href = 'intent://test_web#Intent;scheme=test;package=kr.co.test;end'
}
-Android 앱으로 보낼 데이터가 있을경우
location.href = 'intent://test_web?data=0#Intent;scheme=test;package=kr.co.test;end'
-Android 데이터 받기
( Filter 설정한 Activity에서)
String data = intent.getData().getQueryParameter("data")
*앱을 종료 한 후 호출해야 데이터가 받아짐.
그 Intent 메소드 재정의해서 사용하면 되나..?( 아직해보진 않음.. )
반응형
'IT 이야기 > 2021_Android 이것저것' 카테고리의 다른 글
GPS 위치 정확도 승인 (0) | 2021.12.07 |
---|---|
RecycleView 높이 가변적으로 조절.. (0) | 2021.12.01 |
Android Doze Mode 적용시키는방법 (0) | 2021.11.25 |
wav파일 사이즈 (0) | 2021.11.09 |
BottomNavigation + 각 Navigation (0) | 2021.11.09 |