Implementata libreria di lettura di Zebra.
This commit is contained in:
parent
90d54e4b23
commit
4aa8cef617
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
29
.idea/codeStyles/Project.xml
generated
29
.idea/codeStyles/Project.xml
generated
@ -1,29 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<Objective-C-extensions>
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
</code_scheme>
|
||||
</component>
|
||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
||||
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -13,6 +13,7 @@
|
||||
<option value="$PROJECT_DIR$/dynamic__base" />
|
||||
<option value="$PROJECT_DIR$/dynamic_vgalimenti" />
|
||||
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
||||
<option value="$PROJECT_DIR$/zebrascannerlibrary" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
|
||||
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -8,6 +8,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/dynamic__base/dynamic__base.iml" filepath="$PROJECT_DIR$/dynamic__base/dynamic__base.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" filepath="$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/zebrascannerlibrary/zebrascannerlibrary.iml" filepath="$PROJECT_DIR$/zebrascannerlibrary/zebrascannerlibrary.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -144,6 +144,7 @@ dependencies {
|
||||
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
||||
//Barcode
|
||||
implementation project(':pointmobilescannerlibrary')
|
||||
implementation project(':zebrascannerlibrary')
|
||||
implementation project(path: ':barcode_base_library')
|
||||
}
|
||||
repositories {
|
||||
|
||||
244
app/src/main/assets/EMDKConfig.xml
Normal file
244
app/src/main/assets/EMDKConfig.xml
Normal file
@ -0,0 +1,244 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--This is an auto generated document. Changes to this document may cause incorrect behavior.--><wap-provisioningdoc>
|
||||
<characteristic type="ProfileInfo">
|
||||
<parm name="created_wizard_version" value="7.3.2"/>
|
||||
</characteristic>
|
||||
<characteristic type="Profile">
|
||||
<parm name="ProfileName" value="TC25"/>
|
||||
<parm name="ModifiedDate" value="2019-04-19 17:06:59"/>
|
||||
<parm name="TargetSystemVersion" value="7.1"/>
|
||||
<characteristic type="Barcode" version="6.8">
|
||||
<parm name="emdk_name" value=""/>
|
||||
<parm name="scanner_input_enabled" value="true"/>
|
||||
<parm name="ScannerSelection" value="INTERNAL_LASER1"/>
|
||||
<parm name="use_auto" value="Default"/>
|
||||
<parm name="trigger-wakeup" value="Default"/>
|
||||
<characteristic type="Decoders">
|
||||
<parm name="decoder_upca" value="true"/>
|
||||
<parm name="decoder_upce0" value="Default"/>
|
||||
<parm name="decoder_ean13" value="true"/>
|
||||
<parm name="decoder_ean8" value="true"/>
|
||||
<parm name="decoder_code128" value="true"/>
|
||||
<parm name="decoder_code39" value="Default"/>
|
||||
<parm name="decoder_i2of5" value="true"/>
|
||||
<parm name="decoder_gs1_databar" value="true"/>
|
||||
<parm name="decoder_gs1_databar_lim" value="true"/>
|
||||
<parm name="decoder_gs1_databar_exp" value="Default"/>
|
||||
<parm name="decoder_datamatrix" value="Default"/>
|
||||
<parm name="decoder_qrcode" value="true"/>
|
||||
<parm name="decoder_pdf417" value="Default"/>
|
||||
<parm name="decoder_composite_ab" value="Default"/>
|
||||
<parm name="decoder_composite_c" value="Default"/>
|
||||
<parm name="decoder_microqr" value="Default"/>
|
||||
<parm name="decoder_aztec" value="Default"/>
|
||||
<parm name="decoder_maxicode" value="Default"/>
|
||||
<parm name="decoder_micropdf" value="Default"/>
|
||||
<parm name="decoder_uspostnet" value="Default"/>
|
||||
<parm name="decoder_usplanet" value="Default"/>
|
||||
<parm name="decoder_uk_postal" value="Default"/>
|
||||
<parm name="decoder_japanese_postal" value="Default"/>
|
||||
<parm name="decoder_australian_postal" value="Default"/>
|
||||
<parm name="decoder_canadian_postal" value="Default"/>
|
||||
<parm name="decoder_dutch_postal" value="Default"/>
|
||||
<parm name="decoder_us4state" value="Default"/>
|
||||
<parm name="decoder_us4state_fics" value="Default"/>
|
||||
<parm name="decoder_codabar" value="Default"/>
|
||||
<parm name="decoder_msi" value="Default"/>
|
||||
<parm name="decoder_code93" value="Default"/>
|
||||
<parm name="decoder_trioptic39" value="Default"/>
|
||||
<parm name="decoder_d2of5" value="Default"/>
|
||||
<parm name="decoder_chinese_2of5" value="Default"/>
|
||||
<parm name="decoder_korean_3of5" value="Default"/>
|
||||
<parm name="decoder_code11" value="Default"/>
|
||||
<parm name="decoder_tlc39" value="Default"/>
|
||||
<parm name="decoder_mailmark" value="Default"/>
|
||||
<parm name="decoder_hanxin" value="Default"/>
|
||||
<parm name="decoder_signature" value="Default"/>
|
||||
<parm name="decoder_webcode" value="Default"/>
|
||||
<parm name="decoder_matrix_2of5" value="Default"/>
|
||||
<parm name="decoder_upce1" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="DecoderParams">
|
||||
<characteristic type="UPCA">
|
||||
<parm name="decoder_upca_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_upca_preamble" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="UPCE0">
|
||||
<parm name="decoder_upce0_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_upce0_preamble" value="Default"/>
|
||||
<parm name="decoder_upce0_convert_to_upca" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="EAN8">
|
||||
<parm name="decoder_ean8_convert_to_ean13" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Code128">
|
||||
<parm name="decoder_code128_length1" value="0"/>
|
||||
<parm name="decoder_code128_length2" value="55"/>
|
||||
<parm name="decoder_code128_redundancy" value="Default"/>
|
||||
<parm name="decoder_code128_enable_plain" value="Default"/>
|
||||
<parm name="decoder_code128_enable_ean128" value="Default"/>
|
||||
<parm name="decoder_code128_enable_isbt128" value="Default"/>
|
||||
<parm name="decoder_code128_isbt128_concat_mode" value="Default"/>
|
||||
<parm name="decoder_code128_check_isbt_table" value="Default"/>
|
||||
<parm name="decoder_code128_security_level" value="Default"/>
|
||||
<parm name="code128_enable_marginless_decode" value="Default"/>
|
||||
<parm name="code128_ignore_fnc4" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Code39">
|
||||
<parm name="decoder_code39_length1" value="0"/>
|
||||
<parm name="decoder_code39_length2" value="55"/>
|
||||
<parm name="decoder_code39_verify_check_digit" value="Default"/>
|
||||
<parm name="decoder_code39_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_code39_full_ascii" value="Default"/>
|
||||
<parm name="decoder_code39_redundancy" value="Default"/>
|
||||
<parm name="decoder_code39_convert_to_code32" value="Default"/>
|
||||
<parm name="decoder_code39_report_code32_prefix" value="Default"/>
|
||||
<parm name="decoder_code39_security_level" value="Default"/>
|
||||
<parm name="code39_enable_marginless_decode" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Interleaved_2of5">
|
||||
<parm name="decoder_i2of5_length1" value="14"/>
|
||||
<parm name="decoder_i2of5_length2" value="10"/>
|
||||
<parm name="decoder_i2of5_redundancy" value="Default"/>
|
||||
<parm name="decoder_i2of5_check_digit" value="Default"/>
|
||||
<parm name="decoder_i2of5_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_itf14_convert_to_ean13" value="Default"/>
|
||||
<parm name="decoder_i2of5_security_level" value="Default"/>
|
||||
<parm name="i20f5_enable_marginless_decode" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="GS1_Databar_Limited">
|
||||
<parm name="decoder_gs1_lim_security_level" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Composite_AB">
|
||||
<parm name="decoder_composite_ab_ucc_link_mode" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="US_Postnet">
|
||||
<parm name="decoder_uspostnet_report_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="US_Planet">
|
||||
<parm name="decoder_usplanet_report_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="UK_Postal">
|
||||
<parm name="decoder_uk_postal_report_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Codabar">
|
||||
<parm name="decoder_codabar_length1" value="6"/>
|
||||
<parm name="decoder_codabar_length2" value="55"/>
|
||||
<parm name="decoder_codabar_redundancy" value="Default"/>
|
||||
<parm name="decoder_codabar_clsi_editing" value="Default"/>
|
||||
<parm name="decoder_codabar_notis_editing" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="MSI">
|
||||
<parm name="decoder_msi_length1" value="4"/>
|
||||
<parm name="decoder_msi_length2" value="55"/>
|
||||
<parm name="decoder_msi_redundancy" value="Default"/>
|
||||
<parm name="decoder_msi_check_digit" value="Default"/>
|
||||
<parm name="decoder_msi_check_digit_scheme" value="Default"/>
|
||||
<parm name="decoder_msi_report_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Code93">
|
||||
<parm name="decoder_code93_length1" value="0"/>
|
||||
<parm name="decoder_code93_length2" value="55"/>
|
||||
<parm name="decoder_code93_redundancy" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Trioptic_39">
|
||||
<parm name="decoder_trioptic39_redundancy" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Discrete_2of5">
|
||||
<parm name="decoder_d2of5_length1" value="0"/>
|
||||
<parm name="decoder_d2of5_length2" value="14"/>
|
||||
<parm name="decoder_d2of5_redundancy" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Code11">
|
||||
<parm name="decoder_code11_length1" value="4"/>
|
||||
<parm name="decoder_code11_length2" value="55"/>
|
||||
<parm name="decoder_code11_redundancy" value="Default"/>
|
||||
<parm name="decoder_code11_verify_check_digit" value="Default"/>
|
||||
<parm name="decoder_code11_report_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Han_Xin">
|
||||
<parm name="decoder_hanxin_inverse" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="Matrix_2of5">
|
||||
<parm name="decoder_matrix_2of5_length1" value="10"/>
|
||||
<parm name="decoder_matrix_2of5_length2" value="0"/>
|
||||
<parm name="decoder_matrix_2of5_redundancy" value="Default"/>
|
||||
<parm name="decoder_matrix_2of5_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_matrix_2of5_verify_check_digit" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="UPCE1">
|
||||
<parm name="decoder_upce1_report_check_digit" value="Default"/>
|
||||
<parm name="decoder_upce1_preamble" value="Default"/>
|
||||
<parm name="decoder_upce1_convert_to_upca" value="Default"/>
|
||||
</characteristic>
|
||||
</characteristic>
|
||||
<characteristic type="UpcEanParams">
|
||||
<parm name="upcean_security_level" value="Default"/>
|
||||
<parm name="upcean_supplemental2" value="Default"/>
|
||||
<parm name="upcean_supplemental5" value="Default"/>
|
||||
<parm name="upcean_supplemental_mode" value="Default"/>
|
||||
<parm name="upcean_retry_count" value="10"/>
|
||||
<parm name="upcean_random_weight_check_digit" value="Default"/>
|
||||
<parm name="upcean_linear_decode" value="Default"/>
|
||||
<parm name="upcean_bookland" value="Default"/>
|
||||
<parm name="upcean_coupon" value="Default"/>
|
||||
<parm name="upcean_coupon_report" value="Default"/>
|
||||
<parm name="upcean_ean_zero_extend" value="Default"/>
|
||||
<parm name="upcean_bookland_format" value="Default"/>
|
||||
<parm name="databar_to_upc_ean" value="Default"/>
|
||||
<parm name="upc_enable_marginless_decode" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="ReaderParams">
|
||||
<parm name="aim_mode" value="Default"/>
|
||||
<parm name="beam_timer" value="5000"/>
|
||||
<parm name="Adaptive_Scanning" value="Default"/>
|
||||
<parm name="Beam_Width" value="Default"/>
|
||||
<parm name="power_mode" value="Default"/>
|
||||
<parm name="mpd_mode" value="Default"/>
|
||||
<parm name="reader_mode" value="Default"/>
|
||||
<parm name="linear_security_level" value="Default"/>
|
||||
<parm name="picklist" value="Default"/>
|
||||
<parm name="aim_type" value="Default"/>
|
||||
<parm name="aim_timer" value="500"/>
|
||||
<parm name="same_barcode_timeout" value="500"/>
|
||||
<parm name="different_barcode_timeout" value="500"/>
|
||||
<parm name="illumination_mode" value="Default"/>
|
||||
<parm name="keep_pairing_info_after_reboot" value="Default"/>
|
||||
<parm name="lcd_mode" value="Default"/>
|
||||
<parm name="low_power_timeout" value="250"/>
|
||||
<parm name="delay_to_low_power_mode" value="Default"/>
|
||||
<parm name="illumination_brightness" value="10"/>
|
||||
<parm name="inverse_1d_mode" value="Default"/>
|
||||
<parm name="viewfinder_size" value="100"/>
|
||||
<parm name="viewfinder_posx" value="0"/>
|
||||
<parm name="viewfinder_posy" value="0"/>
|
||||
<parm name="1d_marginless_decode_effort_level" value="Default"/>
|
||||
<parm name="poor_quality_bcdecode_effort_level" value="Default"/>
|
||||
<parm name="charset_name" value="Default"/>
|
||||
<parm name="viewfinder_mode" value="Default"/>
|
||||
<parm name="scanning_mode" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="ScanParams">
|
||||
<parm name="code_id_type" value="Default"/>
|
||||
<parm name="volume_slider_type" value="Default"/>
|
||||
<parm name="decode_audio_feedback_uri" value="/system/media/audio/notifications/optimized-beep.ogg"/>
|
||||
<parm name="decode_haptic_feedback" value="Default"/>
|
||||
<parm name="bt_disconnect_on_exit" value="Default"/>
|
||||
<parm name="connection_idle_time" value="600"/>
|
||||
<parm name="establish_connection_time" value="45"/>
|
||||
<parm name="remote_scanner_audio_feedback_mode" value="Default"/>
|
||||
<parm name="remote_scanner_led_feedback_mode" value="Default"/>
|
||||
<parm name="display_bt_address_barcode" value="Default"/>
|
||||
<parm name="good_decode_led_timer" value="75"/>
|
||||
<parm name="decoding_led_feedback" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="UDIParams">
|
||||
<parm name="enable_udi_gs1" value="Default"/>
|
||||
<parm name="enable_udi_hibcc" value="Default"/>
|
||||
<parm name="enable_udi_iccbba" value="Default"/>
|
||||
</characteristic>
|
||||
<characteristic type="MultiBarcodeParams">
|
||||
<parm name="multi_barcode_count" value="5"/>
|
||||
</characteristic>
|
||||
</characteristic>
|
||||
</characteristic>
|
||||
</wap-provisioningdoc>
|
||||
@ -11,6 +11,7 @@ import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
||||
|
||||
public class BarcodeManager {
|
||||
|
||||
@ -23,7 +24,8 @@ public class BarcodeManager {
|
||||
|
||||
|
||||
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||
PointMobileBarcodeReader.class
|
||||
PointMobileBarcodeReader.class,
|
||||
ZebraBarcodeReader.class
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ public class UtilityBarcode {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
||||
}
|
||||
return tot % 10 == 0 ? "0" : "" +(10-(tot % 10));
|
||||
return tot % 10 == 0 ? "0" : "" + ( 10 - ( tot % 10));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ public interface BarcodeReaderInterface {
|
||||
|
||||
void init() throws BarcodeAdapterNotFoundException;
|
||||
|
||||
void deinit();
|
||||
|
||||
void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed);
|
||||
|
||||
String getAdapterName();
|
||||
|
||||
@ -14,7 +14,7 @@ buildscript {
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
classpath 'com.android.tools.build:gradle:3.4.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
classpath 'com.google.firebase:firebase-plugins:1.1.5'
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Wed Jan 16 12:23:01 CET 2019
|
||||
#Thu Apr 18 18:31:44 CEST 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
|
||||
|
||||
@ -58,6 +58,11 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deinit() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
||||
mOnScanSuccessfull = onScanSuccessfull;
|
||||
|
||||
@ -1 +1 @@
|
||||
include ':app', ':pointmobilescannerlibrary', ':barcode_base_library', ':dynamic_vgalimenti', ':dynamic__base'
|
||||
include ':app', ':pointmobilescannerlibrary', ':barcode_base_library', ':dynamic_vgalimenti', ':dynamic__base', ':zebrascannerlibrary'
|
||||
|
||||
1
zebrascannerlibrary/.gitignore
vendored
Normal file
1
zebrascannerlibrary/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
35
zebrascannerlibrary/build.gradle
Normal file
35
zebrascannerlibrary/build.gradle
Normal file
@ -0,0 +1,35 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
implementation project(path: ':barcode_base_library')
|
||||
}
|
||||
21
zebrascannerlibrary/proguard-rules.pro
vendored
Normal file
21
zebrascannerlibrary/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1,27 @@
|
||||
package it.integry.zebrascannerlibrary;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("it.integry.zebrascannerlibrary.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
2
zebrascannerlibrary/src/main/AndroidManifest.xml
Normal file
2
zebrascannerlibrary/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.integry.zebrascannerlibrary" />
|
||||
@ -0,0 +1,101 @@
|
||||
package it.integry.zebrascannerlibrary;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
|
||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||
import it.integry.plugins.barcode_base_library.extension.RunnableArgs;
|
||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
private static RunnableArgs<BarcodeScanDTO> mOnScanSuccessfull;
|
||||
private static RunnableArgs<Exception> mOnScanFailed;
|
||||
|
||||
private static final String TAG = ZebraBarcodeReader.class.getName();
|
||||
private static final String INTENT_FILTER_STRING = "it.integry.scan_filter";
|
||||
|
||||
public ZebraBarcodeReader(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRightAdapter() {
|
||||
String model = Build.MODEL;
|
||||
if(model.equalsIgnoreCase("TC700H")) {
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() throws BarcodeAdapterNotFoundException {
|
||||
if(isRightAdapter()) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
filter.addAction(INTENT_FILTER_STRING);
|
||||
mContext.registerReceiver(myBroadcastReceiver, filter);
|
||||
} else {
|
||||
throw new BarcodeAdapterNotFoundException(getAdapterName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deinit() {
|
||||
mContext.unregisterReceiver(myBroadcastReceiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
||||
mOnScanSuccessfull = onScanSuccessfull;
|
||||
mOnScanFailed = onScanFailed;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getAdapterName() {
|
||||
return "Zebra";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
|
||||
if (action.equals(INTENT_FILTER_STRING)) {
|
||||
try {
|
||||
dispatchEvent(intent);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private void dispatchEvent(Intent initiatingIntent)
|
||||
{
|
||||
|
||||
String decodedSource = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_source));
|
||||
String decodedData = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_data));
|
||||
String decodedLabelType = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_label_type));
|
||||
|
||||
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
||||
.setByteValue(decodedData.getBytes())
|
||||
.setStringValue(decodedData)
|
||||
.setType(ZebraBarcodeTypeMapper.map(decodedLabelType))
|
||||
.setName(decodedLabelType);
|
||||
// .setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
||||
|
||||
mOnScanSuccessfull.run(barcodeScanDTO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package it.integry.zebrascannerlibrary;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||
|
||||
public class ZebraBarcodeTypeMapper {
|
||||
|
||||
|
||||
public static BarcodeType map(String inputType) {
|
||||
|
||||
switch (inputType) {
|
||||
case "LABEL-TYPE-CODE11":
|
||||
return BarcodeType.CODE11;
|
||||
case "LABEL-TYPE-CODE128":
|
||||
return BarcodeType.CODE128;
|
||||
case "LABEL-TYPE-CODE39":
|
||||
return BarcodeType.CODE39;
|
||||
|
||||
case "LABEL-TYPE-EAN13":
|
||||
return BarcodeType.EAN13;
|
||||
case "LABEL-TYPE-EAN8":
|
||||
return BarcodeType.EAN8;
|
||||
|
||||
case "LABEL-TYPE-UPCA":
|
||||
return BarcodeType.UPCA;
|
||||
case "LABEL-TYPE-UPCE0":
|
||||
return BarcodeType.UPCE;
|
||||
case "LABEL-TYPE-UPCE1":
|
||||
return BarcodeType.UPCE1;
|
||||
default:
|
||||
Log.d("SCAN TYPE", inputType);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
7
zebrascannerlibrary/src/main/res/values/strings.xml
Normal file
7
zebrascannerlibrary/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<resources>
|
||||
<string name="app_name">Zebra ScannerLibrary</string>
|
||||
|
||||
<string name="datawedge_intent_key_source">com.symbol.datawedge.source</string>
|
||||
<string name="datawedge_intent_key_label_type">com.symbol.datawedge.label_type</string>
|
||||
<string name="datawedge_intent_key_data">com.symbol.datawedge.data_string</string>
|
||||
</resources>
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.zebrascannerlibrary;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user