Java tutorial
//package com.java2s; import android.support.v4.media.session.PlaybackStateCompat; import java.util.UUID; public class Main { public static final int SIXTH_BITMASK = 32; public static final long leastSigBits = -9223371485494954757L; public static String toUuid128(long assignedNumber) { return toUuid(assignedNumber).toString(); } public static UUID toUuid(String uuidString) { return UUID.fromString(uuidString); } public static UUID toUuid(long assignedNumber) { return new UUID((assignedNumber << SIXTH_BITMASK) | PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM, leastSigBits); } }