determine whether new installation or update
<p>This is a tough one:
Lets say there is a SDK that was included in an app at some point. This app is available in the market for quite some time now, the SDK however is integrated since the newest version. So there are two ways for a customer to get to the app with SDK included:</p>

<ol>
<li>The person did not have the app before and downloads the newest version</li>
<li>The person already had the app installed in an older version without the SDK and updates to the new version with SDK</li>
</ol>

<p>Now when the app is opened for the first time, how can the SDK decide if the app was installed or updated?</p>

<p>Some things I thought of, without success:</p>

<ul>
<li><p>One could search for a file that was created when the app was installed and never altered from that point. Just look up the last-modified field and you know when the app was installed. I found the lib-file in data/data/ but it gets updated everytime the app gets updated, so there is no use. EDIT: The reason why it's import that the file has never been altered is that there is no way to access the file creation time, so we must be sure that last-modified == creation time</p></li>
<li><p>The sdk should be compatible with Android 1.6, so it's &lt; API 9 and I can't access the  PackageInfo.firstInstallTime field.</p></li>
<li><p>I don't think I have access to data/app in order to look at the apk iteself, but even when i could, the apk gets replaced everytime I update the app, so last-modified would give me the time of last update, not installation.</p></li>
</ul>

<p>Thanks for your help.</p>
