Source Code 0

안드로이드 앱에 앱스토어 실행 기능을 넣어요

안드로이드 앱에서 구글 앱스토어로 이동하는 기능을 구현해요.

                                                       

 

1. 구글 앱스토어.

자동 업데이트가 되지 않은 경우에 앱스토어로 이동하는 기능을 사용해요. 필수 업데이트를 적용하려고 한다면 핵심 기능이 되겠쩌.

developer.android.com - Google Play에 연결

 

try {
	startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName")))
} catch (e: ActivityNotFoundException) {
	startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=$packageName")))
}

 

developer.android.com - startActivity

 

댓글쓰기

댓글 삭제

댓글을 완전히 삭제할까요?

댓글