Implementing the AePS Service App On click operation binding.submitButton.setOnClickListener(view -> checkAppInstalledOrNot()); Checking that the application already installed or not private fun checkAppInstalledOrNot() { val installed = appInstalledOrNot("com.isu.aepssdk") try { if (installed) { sendDataToService("com.isu.aepssdk") } else { // It will be displayed if the app is not installed on your phone showAlert() } } catch (e: Exception) { e.printStackTrace() } } private fun appInstalledOrNot(uri: String): Boolean { val pm = packageManager return try { pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES) true } catch (e: PackageManager.NameNotFoundException) { false } } Alert - if the service app is not installed private fun showAlert() { try { val alertBuilder = AlertDialog.Builder(this, android.R.style.Theme_Material_Light_Dialog_Alert) alertBuilder.setCancelable(false) val message = "Please download the AEPS SERVICE app." alertBuilder.setTitle("Alert") .setMessage(message) .setPositiveButton("Download Now") { dialog, which -> redirectToAppStore() } .setNegativeButton("Not Now") { dialog, which -> dialog.dismiss() } val alertDialog = alertBuilder.create() alertDialog.show() } catch (e: Exception) { e.printStackTrace() } } If not installed then redirect to app store private fun redirectToAppStore() { val uri = Uri.parse("https://liveappstore.in/shareapp?com.isu.aepssdk= ") val goToMarket = Intent(Intent.ACTION_VIEW, uri).apply { addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_NEW_DOCUMENT or Intent.FLAG_ACTIVITY_MULTIPLE_TASK) } try { startActivity(goToMarket) } catch (e: ActivityNotFoundException) { try { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://liveappstore.in/shareapp?com.isu.aepssdk= "))) } catch (exception: Exception) { Toast.makeText(this, "App Not Found", Toast.LENGTH_SHORT).show() } } } Please do login to see details.