Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workaround for Windows.ApplicationModel.Package limitations on Windows Phone?

I'm creating an About page for a Windows Runtime app targeting Windows Phone 8.1. On Windows 8.1 and Windows 10 UWP, it's all but trivial to display most of the basic information about an app by using an API called Windows.ApplicationModel.Package.

But, for reasons beyond my comprehension, Windows.ApplicationModel.Package is severely handicapped on Windows Phone. While things like Id, InstallDate and InstalledLocation have been available since Windows Phone 8, DisplayName, Description and PublisherDisplayName, the things users actually care about, are not. (The version information is present in Id, which is something at least.)

Are there any other ways to access this information reliably on Windows Phone, save from reading and parsing the manifest XML myself, or worse, hardcoding the values? I'd really rather not have to resort to either of those.

like image 301
BoltClock Avatar asked Sep 29 '15 17:09

BoltClock


1 Answers

I'm not sure that there is some API to get more details than what is available through the Package API but for the application display name and description, there is one trick that might help.

The content of those two strings can be localized. You need to declare them using the ms-resource: scheme in your manifest (say ms-resource:AppName for the application name) and then add the localized string to your strings resources.

enter image description here

This allows you to easily get the name and description from your code in addition to using a localized name/description for your app.

like image 63
Vincent Avatar answered Oct 01 '22 21:10

Vincent