Friday, February 25, 2011

Re: [android-developers] Finding Specific Installed Applications at Run Time

Basically you can't do this in a way that will consistently work.

On Thu, Feb 24, 2011 at 11:44 PM, argongold <argongold10@gmail.com> wrote:
Hi,

I am working on an application, for which I have to display icons of
specific applications such as "Email" , "Browser" and "Alarm Clock" .
Currently I have defined a String Array with the Title names of these
applications as shown below.

 private final String[] firstAppNames = new String[] {
                        "Phone",
                        "Messaging",
                        "Contacts",
                        "Browser",
                        "Email",
                        "Music",
                        "Camera",
                        "Gallery",
                        "Alarm Clock",
                        "Settings"
                        };

At run time I get a full list of installed application on the device
and compare the Title of each installed application with strings
defined in string array above and if the result of comparison is true
then I collect the icon information for display from corresponding
installed application.

This works fine as long as device is using English language. But when
the device's Language is set to other language such as "Chinese"  the
run time title string comparison fails for all the strings defined
above in string array.

Is there a better way , which is not  language dependent to get the
specific applications . I haven't tried using the full package name.

Do you have better suggestion for it?

Thanks in advance
argongold

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Dianne Hackborn
Android framework engineer
hackbod@android.com

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.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment