Hi, you could use PackageInfo class to retrieve some information from
Manifest.xml.
Try to use this code:
/**
* Gets the software version retrieved from the Manifest.
*/
private String getSoftwareVersion() {
try {
PackageInfo packageInfo = getPackageManager
().getPackageInfo(getPackageName(), 0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Package name not found", e);
};
}
On Aug 16, 4:30 am, engin <enginarsla...@gmail.com> wrote:
> Hi, you could use PackageInfo class to retrieve some information from
> Manifest.xml.
> Try to use this code:
> /**
> * Gets the software version retrieved from the Manifest.
> */
> private String getSoftwareVersion() {
> try {
> PackageInfo packageInfo = getPackageManager
> ().getPackageInfo(getPackageName(), 0);
> return packageInfo.versionName;
> } catch (PackageManager.NameNotFoundException e) {
> Log.e(TAG, "Package name not found", e);
> };
> }
> On Aug 16, 4:30 am, engin <enginarsla...@gmail.com> wrote:
> > Hi, can I get version from .apk file. I tried to open
> > androidmanifest.xml but I realized that xml files are destructed when
> > apk created.
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
> If you want this from the desktop, use "aapt dump badging <path/to/apk>".
> On Mon, Aug 17, 2009 at 7:24 AM, Greivin Lopez <greivin.lo...@gmail.com>wrote:
> > Hi, you could use PackageInfo class to retrieve some information from
> > Manifest.xml.
> > Try to use this code:
> > /**
> > * Gets the software version retrieved from the Manifest.
> > */
> > private String getSoftwareVersion() {
> > try {
> > PackageInfo packageInfo = getPackageManager
> > ().getPackageInfo(getPackageName(), 0);
> > return packageInfo.versionName;
> > } catch (PackageManager.NameNotFoundException e) {
> > Log.e(TAG, "Package name not found", e);
> > };
> > }
> > On Aug 16, 4:30 am, engin <enginarsla...@gmail.com> wrote:
> > > Hi, can I get version from .apk file. I tried to open
> > > androidmanifest.xml but I realized that xml files are destructed when
> > > apk created.
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.- Hide quoted text -