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

  • Home
  • SEARCH
  • 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 7027127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:12:25+00:00 2026-05-28T00:12:25+00:00

In Android applications, resources are specified in xml documents, which automatically are built into

  • 0

In Android applications, resources are specified in xml documents, which automatically are built into the R class, readily accessible within the source code as strongly typed.

Is there any way I could use a similar approach for a regular Java desktop application?

What I’d like to accomplish, is both the removal of strings from the code (as a separation of “layers”, more or less) and to make it easy to add support for localization, by simply telling the program to choose the xml file corresponding to the desired language.

I’ve googled around a bit, but the things I’m looking for seem to be drowning in results about parsing or outputting xml, rather than tools utilizing xml to generate code.

  • 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-28T00:12:26+00:00Added an answer on May 28, 2026 at 12:12 am

    Eclipse’s message bundle implementation (used by plugins for example) integrates with the Externalize Strings feature and generates both a static class and a resource properties file for your strings:

    http://www.eclipse.org/eclipse/platform-core/documents/3.1/message_bundles.html

    For this integration to work Eclipse needs to see org.eclipse.osgi.util.NLS on the class path. From memory, the dependencies of the libraries it was available in were a little tricky for the project I used this approach in, so I just got the source and have it as a stand-alone class in my core module (see the comments for more on that).

    It provides the type safety you’re looking for and the IDE features save a lot of time. I’ve found no downsides to the approach so far.

    Edit: this is actually what ghostbust555 mentioned in the comments, but not clear in that article that this isn’t limited to Eclipse plugins and you refer to your resources via static members of a messages class.

    I haven’t seen any mention of others using this approach with their own applications, but to me it makes complete sense given the IDE integration and type safety.

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

Sidebar

Related Questions

I have an Android project that branched into three different applications, app-1 , app-2
I have 2 android applications that share 95% of their resources, layouts, strings etc.
I have developed some reusable android component which is basically a class . This
There are some string resources in my android application and some helper-classes, which are
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I keep hearing that Android applications should try to limit the number of objects
How can we use Web services in Android Applications?
I've already written some small Android Applications, most of them in one Activity and
I want to develop applications on Android. Can the SDK be installed on Mac?
J2ME Polish claims to support porting of existing J2ME applications to Android . Has

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.