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

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

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
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
sponsored links
Old January 24th, 2011, 05:54 AM   #2 (permalink)
Over Macho Grande?
alostpacket's Avatar
Join Date: Nov 2009
Location: NY
Posts: 7,873
Device(s): GlassXE, MotoX, N5, N4, N7'12, GNex, N1, SGT10.1, Revue, Xoom, Eris, OG Droid
Carrier: TMO

Thanks: 4,582
Thanked 3,563 Times in 1,522 Posts

Should be able to use this to see what is installed and compare the package name against what you're looking for
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

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 02:32 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.