Encode Password String by base64 - Android File Input Output

Android examples for File Input Output:Base64

Description

Encode Password String by base64

Demo Code


//package com.java2s;

import android.util.Base64;

public class Main {
    public static String EncodeString(String password) {
        //encoding string using Base64 encoder
        byte[] encodedBytes = Base64.encode(password.getBytes(),
                Base64.DEFAULT);/*from   www.  j  a v a 2 s .  c om*/
        return new String(encodedBytes);
    }
}

Related Tutorials