Check in a website if an App is installed on tablet - c#

Is it possible to check for the existence of an app on a mobile device from a website?
Currently I am developing a website in C# that has to have the ability to choose whether to open the concerned app or to install it.

(I am assuming ASP.NET here as you didn't specify.)
Yes you can if the tablet sends the correct user agent string.
I have attached my current platform.browser file but this may have inaccuracies. The content is placed in the App_Browsers ASP.NET folder. The reason for the patch file is Microsoft's isn't always up-to date and have some missing information.
Android is a problem but v3 is tablet only 4 may not be and I haven't had time to correct this further.
To access this information use Request.Browser.Platform and Request.Browser.Version
<browsers>
<gateway id="PlatformWindowsPhone" parentID="Platform">
<identification>
<userAgent match="Windows Phone" />
</identification>
<capabilities>
<capability name="platform" value="Windows Phone" />
</capabilities>
</gateway>
<gateway id="PlatformIE11" parentID="PlatformWinnt">
<identification>
<userAgent match="Trident/7.0" />
<userAgent match="rv:11.0" />
</identification>
<capabilities>
<capability name="browser" value="IE" />
<capability name="version" value="11.0" />
</capabilities>
</gateway>
<gateway id="PlatformiPad" parentID="Platform">
<identification>
<userAgent match="iPad" />
</identification>
<capabilities>
<capability name="platform" value="iPad" />
</capabilities>
</gateway>
<gateway id="PlatformiPhone" parentID="Platform">
<identification>
<userAgent match="iPhone" />
</identification>
<capabilities>
<capability name="platform" value="iPhone" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid" parentID="Platform">
<identification>
<userAgent match="Android" />
</identification>
<capabilities>
<capability name="platform" value="Android" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid50" parentID="Platform">
<identification>
<userAgent match="Android 5\.0" />
</identification>
<capabilities>
<capability name="version" value="5.0" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid45" parentID="Platform">
<identification>
<userAgent match="Android 4\.5" />
</identification>
<capabilities>
<capability name="version" value="4.5" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid44" parentID="Platform">
<identification>
<userAgent match="Android 4\.4" />
</identification>
<capabilities>
<capability name="version" value="4.4" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid43" parentID="Platform">
<identification>
<userAgent match="Android 4\.3" />
</identification>
<capabilities>
<capability name="version" value="4.3" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid42" parentID="Platform">
<identification>
<userAgent match="Android 4\.2" />
</identification>
<capabilities>
<capability name="version" value="4.2" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid41" parentID="Platform">
<identification>
<userAgent match="Android 4\.1" />
</identification>
<capabilities>
<capability name="version" value="4.1" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid40" parentID="Platform">
<identification>
<userAgent match="Android 4\.0" />
</identification>
<capabilities>
<capability name="version" value="4.0" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid30" parentID="Platform">
<identification>
<userAgent match="Android 3\.0" />
</identification>
<capabilities>
<capability name="version" value="3.0" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid23" parentID="Platform">
<identification>
<userAgent match="Android 2\.3" />
</identification>
<capabilities>
<capability name="version" value="2.3.3" />
</capabilities>
</gateway>
<gateway id="PlatformAndroid22" parentID="Platform">
<identification>
<userAgent match="Android 2\.2" />
</identification>
<capabilities>
<capability name="version" value="2.2" />
</capabilities>
</gateway>
<gateway id="PlatformWinMacOs" parentID="Platform">
<identification>
<userAgent match="Macintosh" />
</identification>
<capabilities>
<capability name="platform" value="Mac OS" />
</capabilities>
</gateway>
<gateway id="PlatformWinXP" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 5\.1" />
</identification>
<capabilities>
<capability name="platform" value="Windows XP" />
</capabilities>
</gateway>
<gateway id="PlatformWin2003" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 5\.2" />
</identification>
<capabilities>
<capability name="platform" value="Windows 2003" />
</capabilities>
</gateway>
<gateway id="PlatformWinVista" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 6\.0" />
</identification>
<capabilities>
<capability name="platform" value="Vista" />
</capabilities>
</gateway>
<gateway id="PlatformWin7" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 6\.1" />
</identification>
<capabilities>
<capability name="platform" value="Windows 7" />
</capabilities>
</gateway>
<gateway id="PlatformWin8" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 6\.2" />
</identification>
<capabilities>
<capability name="platform" value="Windows 8" />
</capabilities>
</gateway>
<gateway id="PlatformWin81" parentID="PlatformWinnt">
<identification>
<userAgent match="Windows NT 6\.3" />
</identification>
<capabilities>
<capability name="platform" value="Windows 8.1" />
</capabilities>
</gateway>
</browsers>
(I have posted this as a community wiki so the information can be improved)

The short answer is "no, you can't check what a user has installed on their tablet."
However, you can user agent sniffing to serve different links and if your app registers a Custom URL scheme, then you can have a link that would open an app directly. On your website, the link might point to: YourApp://something. You can at least then have the option for people to launch the app from the website (although it's impossible to tell if they have the app installed or not).
That's the best you can do and this is by design. It would be pretty messed up if websites were allowed to see what was on our devices.
EDIT: This is supported on iOS, Android and Windows Phone 8.
EDIT2: Additionally, a link to YourApp://something will (at least on Windows Phone, which is all I have handy, but I suspect on iOS and Android as well) prompt the user to install the app instead if they don't have it already.

Related

Xamarin android debugging taking a lot of time?

I am creating an application in Xamarin Android, the problem is my application Takes a lot of time(around two to three minutes) for debugging even in second or plus attempt and even when I don't do any changes. I have enabled fast deployment in android options and set my Linker settings to none and attached a screen shot here for detailed review of my settings.
and here is my androidmanifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.finalproject_pu" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<!-- Google Maps for Android v2 requires OpenGL ES v2 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<!-- Permission to receive remote notifications from Google Play Services -->
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="com.companyname.finalproject_pu.permission.MAPS_RECEIVE" />
<permission android:name="com.companyname.finalproject_pu.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<application android:name="android.app.Application" android:allowBackup="true" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:debuggable="true" android:extractNativeLibs="true" android:icon="#drawable/appiconfinal" android:label="Problem Update" android:roundIcon="#drawable/appiconfinal" android:supportsRtl="true" android:theme="#style/AppTheme" android:usesCleartextTraffic="true">
<!-- Necessary for apps that target Android 9.0 or higher -->
<uses-library android:name="org.apache.http.legacy" android:required="false" />
<provider android:name="androidx.core.content.FileProvider" android:authorities="com.companyname.finalproject_pu.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
</provider>
<activity android:name="crc64830617e3579ebeb9.CreateIssue" android:label="CreateIssue" />
<activity android:name="crc64830617e3579ebeb9.createissue2" android:label="createissue2" />
<activity android:name="crc64830617e3579ebeb9.createissue3" android:label="createissue3" />
<activity android:name="crc64830617e3579ebeb9.createissue4" android:label="createissue4" />
<activity android:name="crc64830617e3579ebeb9.createissue5" android:label="createissue5" />
<activity android:name="crc64830617e3579ebeb9.createissue6" android:label="createissue6" />
<activity android:name="crc64830617e3579ebeb9.EmailVerifyActivity" android:label="EmailVerifyActivity" />
<activity android:name="crc64830617e3579ebeb9.ForgotPassActivity" android:label="ForgotPassActivity" />
<activity android:name="crc64830617e3579ebeb9.FundsActivity" android:label="FundsActivity" />
<activity android:name="crc64830617e3579ebeb9.LocationActivity" android:label="LocationActivity" />act
<activity android:name="crc64830617e3579ebeb9.LocationsActivity" android:label="LocationsActivity" />
<activity android:name="crc64830617e3579ebeb9.Login" android:label="Login" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="crc64830617e3579ebeb9.MainActivity" android:label="#string/app_name" android:theme="#style/AppTheme" >
</activity>
<activity android:name="crc64830617e3579ebeb9.testActivity" android:label="testActivity">
</activity>
<activity android:name="crc64830617e3579ebeb9.MapActivity" android:label="MapActivity"/>
<activity android:name="crc64830617e3579ebeb9.Newpassword" android:label="Newpassword" />
<activity android:name="crc64830617e3579ebeb9.NotificationsActivity" android:label="NotificationsActivity" />
<activity android:name="crc64830617e3579ebeb9.OTPVerify" android:label="OTPVerify" />
<activity android:name="crc64830617e3579ebeb9.PhotoUploading" android:label="PhotoUploading" />
<activity android:name="crc64830617e3579ebeb9.Register1Activity" android:label="Register1Activity" />
<activity android:name="crc64830617e3579ebeb9.Register2Activity" android:label="Register2Activity" />
<activity android:name="crc64830617e3579ebeb9.Register3Activity" android:label="Register3Activity" />
<activity android:name="crc64830617e3579ebeb9.SettingsActivity" android:label="SettingsActivity" />
<activity android:name="crc644f28929abffd59e1.HomeActivity" android:label="HomeActivity" />
<activity android:name="crc646957603ea1820544.MediaPickerActivity" android:configChanges="orientation|screenSize|uiMode" />
<service android:name="crc64396a3fe5f8138e3f.KeepAliveService" />
<receiver android:name="crc64a0e0a82d0db9a07d.BatteryBroadcastReceiver" android:enabled="true" android:exported="false" android:label="Essentials Battery Broadcast Receiver" />
<receiver android:name="crc64a0e0a82d0db9a07d.EnergySaverBroadcastReceiver" android:enabled="true" android:exported="false" android:label="Essentials Energy Saver Broadcast Receiver" />
<receiver android:name="crc64a0e0a82d0db9a07d.ConnectivityBroadcastReceiver" android:enabled="true" android:exported="false" android:label="Essentials Connectivity Broadcast Receiver" />
<provider android:name="xamarin.essentials.fileProvider" android:authorities="com.companyname.finalproject_pu.fileProvider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/xamarin_essentials_fileprovider_file_paths" />
</provider>
<provider android:name="mono.MonoRuntimeProvider" android:authorities="com.companyname.finalproject_pu.mono.MonoRuntimeProvider.__mono_init__" android:exported="false" android:initOrder="1999999999" />
<!-- suppress ExportedReceiver -->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.com.companyname.finalproject_pu" />
</intent-filter>
</receiver>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:exported="false" android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<!-- suppress ExportedReceiver -->
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyD8-hqAD2UZX-8VSVoxOpabG2zW1RnmfzE"/>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<!--FCM RECEIVER ENDS HERE-->
</application>
</manifest>

UWP C# FullTrustProcess

I'm new to UWP app and after 2 days of research I come to you…
I'm trying to run an executable from an uwp app so I looked at FullTrustProcess.
I added "Windows Desktop Extension for the UWP" to my references, my exe is in "Assets" folder and my manifest looks like this
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
IgnorableNamespaces="uap mp rescap desktop">
<Identity
Name="22c57925-bd2a-4ebf-97e9-7a860ef17b3c"
Publisher="CN=charl"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="22c57925-bd2a-4ebf-97e9-7a860ef17b3c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>CustomCortanaCommands</DisplayName>
<PublisherDisplayName>charl</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="CustomCortanaCommands.App">
<uap:VisualElements
DisplayName="CustomCortanaCommands"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="CustomCortanaCommands"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="Assets\shutdown.exe">
<desktop:FullTrustProcess>
<desktop:ParameterGroup GroupId="SyncGroup" Parameters="/Sync"/>
<desktop:ParameterGroup GroupId="OtherGroup" Parameters="/Other"/>
</desktop:FullTrustProcess>
</desktop:Extension>
</Extensions>
</Application>
</Applications>
</Package>
Visual Studio keep telling me that this command does not exist in the current namespace
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
What i'm doing wrong ?? Please help me, it's frustrating to try to run an exe for 2 days...

GetFilesAsync() returns 0

I need the app to be able to list jpg files from folder "Photos".
I am stuck on reading jpg files from sd card on windows phone device.
What is done in order to resolve the problem:
created function to read files into collection. The function was
taken from basic sample called "RouteMapper"
ListBox to holding the list of files
permission to use sd card and jpg files
Function:
Photos = new ObservableCollection<ExternalStorageFile>();
private async void scanExternalStorage_Run()
{
// Clear the collection bound to the page.
Photos.Clear();
// Connect to the current SD card.
ExternalStorageDevice _sdCard = (await ExternalStorage.GetExternalStorageDevicesAsync()).FirstOrDefault();
// If the SD card is present, add GPX files to the Routes collection.
if (_sdCard != null)
{
try
{
// Look for a folder on the SD card named Routes.
ExternalStorageFolder photosFolder = await _sdCard.GetFolderAsync("Photos");
// Get all files from the Routes folder.
IEnumerable<ExternalStorageFile> photosFiles = await photosFolder.GetFilesAsync();
// Add each GPX file to the Routes collection.
foreach (ExternalStorageFile esf in photosFiles)
{
if (esf.Path.EndsWith(".jpg"))
{
Photos.Add(esf);
}
}
}
catch (FileNotFoundException)
{
// No Routes folder is present.
MessageBox.Show("The Routes folder is missing on your SD card. Add a Routes folder containing at least one .GPX file and try again.");
}
}
else
{
// No SD card is present.
MessageBox.Show("The SD card is mssing. Insert an SD card that has a Routes folder containing at least one .GPX file and try again.");
}
}
ListBox:
<ListBox
x:Name="jpgFilesListBox"
ItemsSource="{Binding Photos}"
SelectionChanged="jpgFilesListBox_SelectionChanged"
>
<!-- Each ListBox item is bound to the name of each GPX file -->
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock
Margin="0, 12, 0, 0"
Text="{Binding Name}"
Style="{StaticResource PhoneTextTitle2Style}"
/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
WMAppManifest.xml:
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
<Capability Name="ID_CAP_REMOVABLE_STORAGE" />
<Capability Name="ID_CAP_MAP" />
</Capabilities>
<Extensions>
<FileTypeAssociation TaskID="_default" Name="JPG" NavUriFragment="fileToken=%s">
<SupportedFileTypes>
<FileType ContentType="application/jpg">.jpg</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extensions>
Debugging revealed photosFolder.GetFilesAsync() returns 0.
While I definately have files in the "Photos" folder.
RouteMapper works fine and returns list of gpx files.
PS: I use emulator 8.1
Update: just for information. GetFolderAsync works and returns object that contains "D:\Photos"
Update2: Adding manifest files. I've got two of them after creating clean Windows Phone SilverLight blank App.
WMAppManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2014/deployment" AppPlatformVersion="8.1">
<DefaultLanguage xmlns="" code="en-US" />
<App xmlns="" ProductID="{dc1cb15e-1c8d-4635-a85e-e414e89455fb}" Title="CameraGPS" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CameraGPS author" Description="Sample description" SDOptOut="false" BackUpOptOut="false" Publisher="CameraGPS" PublisherID="{4d13b339-1a9f-4a55-ba44-fe10cf0c0420}">
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
<Capability Name="ID_CAP_REMOVABLE_STORAGE" />
<Capability Name="ID_CAP_MAP" />
<Capability Name="ID_CAP_MEDIALIB_PHOTO" />
</Capabilities>
<Tasks>
<DefaultTask Name="_default" NavigationPage="MainPage.xaml" ActivationPolicy="Resume" />
</Tasks>
<Tokens>
<PrimaryToken TokenID="CameraGPSToken" TaskName="_default">
<TemplateFlip>
<SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI>
<Count>0</Count>
<BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI>
<Title>CameraGPS</Title>
<BackContent>
</BackContent>
<BackBackgroundImageURI>
</BackBackgroundImageURI>
<BackTitle>
</BackTitle>
<DeviceLockImageURI>
</DeviceLockImageURI>
<HasLarge>
</HasLarge>
</TemplateFlip>
</PrimaryToken>
</Tokens>
<Extensions>
<FileTypeAssociation TaskID="_default" Name="jpg" NavUriFragment="fileToken=%s">
<SupportedFileTypes>
<FileType ContentType="image/jpg">.jpg</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extensions>
<ScreenResolutions>
<ScreenResolution Name="ID_RESOLUTION_WVGA" />
<ScreenResolution Name="ID_RESOLUTION_WXGA" />
<ScreenResolution Name="ID_RESOLUTION_HD720P" />
</ScreenResolutions>
</App>
</Deployment>
Package.appxmanifest:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="5b897434-732a-4f41-a110-db75375561c9" Publisher="CN=Qet" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="dc1cb15e-1c8d-4635-a85e-e414e89455fb" PhonePublisherId="4d13b339-1a9f-4a55-ba44-fe10cf0c0420" />
<Properties>
<DisplayName>CameraGPS</DisplayName>
<PublisherDisplayName>Qet</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="AGHost.exe" EntryPoint="MainPage.xaml">
<m3:VisualElements DisplayName="CameraGPS" Square150x150Logo="Assets\SquareTile150x150.png" Square44x44Logo="Assets\Logo.png" Description="CameraGPS" ForegroundText="light" BackgroundColor="#464646">
<m3:DefaultTile Square71x71Logo="Assets\SquareTile71x71.png">
</m3:DefaultTile>
<m3:SplashScreen Image="Assets\SplashScreen.png" />
</m3:VisualElements>
<Extensions>
<Extension Category="windows.fileTypeAssociation">
<FileTypeAssociation Name="jpg">
<DisplayName>Jpg</DisplayName>
<SupportedFileTypes>
<FileType ContentType="image/jpg">.jpg</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extension>
<Extension Category="windows.accountPictureProvider" />
<Extension Category="windows.backgroundTasks" EntryPoint="AgHost.BackgroundTask">
<BackgroundTasks>
<Task Type="systemEvent" />
<m2:Task Type="location" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="removableStorage" />
<Capability Name="picturesLibrary" />
<DeviceCapability Name="location" />
<DeviceCapability Name="webcam" />
</Capabilities>
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>AgHostSvcs.dll</Path>
<ActivatableClass ActivatableClassId="AgHost.BackgroundTask" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>
</Package>

How to get permission to rename a StorageFile on the Desktop

I want my code to rename files on my Desktop, but I do not have permission to edit files on my Desktop. How do I get the necessary permission?
My code:
public async Task RenameFile(fileLocation, newName)
{
try
{
StorageFile bkpFile = await StorageFile.GetFileFromPathAsync(fileLocation);
await bkpFile.RenameAsync(newName);
}
catch { /* Eat error */ }
}
Permissions set in my Package.Appxmanifest file:
<Capabilities>
<Capability Name="picturesLibrary" />
<Capability Name="documentsLibrary" />
<Capability Name="internetClient" />
<Capability Name="removableStorage" />
<Capability Name="enterpriseAuthentication" />
<Capability Name="videosLibrary" />
<Capability Name="privateNetworkClientServer" />
<DeviceCapability Name="location" />
<DeviceCapability Name="webcam" />
<DeviceCapability Name="microphone" />
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any">
<m2:Function Type="name:serialPort" />
</m2:Device>
</m2:DeviceCapability>
</Capabilities>
EDIT: I also need permission to rename files in attached devices, such as SD cards and thumb drives.

ASP.NET Site Error on Different Server

I have a a project that have been deployed on a server. Everything is okay ( I can access it using multiple browser) But different case with IE 11.
What make it weird is, I can access my localhost using IE 11 which build on the same project, but once I deploy it, my IE 11 doesnt allow me to login and redirect me to error page, also the link are broken (other browser include IE 9 are fine).
I use IE 11.0.9, Windows 7, and .Net Framework 4 on my Lcoal and
on my server I use Windows Server R2 Data Center and .Net framework 4 too.
What I did so far is:
Copy paste my ie.browser file on .Net config directory (local) to server, (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config)
run aspnet_regbrowsers -i
Restart IIS.
Here's my ie.browser that exist on my pc (local)
<browsers>
<browser id="IE" parentID="Mozilla">
<identification>
<userAgent match="MSIE (?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" />
<userAgent nonMatch="IEMobile" />
</identification>
<capture>
<userAgent match="Trident/(?'layoutVersion'\d+)" />
</capture>
<capabilities>
<capability name="browser" value="IE" />
<capability name="layoutEngine" value="Trident" />
<capability name="layoutEngineVersion" value="${layoutVersion}" />
<capability name="extra" value="${extra}" />
<capability name="isColor" value="true" />
<capability name="letters" value="${letters}" />
<capability name="majorversion" value="${major}" />
<capability name="minorversion" value="${minor}" />
<capability name="screenBitDepth" value="8" />
<capability name="type" value="IE${major}" />
<capability name="version" value="${version}" />
</capabilities>
</browser>
<!-- Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4325) -->
<browser id="IE6to9" parentID="IE">
<identification>
<capability name="majorversion" match="[6-9]" />
</identification>
<capabilities>
<capability name="ecmascriptversion" value="3.0" />
<capability name="jscriptversion" value="5.6" />
<capability name="javascript" value="true" />
<capability name="javascriptversion" value="1.5" />
<capability name="msdomversion" value="${majorversion}.${minorversion}" />
<capability name="w3cdomversion" value="1.0" />
<capability name="ExchangeOmaSupported" value="true" />
<capability name="activexcontrols" value="true" />
<capability name="backgroundsounds" value="true" />
<capability name="cookies" value="true" />
<capability name="frames" value="true" />
<capability name="javaapplets" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="supportsFileUpload" value="true" />
<capability name="supportsMultilineTextBoxDisplay" value="true" />
<capability name="supportsMaintainScrollPositionOnPostback" value="true" />
<capability name="supportsVCard" value="true" />
<capability name="supportsXmlHttp" value="true" />
<capability name="tables" value="true" />
<capability name="supportsAccessKeyAttribute" value="true" />
<capability name="tagwriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="vbscript" value="true" />
</capabilities>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) -->
<browser id="IE7" parentID="IE6to9">
<identification>
<capability name="majorversion" match="7" />
</identification>
<capabilities>
<capability name="jscriptversion" value="5.7" />
</capabilities>
</browser>
<!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) -->
<browser id="IE8" parentID="IE6to9">
<identification>
<capability name="majorversion" match="8" />
</identification>
<capabilities>
<capability name="jscriptversion" value="6.0" />
</capabilities>
</browser>
<gateway id="IEbeta" parentID="IE">
<identification>
<capability name="letters" match="^([bB]|ab)" />
</identification>
<capture>
</capture>
<capabilities>
<capability name="beta" value="true" />
</capabilities>
</gateway>
</browsers>
Still not working though.
Does anyone have a better approach to this case.
Update: I found error in:
WebForm_DoPostBackWithOptions is undefined
Your IE detection doesn't work properly for IE11, which doesn't have the MSIE token. See http://blogs.msdn.com/b/ieinternals/archive/2013/09/21/internet-explorer-11-user-agent-string-ua-string-sniffing-compatibility-with-gecko-webkit.aspx for the ASP.NET updates that will properly detect IE11 and allow ASP.NET to send JavaScript to the client.
(You probably need to remove your custom IE browser definition file)

Categories

Resources