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,
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) } }
After clicking on the setting button it's closing the current window as the unknown sources option is not available in os.