1

I have tried to install the application using the below code with Intent Api to install the app in wear os.

but its not working as its not showing unknown sources setting in wear-os.

also tried to find other solutions like,

  1. Installing it as a system app.(but as it's required to install at system installation so it can not be used).

    private fun installApp(){ Intent(Intent.ACTION_VIEW).apply { val file = File(filesDir,"app-debug.apk") val fileURI = FileProvider.getUriForFile(this@WearAuthActivity, "com.example.android.wearable.datalayer.provider", file) setDataAndType(fileURI,"application/vnd.android.package-archive") addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) startActivity(this) } }

Setting Dialog

After clicking on the setting button it's closing the current window as the unknown sources option is not available in os.

  • I haven't tried this, no idea if it works. But have you checked you have all the right permissions like android.permission.REQUEST_INSTALL_PACKAGES https://medium.com/@vishtech36/installing-apps-programmatically-in-android-10-7e39cfe22b86 – Yuri Schimke Jul 11 '22 at 19:23
  • Yes, The solution is available for Android applications but not available for Wear Os as There is no option available for an unknown source's permission. – Rajendra Dabhi Jul 13 '22 at 08:01

0 Answers0