Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.os.Build; import android.provider.Settings; public class Main { /** * Generates client ID for Android device. * @param context used to generate hostname. * @return hostname. */ public static String getClientId(Context context) { return Build.MODEL.replaceAll(" ", "-") + "-" + Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); } }