You can use the Android App Update Library to download the apk from a link, save it to external or internal storage, and then have the apk automatically installed.
implementation 'com.github.ismailukman.OTAUpdaterAndroid:updaterlib:1.0'
implementation 'com.github.ismailukman.OTAUpdaterAndroid:getapk:1.0'