Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8835217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:12:35+00:00 2026-06-14T09:12:35+00:00

Possible Duplicate: How to know an application is installed from google play or side-load?

  • 0

Possible Duplicate:
How to know an application is installed from google play or side-load?

We have an application that is portable between several mobile platforms. It provides it’s own update mechanism that is needed to fetch the rather large data the application uses. Now this mechanism can also download updated versions of the application. If the user manually installed an .apk, we would like to ship new version to them via this mechanism, but if they installed it from android market (or any other market), the market application will take care of the upgrade and doing it ourselves would conflict with it.

So is it possible to detect, from within the application, whether the application was installed via market or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:12:36+00:00Added an answer on June 14, 2026 at 9:12 am

    When installed from Google Play, you will receive a com.android.vending.INSTALL_REFERRER broadcast during the install process. Simply create a broadcast receiver for this, and have a boolean value in your SharedPreferences along the lines of fromGooglePlay, which you can set to true in the receiver.

    However, I do not think you can have similar receivers for other app stores, like Amazon’s.

    EDIT 1:

    As @zapl pointed out in the comments, this will not work on Android 3.0 and above, as apps that have not been launched at least once are not eligible to receive broadcasts etc.

    However, you can try an alternate solution:

    In you app, have a constant boolean somewhere, something like GOOGLE_PLAY_BUILD. When building an apk for Google Play, set this to true, and when building an apk for manual distribution, set this to false. Then simply check it’s value at runtime, and act accordingly.

    EDIT 2:

    To address your concerns about rooted devices distributing your apps, here is a more elaborate system.

    Each device has a unique ANDROID_ID (though apparently multi users on 4.2 have multiple ones, despite what the documentation says). Essentially you just need a unique device ID, so even a MAC address will do.

    Have a table on a webserver to store the unique ID, whether or not you received the Google Play broadcast and the value of the Google Play flag. When the app is launched for the first time, add these details for that device to the table.

    When the app is launched thereafter, simply check if all three of the details match a copy stored locally. If a user gets the app from a rooted user and installs the it, the Google Play flag will seem to match, however the install referrer part won’t. Sadly, this will only work on pre honeycomb devices.

    Or in a slightly trust based system, you could simply ask the user whether they installed it manually or from Google Play. If you mention it’s to select the update method, and not to prosecute them for installing it from outside Google Play, I have a feeling they’ll be happy to tell the truth.

    EDIT 3

    As @Jan pointed out in the comments, there seems to be a getInstallerPackageName() method in PackageManager which can be used for this purpose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Difference between Activity Context and Application Context I want to know the
Possible Duplicate: internationalization of an iPhone Application I know that its possible to create
Possible Duplicate: Checking if .NET is installed from the command line I have a
Possible Duplicate: How to know if Process.Start() is successful? I have a process similar
Possible Duplicate: Standard way to remove multiple elements from a dataframe I know in
Possible Duplicate: How to know the apps installed in iPhone Hi... I am developing
Possible Duplicate: Using VFP/Neon for a Visual Studio 2008 application I have built a
Possible Duplicate: What Web Application Framework for Delphi is recommended? We have a Delphi
Possible Duplicate: python: how to encrypt a file? I'm trying to make application that
Possible Duplicate: Procedure to submit iPhone application to App Store? I know this question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.