Xamarin.Forms: Using open source code instead of the nuget package to debug - xamarin.forms

I am using this nuget package
https://github.com/jamesmontemagno/MediaPlugin
It is available for both ios and android in pcl.
I am using it to make videos in my app.
Unfortunately, it has issues on iOS that are inside the project, not inside my code.
I am therefore trying to debug the project, not just implement the nuget library.
It does work fine on Android, so all I want to change is the iOS part.
Unfortunately, I dont know how to insert the same library when it isnt a nuget package but just the solution and also how to then adress it from pcl code.
I havent found a solution on google, but probably I dont know how to describe the problem well enought.
How can I debug an open source nuget package?
Thank you

Download or clone the src code,
Go to your project in VS,
Right click on your solution, choose Add -> Existing project,
Navigate to MediaPlugin-master\src\Media.Plugin and choose Media.Plugin.csproj file,
Right click on your iOS project (or whatever project where you use the plugin), choose Add -> Reference,
Check Media.Plugin and click OK,
Now you should be able to use the plugin in your project code after adding using Plugin.Media; (and the code of the plugin will be available to you).

Related

Type or namespace name Forms does not exist in the namespace Xamarin

I downloaded VS2019 and proceeded to create a Solution and Project to learn Xamarin. I have tried using different templates (Mobile apps or just iOS) with the same result. Without changing anything in the resultant forms etc., if I build the solution I get the error that Forms does not exist in Xamarin. I have tried to download Xamarin.Forms, but it says it is already installed. I have searched and Googled and while there are similar questions of "name XXX does not exist in namespace YYY", none of those solutions apply in my case. I have tried to re-install VS, done a "repair" to VS. Many sites suggest closing and re-opening the solution (or cleaning), or restoring Nuget - none of that helps. The iOS project contains a reference to Xamarin.ios and I can see Xamarin.Forms under that so it does exist, but the project can't seem to find it. I know people like to see code here, but I haven't done any coding yet.
Solution image
Error image
AppDelegate
The solution was to manually add a folder called Thinktecture in C:/Program Files (x86)/Microsoft SDKs, then do an update of Xamarin.ios. It then gives a host of warnings about "Can't resolve the conflict between....", but it chooses the latest version and the Build works.

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.

Update bootstrap in an asp.net core web application + Angular project

I have created a sample project using Visual Studio 2017. The project is ASP.NET Core Web Application with Angular (the Angular template comes with the latest VS2017). The project was created and is working great.
I would like to update the bootstrap to the latest - what would be the best way to do that? I have tried copying over, importing in _Layout.cshtml and Index.cshtml but fails...
I am pretty new in this area, so any help would be greatly appreciate.
Thanks
Working with an empty solution here, but should be the same.
In your solution explorer, under Dependencies, there is a "npm" folder.
Right click on the folder and click "Open package.json"
Find "bootstrap" under devDependencies, and change the version to the one you want.
Pressing Ctrl+Space should show you the latest stable version if you just want the latest
If it doesn't automatically update the package for you then:
Go back to, and open the "npm" folder in the solution explorer.
Find bootstrap, and right click and select "Update Package"
Let me know if I missed anything.

JavaFX Projects gone?

I have been trying to find a place to download the plugin, allowing the creation of JavaFX projects, but without success.
I have installed the newest Java SDK8u65-windows-x64 but it doesn't support JavaFX Projects, or at least I couldn't figure how to create one!
Does anyone know if they have temporally taken the url's where we used to be able to download JavaFX plugins from, or is it only me, who can't find them on the Oracle website?
Thank you !
EDIT: The problem was, that I was using Eclipse Mars, which for some reason doesn't allow to auto import JavaFx, as it has some odd access restrictions on the JRE system library. How I solved it was I installed the e(fx)clipse plugin and I was able to import javafx components successfully after that!
You can develop JavaFx straight away if you are using intellij Idea and perhaps some other ides
But if you are using eclipse, you should install the e(fx)clipse for your version.
Try this link
Also if you have more than one JDKs on your system, try to use jdk 8 an the default
Right click your project > properties
Then elect “Java Build Path” on left, then “JRE System Library”, click Edit…
Select "Workspace Default JRE"
Click "Installed JREs"
Check out the list and select jdk 8....
If you don't see it, click Search…, navigate to your jdk8 path, then click OK
Now you should see all installed JREs, select the one you want
Click OK

How can I manually update jQuery UI installed via NuGet package?

Situation
I am working on an ASP.NET Web Forms project that was generated using the default Visual Studio 2012 project template. I have since then used NuGet to install jQuery UI version 1.10.0.
I need to update to jQuery UI 1.10.1 because there is a bug fix I need. According to the website, 1.10.1 is the current stable version. However, there is not a NuGet package available for this version!
I don't know why the NuGet package would lag behind the latest available stable release from the jQuery UI team on their website. (Yes, I realize there is probably a different team managing the nuget package itself... but it still seems like this needs to be kept up to date.... or the value of installing jQuery via NuGet is very limited.)
Question
How do I update jQuery UI (installed as a NuGet package) manually to 1.10.1 on my project?
I have already downloaded the latest 1.10.1 javascript files. Now.... when I look inside my ASP.NET Web Forms project, I see in the following files in the Scripts folder:
So what should I do here... delete the following two files?
jquery-ui-1.10.0.js
jquery-ui-1.10.0.min.js
...and replace with these new files?
jquery-ui-1.10.1.js
jquery-ui-1.10.1.min.js
This doesn't seem like it would work.
The way jQuery is being include in my masterpage (from the default template generated by Visual Studio 2012) is like this:
That JS bundle you see above, called "jquery.ui.combined" is auto-magically generated by some kind of hidden code. Go ahead and look through your project... you won't find anywhere obvious this bundle is defined. So if I add the latest JS files... it seems I have no way to define that they get used or bundled at all. They aren't the version that the NuGet package logic/code would be expecting!!!
Any ideas?
Another potential problem
When I downloaded jQuery UI 1.10.1, it also came with jQuery Core 1.9.1. As you will see above in my Scripts folder, it appears as if jQuery UI 1.10.0 goes hand-in-hand with jQuery Core 1.9.0. If I update jQuery UI..... do I also need to update to the matching jQuery Core as well? (These are separate NuGet packages)
Please answer this specifically
I would like for the answer to explain how to manually update the version of jQuery UI installed from NuGet package.... on an ASP.NET Web Forms project.
I think this would be useful so that in the future a developer can pull down the latest bug fixes as soon as they are included in a stable release on the jQuery UI website.... without needing to wait for the package to show up on the NuGet feed.
The jQuery UI team hasn't uploaded the version 1.10.1 for their package. I'm afraid you just have to wait until they release it.
If you can't wait, you can uninstall the current version of jQuery UI first, and then manually add the script files of version 1.10.1 into your project.
Work-around... although it seems like a bad approach....
I just opened up these files....
jquery-ui-1.10.0.js
jquery-ui-1.10.0.min.js
...and replaced the contents with the contents from these files:
jquery-ui-1.10.1.js
jquery-ui-1.10.1.min.js
I left the file names the same as they were. So even though the JavaScript files are named as version "1.10.0".... they are actually holding the code for version "1.10.1".
One of the reasons I think this might be a terrible idea
What happens if some other developer attempts to pull down my code from source control... and they use NuGet Package Manager to restore the packages they did not have yet. Wouldn't it pull jQuery UI nuget package and replace the JavaScript files I have modified with the ones from the nuget package? Then the page would start exhibiting the buggy behavior again, and no one would know why.
At the very least.... for now I can continue development with the bug fixed! It was very annoying... the overlay was appearing on top of the dialog and I couldn't interact with the page. Here is the bug that was fixed: http://bugs.jqueryui.com/ticket/8984
Go To : Visual Studio -> Tools => Library Package => And Package Manager Setting
Window opens Having Options as in Screenshot
Click On Add (+) Button At Right Top And Inside Source Browser To Your Folder Location of Whatever Package of Nuget You HAve. Name is Whatever You Want And Press Ok
You Can See Now Your Package Into Extensions And Updates Window
To Install In Current Project
use Package Manager console : Install-Package ANd your package name

Resources