Android: How to Send user to Install an App on Google Play Store and then Detect Install Start and progress - android

I'm looking to send a user to install an app from the Play Store, then once they click the install button I want to send them back to my app and show a progress bar and helpful info.
There is an app called Mistplay that does this. I know they detect the app installation, but I'm not sure if they are faking the app Install progress or not.
Any suggestions on this? I'm able to use intents to launch the play store market but I don't know how to detect the user clicking install in Play Store and sending the user back to my app or any of the steps past that.
Edit 1:
So I am able to detect when the installation finishes by including the target app in my Manifest Queries section + having this code (overly verbose for testing) in my main activity onCreate() + onDestroy unregister.
val filter = IntentFilter()
filter.addAction(Intent.ACTION_PACKAGE_ADDED)
filter.addAction(Intent.ACTION_PACKAGE_CHANGED)
filter.addAction(Intent.ACTION_PACKAGE_DATA_CLEARED)
filter.addAction(Intent.ACTION_PACKAGE_REMOVED)
filter.addAction(Intent.ACTION_PACKAGE_REPLACED)
filter.addAction(Intent.ACTION_PACKAGE_RESTARTED)
filter.addDataScheme("package")
registerReceiver(appInstallBroadcastReceiver, filter)

Related

Package installer dialog dismissible?

I am working so some demo app store. This app can detect deep link and install app from link. Before installing app user gets dialog (at least on Android 11 and 12) where he/she can click on Install or Cancel. Dialog is opened by PackageInstaller. I am using BroadcastReceiver to receive installation status (for example PackageInstaller.STATUS_PENDING_USER_ACTION). When user clicks on cancel or install or some error happens I receive a status.
But user can click outside of dialog. Dialog is smilingly dismissed and no status is reported back.
Is there way to get status? Or to make dialog non dismissible?
EDIT: dialog is create by PackageInstaller and I don’t have control it's properties.
Directly - no, but you can:
Track onResume event to detect when it's closed (it requires some filtering to avoid false detection);
Wrap it into some proxy activity and use startActivityForResult/onActivityResult to start that EXTRA_INTENT from STATUS_PENDING_USER_ACTION. resultCode is always 0, but you'll have an closing event at least.

How to run my app in background and listen to a hyperlink click event in from other apps or browsers

User installs my app. Once installed, it runs in the background forever unless user disables the run forever button in my app or uninstalls my app. Now, my app need to show a popup message once a hyperlink click event is triggered from anywhere in the android device. The click event might have been triggered from default messaging apps (like user click a link provided in a message he/she has received) or from some other apps in the device like twitter and facebook.
I want to know if there is any way I could achieve this? If yes, then please suggest me how to do it.
Any kind of help will be greatly appreciated.
Thanks!
The correct way to do this is with Intent Filter, not by having your app run constantly in the background.
Android Respond To URL in Intent
Then, you can program whatever behavior you would like to happen

Android app Text-to-Speech voice download notification for users

I have coded my Android app with "Text-to-Speech", voice "English-UK",
lg.setLanguage(Locale.UK)
So, when I install it's apk in a new mobile for testing, it starts downloading voice "English-UK", as shown below,
But, if the Internet isn't working, while accessing app for the first time, then the app's function to read aloud text won't work.
But, after it gets installed, the app works fine and their is no need to install the same language again.
What should I do in this case, so that users don't feel confused after downloading my app. How will they understand that the app needs "Voice-UK"? Should I notify them, if yes, then how,
Retry ?
Internet isn't working ?
A dialog box showing install English-UK?

What is the application flow after Google Store update?

I'm trying to understand what exactly happens after my app gets updated on the users devices.
As of course the 'MainActivity' isn't launched, I am wondering about the services.
I have one START_STICKY service and one which is not, does the START_STICKY auto-start after the update, what about the other ?
Is there any way of testing this behavior without waiting for a real Play Store update ?
I looked for a documentation regarding this issue but couldn't find anything related.
I just did a quick test. Not sure how close this is to an actual update on the Play Store or if it is in any way comparable, but here goes:
I have created a simple app that starts two services on the click of a button, one START_STICKY one START_NOT_STICKY.
Both services create a notification in onStartCommand() and show a version number.
I create one release APK, change the version number in Manifest and notification, and create another release APK. I've copied the two APKs onto the phone and disconnected the phone.
I've manually installed the first APK on the phone, started the app, clicked the button, two notifications appear. Installed the second APK, without starting the app. The two notifications disappeared and did not re-appear either. Opened the app, clicked the button, both notifications appeared with the new version number.
From this it appears that neither service will be restarted automatically after an app update.
You could also publish your app on Google Play as an Alpha version and test an update of your app without annoying general users.

Android - Google Play Store closes app for update and not opening it afterwards

I've got the following situation: My app is always running on my Android device. Because I want to be able to update it automatically I've activated Google Play Store auto-updates.
When Play store recognizes the new version I closes my app (what is ok) and updates it (great!). Unfortunately afterwards the app is not opened again.
Does anybody know a solution or has an idea how I can tell my app, the store or the device to open my app again?
BTW: My app starts on system start-up. So rebooting the devide would be a possibility as well. But how to I catch the update-finished event?
Thanks!
Edit: I build the app. It has a listener for the system startup so it is started on boot.
Post Honeycomb, apps have to be started manually by the user after installation or upgrade.
If you need your app to always run continuously, you would need to turn off auto update and manually update it yourself so that you can launch it manually after updating.

Categories

Resources