0

I was wondering if there are some kind of set guidelines for naming images for iPhone and android.

For example, iPhone image items would usually be named by designers using (lower case letters, nums, @, _).

Regular image resource : colorroll.png

&

Retina image resource :colorroll@2x.png

On the other hand android would usually only use (lower case letters, nums, _) and on mouse over android usually add roll to the name

The main question is whether there are some kind of best guidelines to separate and keep order both for the designer and programmer.

Vad.Gut
  • 521
  • 1
  • 5
  • 19
  • We are all wondering that :-) http://stackoverflow.com/questions/1832290/android-id-naming-convention-lower-case-with-underscore-vs-camel-case – Blundell May 19 '12 at 08:20
  • http://stackoverflow.com/questions/7165582/are-there-conventions-on-how-to-name-resources – Blundell May 19 '12 at 08:20

2 Answers2

2

I recently ported an iOS app to Android that contained over 1,000 resources which are referenced from static XML files (pLists actually). Editing the plists was not an option.

Take a look at the answer from Alex2k8 here

Additionally, ADT does not allow resource file names that contain spaces, uppercase characters or that start with a number (this list may not be exhaustive, they are just the ones that I found amongst these 1000 odd resources.

To deal with this, I wrote a utility which renamed all of the files on disk. It converted the filename to lowercase, substituted illegal characters and spaces with underscores and prefixed "num" on filenames that began with a digit. These files were the ones I placed into my resource folders.

In my app, I wrote a helper function that did the same thing so when I needed to load a resource. I called the helper function to turn the filename from the plist into the legal Android version using the same algorithm then passed that to the framework loaders.

E.g. the iOS file name might be "9. Enlarge view 100m.png". The utility renamed this to num9_enlarge_view_100m.png". The helper function simply uses a string builder with .replace() methods on the iOS filename passed to it as a string argument.

Community
  • 1
  • 1
Simon
  • 14,407
  • 8
  • 46
  • 61
0

IIRC In Android Resource file names are suppose to be all lower case.

Don't quote me on that though, I'm a new Android Dev.

russjr08
  • 881
  • 1
  • 8
  • 16
  • 1
    provide source for information. – NT_ May 19 '12 at 03:58
  • http://www.youtube.com/watch?v=IHg_0HJ5iQo&feature=BFa&list=SP2F07DBCDCC01493A at 0:50 Comment from Similar question "You probably misunderstood what I was trying to say. The compiler will complain if you put resources like a file and write that in camel case. ... " http://stackoverflow.com/questions/1832290/android-id-naming-convention-lower-case-with-underscore-vs-camel-case – russjr08 May 19 '12 at 04:15