Twain disable UI in DAT_USERINTERFACE, still show UI during scan - twain

I'm trying to programmatically control a twain scanner within my custom application. I don't want to show the scanner's native UI.
I set CAP_INDICATORS capability to FALSE, and set CAP_UICONTROLLABLE capability to TRUE.
Then I start the scan using DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDS, while ShowUI in TW_USERINTERFACE structure is set to FALSE.
I tested through different scanners. While my Epson DS-30 scanner is working as expected without ui, my Avision A6 scanner still shows a progress UI during scan:
This UI appears when I call DG_IMAGE / DAT_IMAGEINFO / MSG_GET operation, to get the image details from scanner. With DAT_IMAGEINFO command, this A6 scanner start to scan the paper, and after scanning complete, I could finally recieve the TW_IMAGEINFO structure.
I don't receive any TWRC_CHECKSTATUS while setting the UI mode.
So does this particular scanner actually doesn't support twain without UI?
Or could I have something workaround to disable this UI?

Actually a lot depends on the driver implementation.
So what happens is the options you set from the application configures the driver based on the capabilities it supports. If the driver capability for UI-less scanning is not allowed to be configurable by the driver in that case your application implementation may not work as expected.
Please refer to the TWAIN documentation for complete details.

Related

appium java-client 8.x - getOrientation method was deprecated- how to check current orientation now?

Previously it was possible to check device orientation
driver.getOrientation()
In appium java-client 8.3 this method is no longer available. How to check current device orientation now?
Found it - Mobile specific extensions have been respectively moved to IOSDriver and AndroidDriver.
You will need to cast the driver. From Java Client 8.x.x and Appium 2.0, mobile specific extension commands have been moved to respective drivers.
Basically, if you have initialised the driver like below,
AppiumDriver driver = new AndroidDriver() or
AppiumDriver driver = new IOSDriver(),
Then, cast the driver like below,
((AndroidDriver) driver).getOrientation(); OR
((IOSDriver) driver).getOrientation();
This way, you access the mobile specific extension commands.

Cannot get token from Huawei HMS push kit

error message as below
[getToken] Error/Exception: {"nativeStackAndroid":[],"userInfo":null,"message":"907122036: no
right","code":"907122045","line":2568,"column":45,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.huaweipush.letsapp&modulesOnly=false&runModule=true"}
[getToken] Error/Exception: {"nativeStackAndroid":[],"userInfo":null,"message":"907122036: no right","code":"907122045","line":2568,"column":45,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.huaweipush.letsapp&modulesOnly=false&runModule=true"}
The error code indicates that the Push Kit are not enabled. As a result, have no permission to obtain the token. How to enable the Push Kit, pls refer to the this docs.
Sign in to AppGallery Connect and click My projects.
Find and click the desired project in the project list, and click the app for which you need to set Push Kit parameters.
Go to Project settings > Manage APIs and enable Push Kit.
Go to Grow > Push Kit and click Enable now. In the dialog box that is displayed, click OK.
Enable the precise messaging function.
Here below is some checkpoints for the above issue.
First ensure you have enabled the push kit in AppGallery Console
Please check whether you are providing correct app id or not:
String appId = AGConnectServicesConfig.fromContext(MainActivity.this).getString("client/app_id");
pushtoken = HmsInstanceId.getInstance(MainActivity.this).getToken(appId, "HCM");
It is recommended that the getToken method be called in the onCreate method of the first Activity class after app startup. Implement the corresponding listeners for getToken API and observe the logs.
Device: Non-Huawei phones must have HMS Core (APK) installed (which can be downloaded from HUAWEI AppGallery). There is no restriction on Huawei phones.
Network: The phone is connected to the network and the connection is stable.
EMUI version: EMUI 4.0 and EMUI 4.1 (for some devices), and EMUI 5.0 or later It is recommended that you use a device running EMUI 5.0 or later.

Xamarin.Forms AppResources: When localizing, how to "look up" the default language translation at runtime

I have an XF app that I'm trying to provide multiple languages for using resx/AppResources files. However, I have a need to be able to access the English (default language values) at runtime for logging purposes. Basically the app has Activities that the user can complete. Each activity has a title that is translated. When an activity is completed by the user I want to log it too my server so I can see which activities are being used the most. Obviously I'd rather not log the Chinese titles.
What are the best way(s) I can retrieve the default language values regardless of what the App's current language is set to?
Regards,
Sean
On Android:
Locale.Default.GetDisplayLanguage(Locale.Default)
On IOS:
var te = NSLocale.CurrentLocale.LocaleIdentifier;

Windows Mobile: "My network card connects to" registry settings

Can anybody please tell me the registry setting(s) that are affected in Windows Mobile 6.1 when a user selects Start -> Settings -> Connections -> Wi-Fi and then changes the value of the "My network card connects to" drop down list on the "Network Adapters" tab?
I have a device that seems to default this to "The Internet" when in fact the Wi-Fi connects to the corporate network and I would like to be able to change this programatically rather than expecting 250+ users to have to do it manually every time they reboot their devices.
Thanks.
I'm not certain that it is a registry change, but if it is, it's easy to determine.
Use the remote registry editor and attach to the device
Save the entire registry to a file
Change the network settings
Save the registry again
Use your favorite diff program to compare the two files
I think you should be able to change this setting using provisioning xml, either via DMProcessConfigXML api, or by making a setup cpf with the xml in it and running it on the device. This post details how to build the xml into a cpf.
The CSP you would be interested in is the Wifi CSP
The 'Work Network' and 'The Internet' are metanetworks that are specified in the xml by guid, usually in the DestId parm. My answer to this question details the xml you can use to pass to DMProcessConfigXML to read the settings on the device to see what they are. Then you can build some xml to just set the right setting. I suspect that you would just need to set the DestId parm of the appropriate wifi entry to the 'Work Network' guid.
According to my registry comparison on WM5 (HTC Touch HD), corroborated by values in http://msdn.microsoft.com/en-us/library/bb737539%28v=MSDN.10%29.aspx, this setting is specified in the registry key:
HKEY_LOCAL_MACHINE\ControlPanel\WiFi\Ethernet\DestID.
"{436EF144-B4FB-4863-A041-8F905A62C572}" (default) The Internet
"{A1182988-0D73-439e-87AD-2A5B369F808B}" Work
I also tried a CE2003 device (Motorola MC50), but couldn’t detect any registry changes. The key above does not exist in the registry on this device.

Turn off screensaver while openmoko app is running

In openmoko (stable hybrid release, SHR), how do you programatically turn-off the screensaver (the dimmed/blank screen after a few seconds of inactivity) just while your app is running?
In X, you can run
xset s off
to turn off the screensaver. Similarly gnome/freedesktop exposes a DBUS API to control and inhibit screensaver mode. I don't know if OpenMoko supports the freedesktop spec, but if it does you should be able to use DBUS directly. You can see how Totem does it here.
FSORaw is a wrapper that you can use externally to claim resources like the display. This will prevent screen blanking. But if it is your own application I would recommend claiming the same display resources within your software.
more about fsoraw and resources
It is possible to do that through the D-BUS API of freesmartphone, it is also possible to prevent suspends.
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy CPU auto
mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy Display auto
Replace auto with enabled or disabled.
‏You can find the documentation for this D-BUS method at http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/org.freesmartphone.Usage.html;hb=HEAD#GetResourcePolicy

Resources