0

I'm trying to setup an updated for my app at work. I have set it up to check for the version on a file and then try to install the new APK if the version don't match. I'm trying to follow the guide found here but it doesn't seem to work with SMB paths.

The first issue I have is that for some reason, I seem to not have the Uri.Parse() available. second issue, it seems to be asking for a string, I was wondering if there is a way to make it work with SMBfiles.

string path = @"smb://Domain/Share/IT/Androids/Picking.apk";
var auth = new NtlmPasswordAuthentication("Domain", "Username", "Pwd");
SmbFile file = new SmbFile(path, auth);

If that matters, the Uri seems to come from system. Is it another Uri from somewhere else I should be using?

Intent PromptInstall = new Intent(Intent.ActionView).SetDataAndType(Uri.Parse(file), "application/vnd.android.package-archive");' 
startActivity(promptInstall);

is what I havebut I get an error that Uri.Parse is inaccessible with its protection level. Furthermore, I don't think Uri.Parse will work with a smb path rather than a file path.

Elgate
  • 113
  • 2
  • 11
  • `.I'm trying to follow the guide found here` Well post the code you tried. – blackapps Jan 14 '21 at 10:07
  • `the Uri seems to come from system.` Sorry, i have no idea what you mean by that. – blackapps Jan 14 '21 at 10:07
  • `I seem to not have the Uri.Parse() available.` Why not? Please elaborate. `it seems to be asking for a string,` Yes. What is the problem with that? I see a nice string in youir code. – blackapps Jan 14 '21 at 10:09
  • @blackapps there we go. I updated it. Sorry I got lost in the comment editor. – Elgate Jan 14 '21 at 10:31
  • I cannot see that you try to use an smbpath.or smburl or whatever. And can you post in such a way that we dont have to scrol horizontally? WHy are you using a File file? – blackapps Jan 14 '21 at 10:55
  • @blackapps mostly out of habit. I usually load my files as SMBFiles to manipulate them. I'm not well versed in android work, so I work with what I know. I managed to find the issue, I changed SetDataAndType(Uri.Parse) to SetDataAndType(Android.Net.Parse). I was using the wrong Uri. Now I just need to find how to use the "StartActivity" as my program seems not to know of its existence. – Elgate Jan 14 '21 at 11:06
  • We still cannot see that you use Android.Net.Parse. And we still cannot see that you ise an smb path. And we still do not know what File would be. – blackapps Jan 14 '21 at 11:19

0 Answers0