Implementing the AePS Service App On click operation binding.submitButton.setOnClickListener(view -> checkAppInstalledOrNot()); Checking that the application already installed or not private fun checkAppInstalledOrNot() { // For Production val packageName = "com.isu.aeps.androidsdk_en" // For Staging val packageName = "com.isu.aepssdk" val installed = appInstalledOrNot(packageName) try { if (installed) { sendDataToService(packageName) } else { // It will be displayed if the app is not installed on your phone showAlert(packageName) } } catch (e: Exception) { e.printStackTrace() } } private fun appInstalledOrNot(packageName:String): Boolean { val pm = packageManager return try { pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES) true } catch (e: PackageManager.NameNotFoundException) { false } } Alert for, if the service app is not installed private fun showAlert(packageName:String) { 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(packageName) } .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(packageName:String) { val uri = Uri.parse("https://liveappstore.in/shareapp?$packageName= ") val goToMarket = Intent(Intent.ACTION_VIEW, uri) goToMarket.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?$packageName= ") ) ) } catch (exception: java.lang.Exception) { Toast.makeText(this, "App Not Found", Toast.LENGTH_SHORT).show() } } } Please do login to see details.