Can I retrieve a locale independent application label from the Android PackageManager?
I'm using PackageManager.getApplicationLabel(ApplicationInfo)
to retrieve application labels.
It looks like the label that is returned depends on the Locale set for the phone.
For instance with the music app I get "Music" in English, vs. "Musica" if I have my locale set to Spanish.
Is there a way to get the default application label (perhaps as defined in strings.xml
)?
I want to be able to retrieve an application label for each app that is independent of locale.
Asked by: Alford656 | Posted: 20-01-2022
Answer 1
There is no "application label for each app that is independent of locale" in Android. After all, in your own application, you will notice that you are not providing such a label.
I would flip the question around: what is there that you are putting in AndroidManifest.xml
that would meet your needs? Then, find out how to access that data from the PackageManager
.
Similar questions
Error while using PackageManager in Android
I got a problem in one Android Application which I am working in which I am getting error when I use PackageManager.
The Application is as follows:
Home.java
package com.main.home;
public class Home extends Activity
{
//onclicking a Button say "send"
send.onClickListener()
{
public void onClick() {
Intent i =new Intent();
i.setClassName(...
purpose Of using PackageManager in Android
What is PackageManager?
What is the purpose of using it ?
What do the following methods describe?:
getPackageManager()
getApplicationInfo()
getPackageName()
Can any one give detailed description as I could not get complete information in the Android developer guide.
And also one sample program that comprises all the methods.
android - Getting packages from PackageManager
I'm writing an app, that has a somewhat modular system. It has a core app, and some apps, that consist of a single Service, that implements the desired interface. I followed the guide to create the IPC communication. But now I need to get all the services, installed on the system, that my core app can wotk with. How do I...
android - PackageManager not showing installed Live Wallpapers
I am trying to load a list of all installed packages on the device, however, when I do this, any installed Live Wallpapers do not show up on the list... is there a way to fix this?
Here's my code:
final PackageManager pm = this.getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final ArrayList<ResolveInfo> list...
icon issue in packageManager android
I can't get icon in properManner, I use PackageManager:
Code example
::List<PackageInfo> applications = getPackageManager().getInstalledPackages(0);
for(PackageInfo info : applications){
Drawable icon = info.applicationInfo.loadIcon(getBaseContext());
}
if I print icon to
PackageManager issue in android
I can't get date in properManner, I use PackageManager:
Code example
::List<PackageInfo> applications = getPackageManager().getInstalledPackages(0);
for(PackageInfo info : applications){
// Drawable icon = info.applicationInfo.loadIcon(getBaseContext());
long firstInstalled = info.firstInstallTime;
long lastUpd...
package managers - Android PackageManager enable any application
I have developed an application in which I have enabled that any application which we have can be installed manually
But my problem is that I only want to enable my own package name and rather not any other application package name.
Here is the code I have used.
try {
PackageManager pm1 = getPackageManager();
pm1.setComponentEnabledSetting(new ComponentName("com.service",
"com.s...
android - API missing from PackageManager
It's weird I found PackageManager has public APIs like installPackage(...)/deletePackage(...) although in the comment it's marked as Hide, here http:/...
How do I read the Android Manifest without using PackageManager?
I am working on an Android application that requires more information than what is available in the PackageManager (such as intent filters). I have created a parser for reading the AndroidManifest file, but I cannot find the location of the AndroidManifest.xml for any installed application. The code I am using is:
int flags = PackageManager.GET_ACTIVITIES
...
android open PackageManager as a dialog
Hi I am opening another app from my app. I want to display that another app in a dialog box. So what are my options. I an trying the code below...
public class PictureGallery extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.abc.me");
st...
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android