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 8669727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:32:48+00:00 2026-06-12T18:32:48+00:00

I am currently working on a project to automatically generate very simple Android apps

  • 0

I am currently working on a project to automatically generate very simple Android apps from UML models. Both the Java parts and the XML parts are working ok, but I have run into a problem: the R.java file.

As I see it, I have to options of generating the R.java file.

  1. The preferred way would be to make the Android SDK generate it for me, based on the XML files. But how could I do that? I can not open Eclipse and choose “Clean project”, as I would normally do, since this is supposed to be an automated process. Is there any command line commands I could run? Something like apk -generateR -/path/R.java would be perfect.
  2. The other possibility I see is to generate it myself, by simply enumerating all resources and outputting a file with the R.java format.

If alternative 2 is the only way, the main issue I have is how to generate the numbers. A typical sequence of items in R.java is as follows:

    public static final int button_buy=0x7f020000;
    public static final int button_search=0x7f020001;
    public static final int cover=0x7f020002;
    ...
    public static final int Artist_name=0x7f05000e;
    public static final int Artist2_name=0x7f05001c;
    public static final int Artist2NameLabel=0x7f05001d;

How is that generated? Are the numbers important? Would everything work now (and in future versions?) if I simply started on zero, and counted my way through them?

    public static final int button_buy=0x00000000;
    public static final int button_search=0x00000001;
    public static final int cover=0x00000002;
    ...
    public static final int Artist_name=0x00000003;
    public static final int Artist2_name=0x00000004;
    public static final int Artist2NameLabel=0x00000005;
  • 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-06-12T18:32:49+00:00Added an answer on June 12, 2026 at 6:32 pm

    You can use ant scripts to build your project. R.java will be generated automatically as if you use “Clean project” option in Eclipse.

    Read more here: http://developer.android.com/tools/projects/projects-cmdline.html

    I wouldn’t recommend to mess around with R.java file directly.

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

Sidebar

Related Questions

I’m currently working on a Android project and is very newbie to the Android
I'm currently working on a Haskell project which automatically tests some functions based on
I'm currently working on project, Android Internet Download Manager. In order to download the
I am currently working on android project where I am using a custom list
I'm currently working on a very small open source project for Maemo 5. (Namely
I am currently working on Project Euler for fun, and use Haskell for practicing.
I am currently working on a project about calculations.I have done the main part
I am currently working on a project that requires me to display PDF documents
I am currently working on a project that implements Azure ACS. I got the
I am currently working on grails project. I have created eight different plugins. Each

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.