Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * 
 * BarcodeOverIP (Android < v4.0.3) Version 1.1.0
 * Copyright (C) 2013, Tyler H. Jones (me@tylerjones.me)
 * http://boip.tylerjones.me/
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Filename: Common.java
 * Package Name: com.tylerhjones.boip.client
 * Created By: Tyler H. Jones on Feb 1, 2012 at 2:28:24 PM
 * 
 * Description: Common functions and variable declarations (constants)
 */

import java.util.Hashtable;

public class Main {
    public static Hashtable<String, String> errorCodes() {
        Hashtable<String, String> errors = new Hashtable<String, String>(13);
        errors.put("ERR1", "Invalid, null or missing data was passed by the client! (ErrCode=1)");
        errors.put("ERR2", "Invalid or missing data separator in client data. (ErrCode=2");
        errors.put("ERR3",
                "Data not formatted properly for the parser. Possible command/syntax mismatch. (ErrCode=3)");
        errors.put("ERR4", "Cient passed no discernable data. Possibly null. (ErrCode=4)");
        errors.put("ERR5",
                "Parsing Failed!! Client passed non-parsable data. No parameters/data-blocks were found, looks like data, really just gibberish. (ErrCode=5)");
        errors.put("ERR6", "Authentication: Invalid, missing or garbled command syntax! (ErrCode=6)");
        errors.put("ERR7",
                "Access to server denied! Reason: Server may be deactivated or have too many clients. (ErrCode=7)");
        errors.put("ERR8", "Authentication: IO exception occured while communicating with the server. (ErrCode=8)");
        errors.put("ERR9", "Invalid password was passed by the client, double check and try again. (ErrCode=9)");
        errors.put("ERR20", "SendBarcode: Received invalid, garbled or unknown response from server. (ErrCode=20)");
        errors.put("ERR21",
                "SendBarcode: Unknown exception occured while communicating with the server. (ErrCode=20)");
        errors.put("ERR99", "General Unknown exception has occured. (ErrCode=99)");
        errors.put("ERR50", "Invalid Host/IP. (ErrCode=50)");
        errors.put("ERR51", "Cannont connect to server. (ErrCode=51)");
        errors.put("ERR52", "Server Timeout, Too busy to handle request! (ErrCode=52)");
        errors.put("ERR101",
                "Server encountered an unknown error when attempting to 'type' the barcode. (ErrCode=101)");
        return errors;
    }
}