How to use open file dialog in xamarin forms - xamarin.forms

Please help me, I want to pick the pdf file locally in xamarin forms(cross platform). So on a button click i need to open the file dialog to pick pdf file locally.

This is not something that can be done in a true cross-platform way. For example; on iOS you cannot access the filesystem directly, while on Android and UWP you can.
I have created a NuGet Xamarin.Plugin.FilePicker (Github) (original by rafaelrmou), which tries to solve this for you. On iOS you need iCloud Drive to be configured.
If you do not want to use the plugin you could always look into the code and roll your own.

Related

Xamarin Forms - prevent iOS storyboard from loading

I'm using Visual Studio for Windows to test a Xamarin Forms app on Android. Now I want to test it on an iPhone as well, which is possible by connecting the iPhone to my Windows system and using Xamarin Hot Restart.
The app is deployed on the iPhone, but when I tap on the icon it starts for a brief moment and then it closes (like it crashes). Looking at the link sent here earlier, in the Limitations section, the cause of this issue might be described there:
"Storyboard and XIB files are not supported and the app may crash if it attempts to load these at runtime. Use the HOTRESTART preprocessor symbol to prevent this code from executing."
I do have a Storyboard and I think an XIB file, but I have no idea how to prevent it from loading. The storyboard is called in info.plist only and the XIB extension is called in the .storyboard file.
LaunchScreen.storyboard
Info.plist
The usage of the preprocessor symbol HOTRESTART is only for C# I believe. My question thus is: how can I use the processor symbol HOTRESTART to prevent the loading of storyboard and XIB files?

Google Play ask for deobfuscation txt file, Xamarin Forms

When I previously released my application it went well, but now I try to upload a new version of my application and Google Play says that it has some java/kotlin code in it and asks for me to upload an deobfuscation txt file. I have been looking for answers and the people mention a "mapping.txt" file which android studio creates when you are using proguard or R8 code shrinkers.
Does anyone know where I can generate such file or where it may be?
Note: I haven't added or upgraded any nuget packages since the last time I updated the application and I already looked in the bin/obj folders with no luck. Also I checked the archive folder that creates when I bundle the application.
The obfuscation step of ProGuard is disabled when building a Xamarin Android application. Therefore, there's no deobfuscation file generated and no need to upload one. You can ignore the warning.
From the Xamarin.Android documentation:
The Xamarin.Android ProGuard configuration does not obfuscate the APK. In fact, it is not possible to enable obfuscation through ProGuard (even through the use of custom configuration files).
Edit: There is currently an open PR in Xamarin.Android to have ProGuard generate the mapping.txt file. Note that this is only to silence the warning, though. In theory, it's not needed.

How to include Android.Support.v4 in Xamarin Forms (iOS)?

I am using Visual Studio For Mac. My Xamarin Forms project is quite large and contains many content pages. Some of them will be only used in android project and some of them only used in iOS project. There is no problem when I compile the project into android. However, when I want to compile the project into iOS, it seems like did not accept anything related to android. Please refer to the screenshot. There is no way I can include the android specialised reference and compile into iOS project. So, any idea to deal with this? Maybe there is a way to force build the iOS project no matter what? The error from the screenshot is from the page that will be only used in android. So what I can do for now is delete the page when I want to compile as iOS and recreate the page when I want to used it for android. But there are plenty of them, it is too heavy for me to do this every time. Please help.
You can't call platform specific APIs at the .NET standard libraries that are used to host Xamarin.Forms code by default.
Basically you have those options:
1) using shared project instead of library and using conditional compiling (easier but it is now not available as the option when creating the project)
2) using dependency injection.

Showing Files on Android

I'm very new to backendless.
And a little bit new to developing an androip app.
I'm trying to show list of files in my Backendless to my Android app.
I'm trying to show my uploaded files in my Backendless to a List View in my Android Studio Project. Wherein the user could see the files(images,documents,pdf) inside the folder and other sub folders inside it.
Backendless cares about you even if you are "very new" to it :)
Just use it`s build-in code generation tool. It already provides you a file manager for you application. You can customize it so that would pass for all your needs.
Well, open console and create your new app. Then go to Code Generation section, select Android tab and check "Simple file manager" option.
As soon as you you download the project open it in your IDE, select SDK and run.
Found it.
https://github.com/Backendless/Android-SDK/blob/master/src/com/backendless/Files.java
This has all the codes you need concerning file management for backendless in your android project.

Flex Builder 4 mobile modifying app properties

I am building an app in Flex Builder 4 (iOS and Android) and have my app worked almost to completion and about ready for deployment. Unfortunately, I cannot find how to change the app icon and title for the system to read, so my app still shows up as Main with the default package symbol in the launcher. Does anyone know where to apply changes to these properties?
You need to edit these details in the .xml file for your project. It will be located in the root of your src folder and will be named something like MyProject-app.xml. Double click this, there you can edit the filename, version number, icon, etc.
NOTE: the default view is Design, i found it much easier to edit in the Source view.

Resources