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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:05:10+00:00 2026-05-29T06:05:10+00:00

When we create a simple android app, we can find MainActivity.java in src/com.app.main and

  • 0

When we create a simple android app, we can find MainActivity.java in src/com.app.main and R.java in gen/com.app.main (Also, you can define another file or package name, but the format is similar). and from all the indication i found in the code, it seems that src/com.app.main && gen/com.app.main means the same package. why? IMO package is only a folder, and MainActivity.java is in the folder src/com/app/main, R.java is in the folder gen/com/app/main, obviously two different folders, and i think that two different folders mean two different package, anything wrong?

  • 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-29T06:05:11+00:00Added an answer on May 29, 2026 at 6:05 am

    First of all, package is not a folder. Source file belongs to the package indicated by the package clause at the first line of that file. Creating folder structure that corresponds to the package structure is just a convention.

    Secondly, when mapping folders to packages folders are treated as relative to their respective base source folders. In your case there are two source folders: src for your sources and gen for generated sources, and both folders contain subfolders that correspond to the same package.

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

Sidebar

Related Questions

I'm trying to create a ProgressDialog for an Android-App (just a simple one showing
I am trying to create a simple 3-D app for android that will have
I going through a simple tutorial to create a very small android app in
I am attempting to create a simple app that can send a text message
I am trying to create a simple test app that basically extends the Android
I have created a small and simple android app. I tried installing it on
I'm trying to create an app for Android that simply sends a command to
I am trying to create a simple Android application that has a ActivityList of
I recently discovered that I can use lambdas to create simple event handlers. I
I have developed a very simple Android native app to launch my HTML5 webapp.

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.