Sample code for file-picker in Xamarin android - xamarin.android

Can anyone show me how to implement a file-chooser/picker for Android using Mono?
Thanks in advance,
Tery

Would this sample work for you?

You can also use one of the Xamarin Plugin projects available as a NuGet package, if you want to support more platforms later. The currently most actively maintained package is this one:
https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows
(note: I'm one of the contributors to the project).
Picking files is as easy as calling var result = await PickFile() and checking the result object. See also the sample code mentioned in the README.md of the Github project.

Related

Appcode doesn't autocomplete third party libraries

Recently I'm giving a hand to my iOs team(coming from Android) and I'm trying to use Appcode to keep all my IntelliJ keybinds and shortcuts. However, even if I can work with Appcode and everything compiles and works well. Some of the libraries that I use on the application doesn't work with AppCode autocomplete. I can't access the base code or do nothing. However if I write the code without any kind of autocomple/helper the code compiles and works well.
For example using RxSwift:
I have been reading and Jetbrains says that this issue was fixed on 2018 edition. But I'm using 2020 edition and I keep having this troubles.
So, my question is: how can I make Appcode show third party libraries methods and classes on the autocomplete?
Generally, AppCode does support completion in third-party libraries. In your case the problem most likely is specific to RxSwift or your particular project setup. For example, there is this known problem with RxSwift, see comments for a workaround: https://youtrack.jetbrains.com/issue/OC-19258
If the workaround doesn't help, feel free to contact AppCode support for more specific troubleshooting or create an issue in the issue tracker.

Problem when publishing an application on the App Store [Non-public API usage]

Until three weeks ago, my application could upload it to the App Store without any problem. However, Apple has refused to upload the app with a new message about Non-public API usage.
The application is developed with Xamarin in Visual Studio for Mac and has updated all the libraries and packages. Can anybody help me? Because I can not find what the problem is, nor do I see any solution. It will be something new?
Thank you all.
Non-public API usage:
The app references non-public selectors in AppAytoSS.iOS:
addTemporaryAttribute:value:forCharacterRange:,
addTemporaryAttributes:forCharacterRange:, behaviorWithType:,
defaultBaselineOffsetForFont:, defaultLineHeightForFont:, finished,
greekingThreshold, horizontalCornerRadius,
initWithSource:convolutionState:weights:, initWithType:,
postSession:didAddPlayer:, postSession:didReceiveData:fromPlayer:,
postSession:didReceiveMessage:withData:fromPlayer:,
postSession:didRemovePlayer:,
postSession:player:didChangeConnectionState:,
postSession:player:didSaveData:, preferredMetalContext, removeData:,
removeTemporaryAttribute:forCharacterRange:, setGreekingThreshold:,
setHorizontalCornerRadius:, setIsPrimary:, setShouldAntiAlias:, setUUID:,
setVerticalCornerRadius:, shouldAntiAlias,
temporaryAttribute:atCharacterIndex:effectiveRange:,
temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:,
temporaryAttributesAtCharacterIndex:effectiveRange:,
temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:,
textContainerChangedTextView:, toolTip, usesBackgroundSession,
verticalCornerRadius
We had the (exactly) same problem with an Xamarin iOS Project and where able to fix it via Setting Build/iOS Build/Linker Behaviour: Link Framework SDKs only (before Don't link) - what Jack Hua link shows as solution.
We where not able, to figure out the problem behind though. Two different MacBooks where used, one with the most recent version of XCode, Visual Studio and Xamarin Libs, the other with slightly older versions. The latter was able to create an IPA without the above described error, the updated machine was not.
However the used NugGet Packages where the same, so I think this issue is not related to them.
After filling an internal issue with the Xamarin team, they advised doing the following
adding --linksdkonly to the Additional mtouch arguments on the iOS Build settings page
As it seems that Visual Studio ignores the settings in GUI
I have tested it and now get my build accepted by Apple without the above error
This is the issue filed on Xamarin
https://github.com/xamarin/xamarin-macios/issues/5913
I find a thread where people meet the same problem with you recently:build-status-has-changed-to-invalid-binary.
So, I guess some third part nuget packages you are using has updated and using these non-public selectors that Apple not allow.
I would suggest you to get you code three weeks ago and don't update any third part nuget packages. Then submit again to check if it is the problem.
You can also compare your reference with the references people listed in that thread and find something similar. And any nuget packages related to Player(As I can see some player selector in the non-public selectors list)?

Where is GlimpseTimeline?

I am using the latest Nuget package of Glimpse. I see in the official website that they have a GlimpseTimeline that allow to add custom event in the timeline. I see the Github source that this static class exist. How come it is not inside Glimpse?
The page on official website that you referensed says "The GlimpseTimeline API was introduced in v2+" now. And v2 haven't been released yet, which is sad.
You can download SSW.AnalyticsInterface.Glimpse nuget package which provides the same syntax and works well. But I think it's not opensource and that's quite confusing. If you fine with non-opensource code that may be your solution.

Why can't I use htmlagilitypack with windows phone 8? What else can I use to Parse HTML in WP8?

Why can't I use htmlagilitypack with windows phone 8? I appears to be supported on all platforms including Win8 Win8RT and WP7/WP7.5 and Silverlight 5. Is there one of the DLLS that would work?
What else can I use to Parse HTML in WP8? All suggestions are for the htmlagilitypack.
The issue appears to be that the NuGet package references the incorrect assembly for WP8.
By default it seems that it references the binary in sl4-windowsphone71, manually removing the reference to the HtmlAgilityPack DLL and referencing the binary in the sl3-wp folder removes the dependency problem.
That is how I have resolved it anyway.
As anthony mentioned, just replace the reference from sl4-windowsphone71 to sl3-wp and it will work.
It seems that Windows Phone 8 doesn't like the System.Xml.XPath.dll from the Silverlight SDK. My app that works fine on Windows Phone 7.5, won't work on WP 8. I am currently researching for another alternative for HTML Agility Pack.
You probalby can and you've either forgot to unblock the web downloaded DLLs or forgot to update your NuGet package manager. Let me know if that isn't the case.
The portable class library version of htmlagilitypack:
https://github.com/Deathspike/HtmlAgilityPack-PCL
it is out on nuget!
In my lib folder, sl3-wp folder is empty.
I fixed by downloading HtmlAgilityPack-PCL from NuGet Manager

Drawable , Layouts, etc... in a DLL?

Is it possible in monodroid to have Drawables, Layouts, etc... (I mean resources) in a DLL? The problem is that I have created a project that generates a DLL but it doesn't build the project structure a regular android application project builds. Is there any possibility to accomplish this? Where should I move drawables, etc... in a dll?
This is not supported in the current version of Mono for Android. This post on the mailing list provides some more details about it. It's on the roadmap to get added in a future version, but I don't think they've given a timeline on it.

Resources