Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3784074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:19:18+00:00 2026-05-19T11:19:18+00:00

What naming conventions do you use for resource files and IDs and what benefits

  • 0

What naming conventions do you use for resource files and IDs and what benefits do they bring?

It’s very easy for example to end up with a view ID like “activity_settings_location_text_label” but quickly becomes unmanageable and messy. I’ve not seen any guidance from Google on this, did I miss it?

Resources can be “grouped” using hierarchical naming, but what structure works best for each resource type? String, color, dimens, layouts, includes, etc

My naming is currently fairly ad-hoc, and it’s clear I need better structure (particularly so I can find IDs more easily using the IDE’s code-completion).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:19:18+00:00Added an answer on May 19, 2026 at 11:19 am

    The most important thing to remember, I think, is that it’s perfectly fine to use the same ID across multiple layouts. For example, @id/title_bar is clean and generic and works, and so much simpler than @id/settings_title_bar, @id/home_screen_title_bar, @id/search_title_bar and so on.

    I also like to name layouts destinated for activities as @layout/activity_home and @layout/activity_search etc. Drawables and icons should adopt the same standards as Android uses, i.e. @drawable/ic_btn_explode and @drawable/ic_dialog_exploded.

    Includes can be tricky, but simpler ones which consist of only a few elements and serve a single, precise purpose tend to end up as @layout/loading or @layout/error_message.

    I’m still working on naming strings sensibly, but again short, concise names make the whole process a lot easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to decide on naming conventions for a new website. I can use
What naming conventions do you use when creating work items in your task/bug tracking
What naming conventions do you use for everyday code? I'm pondering this because I
Do you know how to use the naming conventions in mysql database? I've downloaded
Is there a comprehensive list of browser autocomplete naming conventions somewhere? I would like
What are the naming conventions for property names defined in properties files in Java?
What are the naming conventions that you use while coding?
There are two popular naming conventions: vc90/win64/debug/foo.dll foo-vc90-win64-debug.dll Please discuss the problems/benefits associated with
What naming conventions do you use for user interface elements (including dialog boxes)? Controls:
Is it a common practice to use special naming conventions when you're denormalizing for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.