Android file name maximum length

I am trying to give a name to the file that I am creating. I just want to know what is the maximum length of a file name in Android?

Is there a file name specification? Can I use characters like - or > ?

+19
android
Nov 03
source share
3 answers

About the characters: Reading here , it seems that - not a reserved character, so it can be used. > however reserved so cannot be used.

About maximum length: since I could not find anything specific for Android, and since java does not limit the length of the file name, it works with (as you can see here ), I would say that the maximum length is similar to the most widely used limit, which is 255 bytes.

+12
Nov 03 '12 at 1:21
source share

It seems unsafe to use 127 byte tags on Android. AFAIK, the limit of 255 is the target, but is WIP. I messed up my Galaxy Tab 10.1 sdcard file system last week when music sync software generated several file names of around 160 characters. Limiting the file names to 127 solved the problem. Be safe if you are unsure of your particular release ... stick to limit 127.

+19
Jun 10 '13 at 13:57
source share

In the specific case of resource names, such as images, I found that the maximum length is 100 characters, including the extension. I tested this in the beta version of Android Studio 1.2. I am sure there should be something in the documentation on Android.

+1
Apr 6 '15 at 7:40
source share



All Articles