Detect whether Dropbox is installed in a UWP app
up vote
1
down vote
favorite
During the first start of my app, I would like to give the user the ability to grant access to certain sync apps like Dropbox.
Is there any way my UWP App can detect that Dropbox is installed?
I could then prompt the user to provide access to that folder via FolderPicker....
uwp dropbox-sdk
add a comment |
up vote
1
down vote
favorite
During the first start of my app, I would like to give the user the ability to grant access to certain sync apps like Dropbox.
Is there any way my UWP App can detect that Dropbox is installed?
I could then prompt the user to provide access to that folder via FolderPicker....
uwp dropbox-sdk
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
During the first start of my app, I would like to give the user the ability to grant access to certain sync apps like Dropbox.
Is there any way my UWP App can detect that Dropbox is installed?
I could then prompt the user to provide access to that folder via FolderPicker....
uwp dropbox-sdk
During the first start of my app, I would like to give the user the ability to grant access to certain sync apps like Dropbox.
Is there any way my UWP App can detect that Dropbox is installed?
I could then prompt the user to provide access to that folder via FolderPicker....
uwp dropbox-sdk
uwp dropbox-sdk
edited yesterday
Michael Phillips
6822517
6822517
asked 2 days ago
J. H.
348
348
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Determining whether Dropbox is installed isn't possible from a UWP app. Or, at least, is probably not the recommended method of access to Dropbox from a UWP app.
On Windows the user's Dropbox folder location is stored in %localappdata%Dropboxinfo.json so in WPF/WinForms/Console applications you can use something like:-
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropboxinfo.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Due to lack of access to %localappdata% this method falls at the first hurdle in a UWP app.
This leaves you either prompting the user for the Dropbox folder location without knowing whether it's installed or using the Dropbox SDK to connect to Dropbox and access files independently of any copy the user already has locally via the Dropbox client.
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Determining whether Dropbox is installed isn't possible from a UWP app. Or, at least, is probably not the recommended method of access to Dropbox from a UWP app.
On Windows the user's Dropbox folder location is stored in %localappdata%Dropboxinfo.json so in WPF/WinForms/Console applications you can use something like:-
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropboxinfo.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Due to lack of access to %localappdata% this method falls at the first hurdle in a UWP app.
This leaves you either prompting the user for the Dropbox folder location without knowing whether it's installed or using the Dropbox SDK to connect to Dropbox and access files independently of any copy the user already has locally via the Dropbox client.
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
add a comment |
up vote
1
down vote
accepted
Determining whether Dropbox is installed isn't possible from a UWP app. Or, at least, is probably not the recommended method of access to Dropbox from a UWP app.
On Windows the user's Dropbox folder location is stored in %localappdata%Dropboxinfo.json so in WPF/WinForms/Console applications you can use something like:-
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropboxinfo.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Due to lack of access to %localappdata% this method falls at the first hurdle in a UWP app.
This leaves you either prompting the user for the Dropbox folder location without knowing whether it's installed or using the Dropbox SDK to connect to Dropbox and access files independently of any copy the user already has locally via the Dropbox client.
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Determining whether Dropbox is installed isn't possible from a UWP app. Or, at least, is probably not the recommended method of access to Dropbox from a UWP app.
On Windows the user's Dropbox folder location is stored in %localappdata%Dropboxinfo.json so in WPF/WinForms/Console applications you can use something like:-
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropboxinfo.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Due to lack of access to %localappdata% this method falls at the first hurdle in a UWP app.
This leaves you either prompting the user for the Dropbox folder location without knowing whether it's installed or using the Dropbox SDK to connect to Dropbox and access files independently of any copy the user already has locally via the Dropbox client.
Determining whether Dropbox is installed isn't possible from a UWP app. Or, at least, is probably not the recommended method of access to Dropbox from a UWP app.
On Windows the user's Dropbox folder location is stored in %localappdata%Dropboxinfo.json so in WPF/WinForms/Console applications you can use something like:-
using Newtonsoft.Json.Linq;
using System;
using System.IO;
public static class Dropbox
{
private static string _Path;
public static string Path
{
get { return _Path ?? (_Path = GetPath()); }
}
static string GetPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
var filePath = System.IO.Path.Combine(appDataPath, @"Dropboxinfo.json");
dynamic dropboxInfo = JObject.Parse(File.ReadAllText(filePath));
string folderPath = dropboxInfo.personal.path;
return folderPath;
}
}
Due to lack of access to %localappdata% this method falls at the first hurdle in a UWP app.
This leaves you either prompting the user for the Dropbox folder location without knowing whether it's installed or using the Dropbox SDK to connect to Dropbox and access files independently of any copy the user already has locally via the Dropbox client.
edited 2 days ago
answered 2 days ago
Michael Phillips
6822517
6822517
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
add a comment |
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
I had feared such... I don't want to burden the user with a Dropbox SDK for the few that might have it...
– J. H.
2 days ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408851%2fdetect-whether-dropbox-is-installed-in-a-uwp-app%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown