Android Documentation


Get Started

Learn how to configure settings for android ChecOut, such as creating new project or using sdk.

Android Application Development

  • Install Android Studio

    Android Studio is the official IDE for Android application development. During installation, when prompted install Android 6.0 Marshmallow (API 23) SDK.

    Windows android-studio-bundle-162.4069837-windows.exe
    Mac OS X android-studio-ide-162.4069837-mac.dmg
    Linux android-studio-ide-162.4069837-linux.zip
  • Install IntelliJ IDEA

    This is an alternate IDE for Android by JetBrains. Only one of the two IDEs need to be installed. During installation, when prompted install Android 6.0 Marshmallow (API 23).

    Windows Version: 2017.1.4
    Mac OS X Version: 2017.1.4
    Linux Version: 2017.1.4
  • Setup AVD

    Download SDK Download sdk and unzip v1.0
    Windows Inside the checout-android-sdk/avd folder, double click and run:

    avd.bat

    Linux Inside the checout-android-sdk/avd folder, execute this command from terminal:

    bash avd.sh

    Repair Device After running above script you will see Repair Device under Actions column of your Android Virtual Device Manager in front of our new avd Checout_API_23



    Follow steps below to fix this issue
    1. Click Repair Device
    2. Click Change in front of (Device Name) "No Hardware Profile Selected"



    3. Click Import Hardware Profile



    4. Select file device.xml inside the checout-android-sdk/avd folder
    5. Select imported profile



    6. And click ok



    7. Make sure the profile has added



    8. And click Finish
    9. Make sure the Action column has action buttons now

  • AVD Manager

    Open AVD Manager and find avd with the name Checout_API_23, click play button

  • Barcode Scanner

    Unzip checout-android-sdk/barcode/SnapiScanner.zip
    Start Android IDE
    Select option to open existing Android Project
    Browse "checout-android-sdk/barcode/SnapiScanner" folder for and than click OK
    Run the Project
    Select ChecOut Emulator when prompted
  • Payment Manager

    Unzip checout-android-sdk/payment/Payment.zip
    Start Android IDE
    Select option to open existing Android Project
    Browse "checout-android-sdk/payment/Payment" folder for and than click OK
    Run the Project
    Select ChecOut Emulator when prompted
  • Download SDK

    This SDK contains live and sandbox SDK   setup file and documention for Barcode Scanner Library that will help in developing ChecOut applications.

    Download v1.0
  • Unzip SDK

    Unzip SDK

     

    1. It contains a directory with the name barcode

    2. barcode contains Android Scanner SDK .aar(s) and .apk in .zip file and documentation .pdf file and demo application in SnapiScanner.zip file

    3. barcode also contains gpio directory to manage scanner activities

  • Setup Live Library

    1. Open Android Studio and create new Project with Minimum SDK: API level 19 or more
    2. In Android Studio open build.gradle (Module: app) file make sure it has com.android.support:appcompat-v7 at 25.3.1 or above
    compile 'com.android.support:appcompat-v7:25.3.1'
    3. Open the application folder in your file system. Navigate to your /app/libs/ and copy the barcode_scanner_library_v2.0.8.0.aar and gpio_lib.aar files
    4. In Android Studio open build.gradle (Module: app) file and copy following code above dependencies node
    repositories {
      flatDir {
        dirs 'libs'
      }
    }
    and following lines in dependencies node
    compile(name:'barcode_scanner_library_v2.0.8.0', ext:'aar')
    compile(name:'gpio_lib', ext:'aar')

  • Setup Sandbox Library

    1. Open Android Studio and create new Project with Minimum SDK: API level 19 or more
    2. In Android Studio open build.gradle (Module: app) file make sure it has com.android.support:appcompat-v7 at 25.3.1 or above
     compile 'com.android.support:appcompat-v7:25.3.1'
    3. Open the application folder in your file system. Navigate to your /app/libs/ and copy the barcode_scanner_sandbox_v2.0.8.0.aar and gpio_lib.aar files
    4. In Android Studio open build.gradle (Module: app) file and copy following code above dependencies node
     repositories {
       flatDir {
         dirs 'libs'
       }
     }
    and following lines in dependencies node
     compile(name:'barcode_scanner_sandbox_v2.0.8.0', ext:'aar')
     compile(name:'gpio_lib', ext:'aar')
     compile 'me.dm7.barcodescanner:zxing:1.9.8'

    5. Note that we have added an extra dependency for our sandbox library to work i.e. me.dm7.barcodescanner:zxing:1.9.8
  • Integrate Library

    1. Create new class BaseActivity and following code
    public class BaseActivity extends AppCompatActivity implements IDcsSdkApiDelegate {
      @Override
      public void dcssdkEventScannerAppeared(DCSScannerInfo dcsScannerInfo) {
    
      }
    
      @Override
      public void dcssdkEventScannerDisappeared(int i) {
    
      }
    
      @Override
      public void dcssdkEventCommunicationSessionEstablished(DCSScannerInfo dcsScannerInfo) {
    
      }
    
      @Override
      public void dcssdkEventCommunicationSessionTerminated(int i) {
    
      }
    
      @Override
      public void dcssdkEventBarcode(byte[] bytes, int i, int i1) {
    
      }
    
      @Override
      public void dcssdkEventImage(byte[] bytes, int i) {
    
      }
    
      @Override
      public void dcssdkEventVideo(byte[] bytes, int i) {
    
      }
    
      @Override
      public void dcssdkEventFirmwareUpdate(FirmwareUpdateEvent firmwareUpdateEvent) {
    
      }
    }
    2. Extend your MainActivity class with BaseActivity class, now follow Api Docs for Android

Setup Payment Manager SDK

  • Download SDK

    This SDK contains payment SDK for developing ChecOut applications. It contains the setup file and documention of the scanner & payment sdk

    Download v1.0
  • Unzip SDK

    Unzip SDK

     

    1. It contains a directory with the name payment

    2. payment contains checout .aar in .zip file and documentation .pdf file and demo application in Payment.zip file

  • Setup Live Library

    1. Open Android Studio and create new Project with Minimum SDK: API level 19 or more
    2. Open the application folder in your file system. Navigate to your /app/libs/ and copy the checout.aar file
    3. In Android Studio open build.gradle (Module: app) file and copy following code above dependencies node
    repositories {
      flatDir {
        dirs 'libs'
      }
    }
    and following lines in dependencies node
    compile(name:'checout', ext:'aar')

    4. Initialize PaymentManager in the MainActivity class
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      PaymentManager paymentManager = PaymentManager.getManager(MainActivity.this, this);
    }
    5. For complete documentation check Api Docs for Android