Java tutorial
//package com.java2s; /* * oxPush2 is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ import android.util.Base64; public class Main { public static String base64UrlEncode(byte[] arg) { return Base64.encodeToString(arg, 0, arg.length, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING); } }