dotnet / docs-maui

This repository contains documentation for .NET Multi-platform App UI (MAUI).
https://docs.microsoft.com/dotnet/maui
Creative Commons Attribution 4.0 International
227 stars 200 forks source link

A tutorial for how to install .APK from MAUI Android #1377

Open janseris opened 1 year ago

janseris commented 1 year ago

Description

Hi, I need to install .apk file from my MAUI application. I found only some Xamarin tutorials. The syntax of Xamarin and MAUI is not the same, I cannot figure out how to use the Xamarin example. I believe that the code must be now more simple in MAUI. Could you please provide a way in the documentation on how to install an .apk file programmatically from inside a MAUI application?

Thank you.

Public API Changes

Add documentation

Intended Use-Case

Install .apk file from MAUI application (the MAUI application invokes an instalation of a .apk package). Either install a companion app or install new version of existing app.

Toshixo commented 1 year ago

I have also ran into this issue, all the documentation on installing an APK is in Xamarin which is not helpful. I have tried with intent and context and also package manager but I don't think these attempts are going anywhere. Please let me know if you do find a way :)

hannahbellelee commented 12 months ago

Hi all... Hi @davidbritch. I used a couple of davidbritch's tutorials for xamarin forms for a "kiosk mode / Admin receiver" apk with SOME success, but still never even got that to work exactly right. So I would also LOVE to see an in depth tutorial, however, my use case may be a little different. I wish to install the apk, and then update the apk in place. I have used the Admin Receiver and the app is in Kiosk mode because we dont want the users playing around on the device. Also set bootupreceiver to make sure it was locked down on a restart... I successfully check for an update, it finds the newer version, and downloads the newer version, but nothing I tried would allow the app to install the updated apk even with permissions to do so. It had permissions to read the local file system, had permission to install. I gave the browser permission to install and tried to launch the apk through a browser, which also failed, So I am spinning my wheels. But davidbritch, your posts were the most helpful thus far. I just wish someone could give some guidance on how to successfully update a sideloaded LOB app, that is either hosted on a website that only internal users could access, or even via a network share inside the facility. For my specific case, No one from the outside would ever hit these locations nor be able to get at the (also internally hosted SQLServer data). Is there ANY post or tutorial anywhere that could steer me in the right direction?

@davidbritch, I was actually trying to find a way to get in touch with you with a few questions regarding those older posts, but havent found a real good way to do so, Is there a way you could reach out and perhaps help me with a few issues Im facing. I dont think its a coincidence that I just so happened to run across your name on this issue. I have some more detailed info that I cant really post here, regarding this topic. Thanks in advance!

HBL