I am using the example code from the ZXing page .
Details are :
Windows 10 Pro N, Visual Studio Enterprise 2015 ,
Xamarin.Forms 2.3.1.114 , ZXing.Net.Mobile 2.1.47 ,
ZXing.Net.Mobile.Forms 2.1.4.7
I am using below code
btnScan.Clicked+=async(sender,e)=>{
var scanPage = new ZXingScannerPage ();
await Navigation.PushModalAsync (scanPage);
scanPage.OnScanResult += (result) =>
{
scanPage.IsScanning = false;
Device.BeginInvokeOnMainThread (async () =>
{
await Navigation.PopModalAsync ();
await DisplayAlert("Scanned Barcode", result.Text, "OK");
});
};
}
Also I have added the below line in the MainPage.xml file of the UWP project just before LoadApplication method call
ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init();
Also I have provided access to the WebCam from the application manifest.
When I run the application in Debug or Release mode in the emulator then it opens the scanner but small black/white /red /green square comes and computer webcam is not accessed.
When I run it as windows 10 app then nothing comes, only blank screen comes.
When I run it in the real windows 10 mobile, then scanner opens but camera doesn't opens, the white screen with red line opens and camera doesn't activates.
The same thing happens with WIndows 8.1 also.
Any help would be deeply appreciated. I have wasted lot of time to explore the internet used almost every combination. If anyone have the solution please please provide me.
Note:
The above code works fine for Android and I am able to scan the bar code and QR code.
I have tried all options given by users in different forums, but none of them were working.
if you are also facing same issue then please check you camera. If you are using Windows Pro N or KN version, then you have to install the media feature pack to make camera working.
I installed the media fature pack for windows K and KN versions but still it was not working.
When I try to open the Camera App then also it was saying that Media Fature Pack Required for Windows K and KN versions.
Finally I installed Windows 10 Pro version (removed Pro N/KN version) and reinstalled VS 2015 and tried of of the solution given by user at xamarin forum
https://forums.xamarin.com/discussion/76035/zxing-scanner-camera-is-not-activating-in-uwp-and-wp-8-1#latest
But still I am still facing this issue for WP 8.1
Related
Reference
I am using Plugin.MediaManager.Forms for playing audio. It is working fine in android and ios. But in windows, the app is breaking with System.NotImplementedException..
Version Details:
Plugin.MediaManager.Forms: 1.0.7
Xamarin Forms: 4.8.0.1821
Visual Studio: 16.8.3
Windows Target version: Windows 10 version 1903(10.0; Build 18362)
Windows Min Version: Windows 10 Fall Creators Update(10.0; Build 16299)
Also, I have added the "Background Media Playback", "Internet", "Music Library" and "Videos Library" in the Package.appxmanifest under capabilities.
What else I am missing?
Plugin.MediaManager.Forms is not working in xamarin uwp
It looks a bug for Plugin.MediaManager.Forms, Please try to reduce Plugin.MediaManager.Forms version to 0.9.6. And call CrossMediaManager.Current.Init(); in UWP client project like the following. It will work.
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
Xamarin.Forms.Forms.Init(e);
CrossMediaManager.Current.Init();
ApplicationView.PreferredLaunchViewSize = new Size(600, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
I already saw your issue on github and now saw this stack question.
I fixed this problem in my Pull Request. When the PR gets merged you can update to the newest version. You have to use UWP 10.0.18362.0(Version 1903) min by the way.
The Target Version was downgraded from uap 10.0.18362.0(Version 1903) to 10.0.17763(Version 1809) from version 0.9.7 to 0.9.9. For now, you have to use v. 0.9.7.
I have hosted my model offline file on a local server and I am connected to the same server everything is accessible to me via android phone.
I have create a sample project where the forge render offline model file which works smoothly on chrome browser of my laptop but on my Xamarin form webview and chrome browser the model render with lags as my model has too many details and nodes, I cannot even perform a simple zoom in zoom out functionality.
Now same thing when I am running on Ios(safari browser) this works smooth and without any issue.
I want to understand is they any such setting which effects chrome browser or native browser of android which loads model with lag
I have tried all the possible solutions available on google
1.I have implemented this in xamarin forms custom webview renderer and gave all the required resource that I can
here are the few settings
var mWebView = new global::Android.Webkit.WebView(MainActivity.Main.ApplicationContext);
WebSettings settings = mWebView.Settings;
settings.JavaScriptEnabled = true;
settings.LoadWithOverviewMode = true;
settings.UseWideViewPort = true;
settings.SupportZoom();
settings.BuiltInZoomControls = false;
settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn);
settings.CacheMode = CacheModes.CacheElseNetwork;
settings.DomStorageEnabled = true;
mWebView.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
mWebView.ScrollbarFadingEnabled = true;
mWebView.SetLayerType(LayerType.Hardware, null);
SetNativeControl(mWebView);
2.Added hardware acceleration in manifest also added heap flag to true in manifest
3.followed this too for autodesk memory limit {https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/viewer_basics/memory-limit/}
4.I tested above solution with firefox and it works smoothly I am not sure what different they are doing to render this files
can any one help me what should I try to solve this issue
My device is medium end with 8gb Ram and 128gb internal space I am testing on 2 devices (samsung m40 and one plus 7t)
Me to same Issue I am Unable To move Model in Android device. I am using the both online and offline Viewers.
I am Using Xamarin Forms Custom WebView Renderer as like Question
Autodesk team reply to us and Petr Broz solution plz
I'm afraid this (running a web application inside a Xamarin WebView) is beyond our area of expertise but I would suggest the following:
try running a vanilla three.js application inside the WebView, with a reasonably complex scene as well (for example, convert one of your Forge models into glTF using https://github.com/petrbroz/forge-convert-utils, and load the glTF)
if the three.js application has similar performance issues, it's most likely an issue on the Xamarin side, and something we won't be able to help with
if the three.js application is working fine, please send us (forge (dot) help (at) autodesk (dot) com) a basic Xamarin project with both Forge Viewer and with Three.js that can demonstrate the performance differences, and we would try and allocate some time for debugging it, and see if there's anything we can do to help
We have recently upgraded Cefsharp to 65.0.0.0 from 43.0.0.0 in one of our projects. After the upgrade flash no longer loads in browser, it gives an error that
"Adobe Flash player is out of date"
. We have embedded a specific version of pepperflash 25.0.0.171 in the project. the code snippet as below
settings.CefCommandLineArgs.Remove("enable-system-flash");
string PpapiFlashVersion = "25.0.0.171";
var pepFlashPlayerPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase,"pepflashplayer");
settings.CefCommandLineArgs.Add("ppapi-flash-path", pepFlashPlayerPath);
settings.CefCommandLineArgs.Add("ppapi-flash-version", PpapiFlashVersion);
After getting the error I thought I'll try to use the latest version of pepper flash (31.0.0.108). But when I do that I get another error
"Right click to run Adobe Flash player"
Doing the right click doesn't work either.
Any help will be greatly appreciated. Thanks
I have a pretty straightforward page that has a few controls on it. My problem only occurs on an actual device and only occurs on my Lumia 1520 running Win10 Mobile version 1607 Build 10.0.14946.1000. It does not happen on my Lumia 950 running Win10 Mobile version 1607 OS Build 10.0.14393.693.
On the 1520 I un-install my app, reboot the device and then attempt to debug the app on the device. Everything works fine. I then stop debugging and attempt to start debugging again and the InitializeComponent method of my page does not initialized any of my controls.
What that means is that after this code runs:
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
private void InitializeComponent() {
this.LoadFromXaml(typeof(nearbyplaces));
pgHeader = this.FindByName<global::GBarScene.pageheader>("pgHeader");
lblPlacesTitle = this.FindByName<global::Xamarin.Forms.Label>("lblPlacesTitle");
btnMapAll = this.FindByName<global::Xamarin.Forms.Label>("btnMapAll");
lblDataSource = this.FindByName<global::Xamarin.Forms.Label>("lblDataSource ");
btnUseGPS = this.FindByName<global::Xamarin.Forms.Image>("btnUseGPS");
lblRatingsFor = this.FindByName<global::Xamarin.Forms.Label>("lblRatingsFor");
lblDowName = this.FindByName<global::Xamarin.Forms.Label>("lblDowName");
bvUnderline = this.FindByName<global::Xamarin.Forms.BoxView>("bvUnderline");
lvPlaces = this.FindByName<global::Xamarin.Forms.ListView>("lvPlaces");
}
Every control (psHeader, lvPlaces etc.) are all still null. (If I attempt to launch the app on the 1520 without debugging after running it the first time, it crashes)
I see nothing in the output window indicates there was a challenge in other areas. Any idea why this is happening?
UPDATE UPDATE:
So I reset the device (I got the same build etc) and tried testing again. I am now getting some error information. Below are the steps to reproduce the error as well as the error information:
Un-install any previous version of the app from the Device.
Restart the device
Test the app on the device. (It should work fine.)
Click the Stop button in the Visual Studio 2015 environment
At this point simply click the Run button in Visual Studio without making changes in the App, it will launch fine on the phone.
Click the Stop button in the Visual Studio 2015 environment
Make a change in the main page of the application and recompile. Ensure the Build line shows at least 1 project succeeded and not just all up to date or skipped.
2 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========
Run the application on the Device again.
An error is generated at the LoadApplication line shown below:
public sealed partial class MainPage
{
public MainPage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
LoadApplication(new GBarScene.App());
Below is the error information:
An exception of type 'System.ArgumentNullException' occurred in
Xamarin.Forms.Platform.WinRT.ni.DLL but was not handled in user code.
I click on the View Details and I see the following information:
"Value cannot be null.\r\nParameter name: newRoot"}
I hope this helps in getting this problem resolved.
UPDATE:
The problem also happens on my Lumia 640 XL that was upgraded to Win 10 Mobile.
First up, I'm fairly new to .NET and C# and this is a project to learn C# and CEF at the same time.
I have followed a number of tutorials from the net as well as looking into the CefSharp examples to create a WinForms application.
I have installed CefSharp.WinForms 53.0.1 from NuGet, and my project is using Any CPU (CefSharp 51+ has Any CPU support).
To achieve this I largely followed the tutorial from Ourcode (http://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application). I made the changes for Any CPU as suggested and included the basic code to load google.
Everything builds fine, but when the form displays there's no browser shown, just a blank form.
If I set the target to x64 or x86, then the browser displays as expected.
I notice in the Ourcode comments that user Edek Halon has had the same issue, but no solution seems to be provided. Edek, has the same setup as me, so I wonder if this is an issue in 53.0.1? Potentialy Joey De Vries in the comments has the same issue.
The addition of support for Any CPU in CefSharp is covered in this GitHub issue : https://github.com/cefsharp/CefSharp/issues/1714
There is a troubleshooting page for CefSharp (https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting) and it seems a bit contradictory. Under General Troubleshooting
1) Platform Target You must select either x86 or x64 when using the NuGet packages. If you select AnyCPU the NuGet magic won't work currently.
Does CefSharp need to be built from source for Any CPU to work?
Just if anyone is having difficulties with this, follow the Github Tutorial at the following link : https://github.com/cefsharp/CefSharp/issues/1714
Basically the code should be as follows (Winforms Example):
CefSharpSettings.SubprocessExitIfParentProcessClosed = true;
Cef.EnableHighDPISupport();
CefSettings settings = new CefSettings
{
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"), //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
BrowserSubprocessPath = #"x86\CefSharp.BrowserSubprocess.exe"
};
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); // Initialize cef with the provided settings
chromeBrowser = new ChromiumWebBrowser("http://ourcodeworld.com"); // Create a browser component
this.Controls.Add(chromeBrowser); // Add it to the form and fill it to the form window.
chromeBrowser.Dock = DockStyle.Fill;