Search code examples
androidinstallationcustomizationcustom-installation

How pass params to my app when installed from local files or from Google Play?


I am making an app that shows a personalized greeting message to users.

For Example: If I send my app by bluetooth (or I send the app by email to be installed) to X person to congratulate him on the day of his birthday, once the person installed the app a message should appear saying "Congratulations X".

Edit: I found a solution when the app is installed from Google Play in Pass param to app when installed from Google Play

But if the scenario is different, because not all the persons who will receive the app can access Google Play.

@mes posted an answer where he suggested to use AccountManager. But what happens if there is no registered account in the device or the device not have internet connection?

By example, if I send the app to X (X installs the app and will see his congratulation message "Congratulations X") and X wants to congratulate his friend Y (with the message "Congratulations Y") X copies the app to the SD of his friend's device and expects that when Y installs the app, Y can see the message "Congratulation Y".

It is the same app but I need to pass the name of the person who is going to be congratulated while the application is being installed, with this each person could have his congratulation message with his name once the app is open.

Is there a way to achieve this?


Solution

  • I can suggest another solution for greeting message, you can get registered accounts of the user, and then use one of their names, for example Google account's name or Facebook account's name. Check this link, this can be helpful AccountManager