I'm writing application using Xamarin.forms and i need to open PDF and Doc documents in Droid and IOS. Is there any crossplatform way to achive this? Maybe any packages?
How to open files in default program?
10.9k Views Asked by Horosho At
2
There are 2 best solutions below
0
Ahmed Mansour
On
Now you can use the Launcher class by adding a reference to Xamarin.Essentials in your class.
For opening a file by another application use:
await Launcher.OpenAsync(new OpenFileRequest
{
File = new ReadOnlyFile(file)
});
Where file is the File or FullPath.
You can find more here: https://learn.microsoft.com/en-us/xamarin/essentials/launcher?tabs=android
Related Questions in XAMARIN
- C# Visual Studio Android App Showing a wrong not working Keypad on Entry text
- Playing local recorded video
- What changed from xcode 13.2.1 to 14.2 that would affect an app's entitlements?
- After adding the packages of "Xamarin.Firebase.Messaging", getting error related to JAVA0000 "Compilation failed"
- C# Xamarin Android | Change Contentview from class
- Why does my LINQ query in Xamarin.Forms show less than expected content?
- My .net MAUI app works in debug mode, but "dotnet publish" doesn't work
- Xamarain support for IOS 17.4.1
- Grid Items keep stacking instead of creating a new row
- .NET MAUI TapGesture Command not working in CollectionView
- Xamarin android emulate usb PC Keyboard
- Java.Lang.IllegalStateException: 'Unable to parse composition' using Lottie in splashscreen xamarin forms (android)
- add Items (FILES) from Directory to Spinner List
- AVPlayerViewController's caption options do not update in .Net 8 tvOS app
- Printing PDF generate with Itext7 on a thermal printer Model:P80D
Related Questions in XAMARIN.IOS
- Maui custom iOS picker renderer conversion
- My .net MAUI app works in debug mode, but "dotnet publish" doesn't work
- iOS 17.4.1 requestTrackingAuthorization returns Denied status always
- Xamarain support for IOS 17.4.1
- Xamarin iOS to MAUI .net8
- Could not create an native instance in Xamarin.IOS
- Xamrin forms iOS app no longer receiving FCM registration token after updating Xamarin.Firebase.iOS.CloudMessaging to 8.10.0.3 from 3.12
- Xamarin.iOS - Client.PairedDevices does not return the devices
- M24LR16E Drivers not being read with NFC on iOS
- How can I create a framewrok from a native iOS library?
- Implementing URL-encoded Form Data Submission in Xamarin.Forms WebView for iOS
- How to make monotouch.dialog work in .net maui
- Reading barcode in an ios application in .net8 without maui
- Using the community toolkit with xamarin iOS and Xamarin Android
- On Migrating Xamarin App to .NET MAUI App crashes on starting application again due to FFImageLoading.Compat
Related Questions in XAMARIN.ANDROID
- Extracting Last 4 Digits from RPM Response in Xamarin Android (e.g., "41 0C") and Performing Decimal Conversion and Division by 4
- Xamarin android emulate usb PC Keyboard
- Java.Lang.IllegalStateException: 'Unable to parse composition' using Lottie in splashscreen xamarin forms (android)
- AzureDevops Pipeline Generate APK: Error XALNK7000: Mono.Linker.MarkException
- Unable to clear App cache in Xamarin.Forms Android
- Xamarin Android Memory Usage
- Failed to resolve SDK 'Microsoft.NET.Sdk'
- Why are there no results after clicking button even though event handler is initiated and button_click method created?
- How to perfectly localize DatePicker, TimePicker in Xamarin
- .Net Android (Maui) Writing external storage doesn't work until I restart the application in below 13 version
- Syncfusion/Xamarin Numeric Keyboard broken - 2 different characters within the same button
- Alarm manager does not trigger broadcast receiver when app is closed
- ExtendedListView not scrolling to correct position
- Can not resolve reference 'Package' referenced by 'Project.Android', when updating a new package in an existing project
- How to make a row in a list after clicking a buttom xaml
Related Questions in XAMARIN.FORMS
- Playing local recorded video
- NavbarAnimation.Maui With TabbedPage
- Why does my LINQ query in Xamarin.Forms show less than expected content?
- Not showing Created folder in My App directory MAUI
- IOS Release version showing error "PlatformNotSupported" because of PCLCrypto.SymmetricKeyAlgorithmProvider.GetAlgorithm()
- The type was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built
- Heart shaped image clip - rotate/scale a Geometry object
- Printing with Xam.Plugin.Bluetooth
- Unable to open another app from within Xamarin Forms Android app
- XamlC error XFC0000 : Cannot resolve type "Popup" in my xct:popup xaml file
- .NET MAUI TapGesture Command not working in CollectionView
- Xamarin android Could not receive the push notification on OnMessageReceived while swipe away app
- how to avoid silence while playing audio file in xmarin forms media player
- Net Maui Property FlexLayout.Shrink does not work as expected
- Xamarin android emulate usb PC Keyboard
Related Questions in EXRIN
- Is it possible to navigate to a dynamic page in Exrin
- Exrin Isolates and MasterDetailContainer
- How to implement a visual busy/working indicator in Exrin?
- How to set Exrin TabbedPage tab title?
- How to have TabbedContainer and SingleContainer within the same stack?
- Exrin IMasterDetailContainer IsPresented has no effect, how to hide navigation drawer
- Exrin MasterDetailPage
- Exrin tabbed view: navigation between tabs using NavigationResult
- Tabbed page as detail view of masterdetail page in Exrin
- Exrin VisualState LifeCycle
- Reactive Extensions for nested objects in Exrin VisualState
- Animations with Exrin
- Exrin: What to know when upgrading form 1.X to 2.0?
- Exrin: Binding between ObservableCollection in ModelState and VisualState doesn't seem to be passing NotifyCollectionChanged
- Proper use of operations, models, and services within Exrin
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It depends on what type of documents you are taking about. In Xamarin.Forms, you can use
If there is an application that can handle the extension, then it will prompt you on which app you wish to use.
If you wanted to view them internally, inside the app, without launching a 3rd party app, then we really need to know what type of documents you are opening. If it's a PDF, then you can look at Display Local PDF File In WebView.
Should it be another type of document, you will need to see if there is a different