See below, but be aware that the method described does not guarantee uniqueness. There is plenty of discussion about this in the thread, but the bottom line is that operations in Glide are not atomic, so if you need to guarantee uniqueness then you need to offload the allocation of IDs to some 3rd party, and ensure that requests are handled serially.