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.
Related
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.
I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization
I am using Appium 1.6 to automate Android UI Tests.
In this image, I am unable to select any country (ex: Japan) from the spinner.
This is the code I am using:
driver.findElement(By.id("com.akkipet.android:id/country_spinner__add_information")).click();
driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView("+ "new UiSelector().text(\"India\"));")).click()
What am I doing wrong? After clicking on the spinner, though I'm not able to read the country values, I can read other fields like First Name, Last Name etc.
For now, I am using the tap functionality to tap at the specific coordinates to choose the required option. But this will make it device specific. Further, since the options list varies depending on the environment, I will have to give a different set of coordinates for each environment.
Code for Tap:
touchAction.tap (200, 850).perform();
Could anyone suggest a better workaround?
Try this one. It worked for me.
driver.findElement(By.id("com.akkipet.android:id/country_spinner__add_information")).click();
driver.findElement(By.name("India")).click();
By.Name has been deprecated. Try using findElementByAndroidUIAutomator.
Eg:
driver.findElementByAndroidUIAutomator("new UiSelector().text("India")").click();
I'm using a plugin which calls http://gmaps-samples-v3.googlecode.com/svn/trunk/geolocate/geometa.js for displaying map with pins on the homepage. However, this link is not found (404). I've searched for the solution too see what to do, but with no luck.
Is there a new version of this javascript available that I could replace this link with the new one? Not sure how else to put it and hope it makes sense.
Not Certain but I think this is the file.
http://pastebin.com/D22BSvb8
EDIT: Think this is the most upto date version: http://pastebin.com/GHpyPTQE
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"