Java tutorial
//package com.java2s; /* * Hewlett-Packard Company * All rights reserved. * * This file, its contents, concepts, methods, behavior, and operation * (collectively the "Software") are protected by trade secret, patent, * and copyright laws. The use of the Software is governed by a license * agreement. Disclosure of the Software to third parties, in any form, * in whole or in part, is expressly prohibited except as authorized by * the license agreement. */ import android.util.Base64; public class Main { private static final String PRINT_METRICS_USER_NAME = "hpmobileprint"; private static final String PRINT_METRICS_PASSWORD = "print1t"; public static String getAuthorizationString() { String authorizationString = "Basic " + Base64.encodeToString( (PRINT_METRICS_USER_NAME + ":" + PRINT_METRICS_PASSWORD).getBytes(), Base64.NO_WRAP); return authorizationString; } }