Go Back   Android Forums > Android Development > Application Development > App Inventor
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old January 14th, 2011, 06:16 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jan 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Check phone for installed app?

Im putting together an app that has a function requiring an outside app to be downloaded ( if the user doesnt already have it) my question is, how would I code the activity to search the users phone for the installed app before auto downloading it? I dont want them to have to repeatedly download the app if its already on their phone. Thanks.

pizzato16 is offline  
Reply With Quote
Sponsors
Old January 24th, 2011, 05:54 AM   #2 (permalink)
Over Macho Grande?
 
alostpacket's Avatar
 
Join Date: Nov 2009
Location: NY
Posts: 7,299
 
Device(s): GalaxyNexus, Nexus1, Droid1, Eris, GalaxyTab10.1, Revue, Nexus7
Carrier: VZW...$$

Thanks: 4,196
Thanked 3,334 Times in 1,362 Posts
Default

Should be able to use this to see what is installed and compare the package name against what you're looking for
Code:
PackageManager pm = getPackageManager();                
List<ApplicationInfo> list = pm.getInstalledApplications(0);
                
for (int i=0; i< list.size(); i++) 
{
    ApplicationInfo appInfo = list.get(i);
    String packageName = appInfo.packageName;
    String appLabel = (String) pm.getApplicationLabel(appInfo);
    Drawable icon = pm.getApplicationIcon(appInfo);
}
alostpacket is offline  
Last edited by alostpacket; January 24th, 2011 at 06:03 AM.
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development > App Inventor
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:32 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.