When I click on trigger in WT6300(Abdroid 11) It does not give us callback response as fast as WT6000. For example when I double click on Triger it always give us one time callback in onStatus() function.
Related
I am trying to receive the scanned barcode result from a device paired via (Bluetooth/USB) to an android device.
so many topics said :
most plug-in barcode scanners (that I've seen) are made as HID profile devices so whatever they are plugged into should see them as a Keyboard basically.
source
So I am using this code to receive the result of the scan:
#Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (viewModel.onTriggerScan()) {
//1
char pressedKey = (char) event.getUnicodeChar();
viewModel.addCharToCode(pressedKey);
//2
String fullCode = event.getCharacters();
viewModel.fullCode(fullCode);
//check if the scan is done, received all the chars
if (event.getAction() == EditorInfo.IME_ACTION_DONE) {
//does this work ?
viewModel.gotAllChars();
//3
String fullCode2 = event.getCharacters();
viewModel.fullCode(fullCode2);
}
return true;
} else
return super.dispatchKeyEvent(event);
}
Note: I don't have a barcode scanner device for the test.
which code will receive the result ?? (1 or 2 or 3 ?)
You won't ever see an IME_ACTION_DONE, that's something that's Android only and an external keyboard would never generate.
After that, it's really up to how the scanner works. You may get a full key up and key down for each character. You may not, and may receive multiple characters per event. You may see it finish with a terminator (like \n) you may not- depends on how the scanner is configured. Unless you can configure it yourself or tell the user how to configure it, you need to be prepared for either (which means treating the data as done either after seeing the terminator, or after a second or two once new data stops coming in.
Really you need to buy a configurable scanner model and try it in multiple modes and make ever mode works. Expect it to take a few days in your schedule.
Workaround solution but it works 100%.
the solution is based on clone edittext (hidden from the UI), this edit text just receives the result on it, adds a listener, and when the result arrives gets it and clears the edittext field. An important step, when you try to receive the result(trigger scan) make sure that edittext has the focus otherwise you wil not get the result.
Quick steps:
1- create editText (any text field that receives inputs) in your layout
2- set its visibility to "gone" and clear it.
3- add onValueChangeListener to your edittext.
4- focus your edittext when you start trigger the scan
5- each time you the listener call, get the result and clear edittext
Note: never miss to focus your edittext whenever you start trigger scan.
Note: this method work(99%) for all external scan device and any barcode type.
I am using the examples from https://developer.glympse.com/docs/core/client-sdk/downloads link.
I tried the GlympseSendDemo and GlympseCreateDemo using Android Studio(without any changes apart from editing the temporary developer API key that I created by creating an account online).
When I run both examples, I get a
"Failed to create"
message. What could be wrong with this?
EDIT 1
Debugging both the samples, the _glympse member is null when it hits the breakpoint i set at createGlympse() method of GlympseWrapper class.
EDIT 2
The GE.PLATFORM_STOPPED event from the Glympse SDK is getting fired that causes the _glympse variable to be set to null through the call GlympseWrapper.instance().clear();.
So my question is why is this event getting fired within a few seconds of the app starting up?
Try setting a breakpoint in GlympseWrapper.clear(). I suspect the platform is stopping after starting causing _glympse to be set to null. If that's happening, double check the api key is entered correctly.
_glympse = GlympseFactory.createGlympse(context, BASE_URL, API_KEY);
// Also try adding this line here to get some additional log information
_glympse.overrideLoggingLevels(CoreConstants.INFO, CoreConstants.INFO);
I am developing an application for my friend who is in sales, this application will make phone calls one after another, as soon as one phone call gets disconnected, it will automatically make call to another number from the list. This list can be read from and xml data source or json or mongodb or even from excel sheet.
This could be an ios app that reads data from an end point and stores them and can initiate the call at any point and it wont stop until all the calls are made.
Next call will be made only after the first call has been finished.
I am thinking about using node based web app using google voice to trigger the chain.
I've no experience with ios / android apis but Im willing to work on that if it's a viable thing on that platform.
Note: what we're trying to avoid is whole process of
looking up the phone number.
touch hangup and then click for another phone number.
It should self trigger the next call as soon as current call gets disconnected.
Also we're trying to avoid any paid services like twillo.
Thanks in advance :)
for IOS, you could use CTCallCenter
self.callCenter = [[CTCallCenter alloc] init];
self.callCenter.callEventHandler = ^(CTCall *call){
if ([call.callState isEqualToString: CTCallStateConnected])
{
//NSLog(#"call stopped");
}
else if ([call.callState isEqualToString: CTCallStateDialing])
{
}
else if ([call.callState isEqualToString: CTCallStateDisconnected])
{
//NSLog(#"call played");
}
else if ([call.callState isEqualToString: CTCallStateIncoming])
{
}
};
Download phone list, loop inside phone list, make a call, listening for CTCallCenter and appdelegate's Event, detect user have finish last call, our app active again, then make the next call.
Or you can try in Demo here !
Using here.com proprietary code I'm trying to get the list of map packages so that I'll hopefuly know a country ID I'm interested in so I'm using the following code to load all map packages:
MapLoader mapLoader = MapLoader.getInstance();
mapLoader.addListener(mapLoaderListener);
boolean packagesgotten=mapLoader.getMapPackages();
Now the maploaderlistener is supposed to catch the event when this download is complete. So I put some code to output the packages in the onGetMapPackagesComplete method of the listener but it never gets called. No error, nothing. This code is in an AsyncTask as network requests require that.
I am developing a SIP application for making and receiving a call. For that purpose I did analysis on open source project SipDroid. in that project how they catch the value of dialpads pressed button which is sent to the particular method for making a SIP call.
I tried to find the code for that task but I didn't get anything.in which file the code is resides to catch that value in SipDroid project?
The calls in SipDroid are handled by the SipdroidEngine:
org.sipdroid.sipua.SipdroidEngine
The method that handles the initial operation is with signature public boolean call(String target_url,boolean force) - it transfers the call to the SipDroid UserAgent class and so on, until it reaches the network transport layer. Just check the references of this call method in the whole project and see where it's used.
The dialpad values are called DTMF (Dual-tone multi-frequency signaling).
Most of SipDroid's DTMF stuff is in dtmf.h.
You can search through the source code to see where it is used.