├── DemoPrinterplus ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── libs │ │ └── printcom.aar │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── es │ │ │ └── rcti │ │ │ └── demoprinterplus │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── es │ │ │ │ └── rcti │ │ │ │ └── demoprinterplus │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── values-night │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── test │ │ └── java │ │ └── es │ │ └── rcti │ │ └── demoprinterplus │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── README.md ├── _config.yml ├── img ├── qr_download.png ├── receipt.png ├── text_and_emoji.jpg └── text_format.jpg └── release-notes.md /DemoPrinterplus/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /DemoPrinterplus/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /DemoPrinterplus/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdk 31 7 | 8 | defaultConfig { 9 | applicationId "es.rcti.demoprinterplus" 10 | minSdk 20 11 | targetSdk 31 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | compileOptions { 25 | sourceCompatibility JavaVersion.VERSION_1_8 26 | targetCompatibility JavaVersion.VERSION_1_8 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 32 | implementation 'androidx.appcompat:appcompat:1.4.2' 33 | implementation 'com.google.android.material:material:1.6.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 35 | testImplementation 'junit:junit:4.13.2' 36 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 38 | } -------------------------------------------------------------------------------- /DemoPrinterplus/app/libs/printcom.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcties/PrinterPlusCOMM/ff2e0b99cb5a546911088fc8af4e585749cfa001/DemoPrinterplus/app/libs/printcom.aar -------------------------------------------------------------------------------- /DemoPrinterplus/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/androidTest/java/es/rcti/demoprinterplus/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package es.rcti.demoprinterplus; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("es.rcti.demoprinterplus", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/main/java/es/rcti/demoprinterplus/MainActivity.java: -------------------------------------------------------------------------------- 1 | package es.rcti.demoprinterplus; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import es.rcti.printerplus.printcom.models.PrintTool; 12 | import es.rcti.printerplus.printcom.models.StructReport; 13 | 14 | 15 | public class MainActivity extends AppCompatActivity implements View.OnClickListener { 16 | 17 | private Button btnText, btnTest; 18 | private EditText etMsg; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_main); 24 | 25 | btnTest = (Button) findViewById(R.id.btn_test); 26 | btnText = (Button) findViewById(R.id.btn_text); 27 | etMsg = (EditText) findViewById(R.id.et_msg); 28 | 29 | btnText.setOnClickListener(this); 30 | btnTest.setOnClickListener(this); 31 | } 32 | 33 | @Override 34 | public void onClick(View v) { 35 | if ( v == btnTest ) { 36 | sendTest(); 37 | } else if (v == btnText) { 38 | sendText(); 39 | } 40 | } 41 | 42 | private void sendText() { 43 | if ( !etMsg.getText().toString().isEmpty() ) { 44 | PrintTool.sendOrder( this, getTextSR() ); 45 | } else { 46 | Toast.makeText(this, "Write some text!", Toast.LENGTH_LONG).show(); 47 | } 48 | } 49 | 50 | private void sendTest() { 51 | PrintTool.sendOrder( this, getTestSR() ); 52 | } 53 | 54 | /* 55 | ----------------------------------------------------------------------------- 56 | THIS IS HOW TO CREATE REPORTS ZONE 57 | ----------------------------------------------------------------------------- 58 | */ 59 | 60 | private StructReport getTestSR() { 61 | StructReport msr = new StructReport(); 62 | 63 | //SOME PREVIOUS CONFIGURATION 64 | msr.addItemAlignment( StructReport.ALIGNMENT_LEFT ); 65 | msr.addTextBold(false); 66 | msr.addTextUnderlined(false); 67 | msr.addItemSizeFont( StructReport.SIZE_FONT_1 ); 68 | 69 | //TEXT PRINT 70 | msr.addText("TESTING ..."); 71 | 72 | //SOME CHANGES 73 | msr.addItemSizeFont( StructReport.SIZE_FONT_2 ); 74 | msr.addText("TESTING ..."); 75 | msr.addItemSizeFont( StructReport.SIZE_FONT_3 ); 76 | msr.addText("TESTING ..."); 77 | 78 | //OTHER CHANGES 79 | msr.addItemSizeFont( StructReport.SIZE_FONT_1 ); 80 | msr.addTextReverseMode(true); 81 | msr.addItemAlignment( StructReport.ALIGNMENT_CENTER ); 82 | msr.addText("TEXT CENTERED"); 83 | 84 | msr.addItemAlignment( StructReport.ALIGNMENT_RIGHT ); 85 | msr.addText("TEXT ON RIGHT"); 86 | 87 | msr.addTextReverseMode(false); 88 | 89 | msr.addBarcodeHRI( StructReport.BARCODE_HRI_BELOW ); 90 | msr.addBarcodeData( "1234567890128" ); 91 | 92 | msr.addItemAlignment( StructReport.ALIGNMENT_CENTER ); 93 | msr.addBarcodeHRI( StructReport.BARCODE_HRI_ABOVE ); 94 | msr.addBarcodeData( "1234567890128" ); 95 | 96 | msr.addItemAlignment( StructReport.ALIGNMENT_LEFT ); 97 | msr.addBarcodeHRI( StructReport.BARCODE_HRI_NONE ); 98 | msr.addBarcodeData( "1234567890128" ); 99 | 100 | //ADDING FEEDS 101 | msr.addText("\n\n\n"); 102 | 103 | //FINISHING AND CUT 104 | msr.addCutType( false ); 105 | msr.addCut(); 106 | 107 | return msr; 108 | } 109 | 110 | private StructReport getTextSR() { 111 | StructReport msr = new StructReport(); 112 | 113 | //SOME PREVIOUS CONFIGURATION 114 | msr.addItemAlignment( StructReport.ALIGNMENT_LEFT ); 115 | msr.addTextBold(false); 116 | msr.addTextUnderlined(false); 117 | msr.addItemSizeFont( StructReport.SIZE_FONT_1 ); 118 | 119 | //GET AND SEND DATA FROM EDIT TEXT 120 | msr.addText(etMsg.getText().toString()); 121 | 122 | //FINISHING 123 | msr.addCutType( true ); 124 | msr.addCut(); 125 | 126 | return msr; 127 | } 128 | } -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /DemoPrinterplus/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | 25 |