I would like to develop function related to QRCode reader. Is there anyway I can debug by Simulator - codenameone

Can I debug my program for QRcode reader with cn1 simulator without a camera?
The simulator doesn't include a camera to scan QRcode. How do I debug my program for QRCode reading?

Currently we don't support that. Notice that you can use the isSimulator() method (in CN and Display) to create a special case that lets you add a manual way to test the QR code.
E.g. instead of showing a scan button just add a text field and paste in the text matching the QR code content. Then use that to invoke the rest of your code.

Related

How to save codes on VS Code Mac?

I am using VS Code on a Mac to write ReactJS, however I find that I could not save my code. If I use command and s to save, then the JSX will be a mess, just like shown in the picture:
enter image description here
So how could I solve it? Thank you
I think your code is being saved, but that your code formatting is messing-up your code.
Hit the following combination : Shift+Command+P
This will open a menu on top. Inside that menu type Format Document With..., and select it. It will allow you to format your code with a different auto-format tool. Choose the one that is appropriate for your code i.e. Prettier.

scandit not scanning 2D-codes

I've been trying use Scandit in Codename One through their library. I can display the camera screen on my phone and also scan barcodes, but not 2D codes. I'm using version 5.5.2 for both Android and IOS.
I've read on their site that you have to enable the scanning of 2D codes so I went to check if I could change anything in the Native Interface or maybe use an implemented function to enable the correct Symbologies.
My question is, is it possible to enable these symbologies in their library. Should this be enabled automatically? How can I fix this issue?
Thank you in advance.
The Scandit docs example for 2d bar codes uses the SYMBOLOGY_EAN13 and SYMBOLOGY_CODE128 symbologies.
In the Codename One API, that translates to something like:
Collection<Integer> symbologies = CodeScanner.createSymbologySet(
CodeScanner.SYMBOLOGY_EAN13,
CodeScanner.SYMBOLOGY_CODE128
);
CodeScanner.getInstance().scan(symbologies, new ScanResult() {
...
});
Check out the CodeScanner source for some more details on available symbology constants.

How to open a text file from CLI using a running instance of a GTK text editor written in C?

I have a text editor written in C using gtk+-3.x and gtksourceview3. I would like to expand the functionality to include the ability to open a text file from the command line and add the text in this file to a new buffer in the previously opened editor.
So the question is, how do I access this text? I can add it to a buffer,scrollwin... that isn't the problem. Thanks.
I'm assuming your problem is what's mentioned in the title: getting an already running instance of a GTK app to do something from the command line.
GtkApplication and it's base class GApplication will give you the tools you need: It allows you to define actions that the new instance can invoke on the original instance (using D-Bus but that's an implementation detail). For your use case take a look at the already defined "open" action in GApplication (see example).
If you are using a an old version of GTK+ that doesn't have GtkApplication, you can use libunique instead -- the API is roughly the same.

Cefsharp and video tag WebRTC

I'm trying to write a wpf with webrtc support. The access to the camera works but the display of the <video> from the page doesn't. Can anyone help?
You can do something like this:
var cefSettings = new CefSettings();
cefSettings.CefCommandLineArgs.Add("enable-media-stream", "enable-media-stream");
Cef.Initialize(cefSettings);
This has the same effect as passing the command line argument
I assume you want to display video from your camera via WebRTC so I think it requires a call to .getUserMedia() to get hold of your camera. For that to work you must use CefSharp based on Chromium 30 or later. So either:
Use the latest CefSharp.Wpf NuGet. Right now you need latest -Pre release
or build from source with the current master branch.
I just did a quick test again using CefSharp.MinimalExample so here are the steps:
Make sure your MinimalExample uses Chromium 31 or higher - see this PR - unless it already got merged by the time you are reading this.
In MainView.xaml modify the <cefSharp:WebView Address= /> attribute to "https://simpl.info/getusermedia/sources/index.html"
Build and when running add the --enable-media-stream command line flag.
That's it! With your camera connected and a bit of luck you should see your own face - or whatever the camera points to - on the screen.
Bonus info: Hopefully soon PR #365 can get a bit of extra love to allow for passing flags too and get merged into CefSharp. With that you can set the flag in code instead of having to pass it in as a command line parameter.
The correct code is this
Dim settings As New CefSettings settings.CefCommandLineArgs.Add("--enable-media-stream", "1") CefSharp.Cef.Initialize(settings) settings.CachePath = "cache"

barcode scanner can not connect to the application to call the data from the database

I am currently working on software for student attendance. I use the flex / flash and php to create the software but I faced a problem barcode scanner, can not connect to the application to call the data from the database when students scan the barcode printed on their student card.
Can you help me to make the script so that it can run on flex / flash and php. it makes me crazy for a week to seek a way out …. please help me: (
thanks,
All barcode scanners I've used work like any other input device. Make sure a text input in your Flex app has focus. Then scan, and the input should show up in the text field.
When I last built something like this; the last key from the scan was an enter key. I don't remember if we added that explicitly when generating the bar codes or it was automatically part of it. But, we keyed off that carriage return to perform processing.

Resources