Re: [android-developers] How to get the version of installed apps

2010-06-25 Thread Nando Android
Perfect, thanks! I had the VersionName before.

On Fri, Jun 25, 2010 at 3:41 PM, Mark Murphy wrote:

> On Fri, Jun 25, 2010 at 5:36 PM, Nando Android 
> wrote:
> > How can I get the version information of the current installed apps on my
> > phone.
> > If I do :
> > PackageManager packageManager = getPackageManager();
> > List packs = packageManager.getInstalledPackages(0);
> > int size = packs.size();
> > apps += "\nTotal apps = "+ size+"\n";
> > for (int i = 0; i < size; i++)
> > {
> > PackageInfo p = packs.get(i);
> > apps += "\nApp name: " +
> > p.applicationInfo.loadLabel(packageManager).toString();
> > apps += "\nPackage name: " + p.packageName;
> > apps += "\nVersion name: " + p.versionName;
> > apps += "\n";
> > }
> > tv.setText("Installed apps:\n"+apps);
> > I get all the apps currently installed.
> > I wasn't able to figure out how to extract their correspondent version
> > information.
>
> Use p.versionName and p.versionCode.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6
> Available!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to get the version of installed apps

2010-06-25 Thread Mark Murphy
On Fri, Jun 25, 2010 at 5:36 PM, Nando Android  wrote:
> How can I get the version information of the current installed apps on my
> phone.
> If I do :
> PackageManager packageManager = getPackageManager();
> List packs = packageManager.getInstalledPackages(0);
> int size = packs.size();
> apps += "\nTotal apps = "+ size+"\n";
> for (int i = 0; i < size; i++)
> {
> PackageInfo p = packs.get(i);
> apps += "\nApp name: " +
> p.applicationInfo.loadLabel(packageManager).toString();
> apps += "\nPackage name: " + p.packageName;
> apps += "\nVersion name: " + p.versionName;
> apps += "\n";
> }
> tv.setText("Installed apps:\n"+apps);
> IĀ get all the apps currently installed.
> I wasn't able to figure out how to extract their correspondent version
> information.

Use p.versionName and p.versionCode.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6
Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to get the version of installed apps

2010-06-25 Thread Nando Android
Hello all,

How can I get the version information of the current installed apps on my
phone.

If I do :

PackageManager packageManager = getPackageManager();
List packs = packageManager.getInstalledPackages(0);
int size = packs.size();
apps += "\nTotal apps = "+ size+"\n";
for (int i = 0; i < size; i++)
{
PackageInfo p = packs.get(i);
apps += "\nApp name: " +
p.applicationInfo.loadLabel(packageManager).toString();
apps += "\nPackage name: " + p.packageName;
apps += "\nVersion name: " + p.versionName;
apps += "\n";
 }
tv.setText("Installed apps:\n"+apps);

I get all the apps currently installed.

I wasn't able to figure out how to extract their correspondent version
information.

Any suggestions?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en