The language is java while making an app in android studio.
I am studying from scratch because I am a beginner.
I want to write a program that allows users using the app to freely change the background of the app.

Error message
I don't know how to write a program
Applicable source code

I tried fishing a lot of websites, but I couldn't find them.

Supplemental information (FW/tool version etc.)
  • Answer # 1

    This is not a direct answer. This is the concept of how to achieve this.

    First of all, even if you search for "a program that allows users to change the background of the app freely" as it is, if you break it down into words, there will probably be exactly what you want to do. Hmm.

    Because it is something that the questioner wants to make, not someone else.

    What do you do?

    Subdivide what you want to do = requirements.
    What screen should be used to "Can users change XX freely" (XX is the same for all)
    Change by installing a button? Choose from the prepared ones and change to it?
    Upload an image and adopt it?

    If this is not decided, the screen will not be decided. The screen is a function.
    What is placed where and what kind of movement is given to it.
    The questioner wants to make, so the questioner is also thinking.

    Once the screen is decided, the next step is to subdivide the parts.
    It depends on how detailed your requirements are.
    But don't try to make everything at once.
    For example, "If you press some buttons, the text determined by the buttons will be displayed on the screen"
    ・ Check the display by placing buttons
    ・ Check if the pressed button can be distinguished when the button is pressed
    ・ Check which button can be used to display the same wording on the screen
    ・ Check if the text assigned to each button can be displayed on the screen
    In the form of
    The smaller the parts, the more versatile they can be used.

    From that point of view, make sure what you want to do, subdivide, subdivide the work finely, make a single part, check the operation alone, connect it to the end, and whether it meets the first requirement Please Confirm.

    There is a comment "To the app in production",
    I don't know what kind of app I can do with just the contents of the question.
    It's about adding features, but there are very many cases where you can't just add a little sideways, no matter how simple it is.
    Since there are always parts that depend on the original creation, it is impossible to present "code that works with copy and paste".
    It is impossible even if it is "moving if only the name is changed".

    As I wrote in the answer, sample code that is close to each subdivided work may be on the net.

    Only the questioner knows how far it has been done. What may not have been done.

    Start by embodying requirements.
    The code is written only after the parts to be made are decided.

  • Answer # 2

    Go around with "androidstudio background settings"

  • Answer # 3

    [Android programming introduction # 013] Set the background using images

    File name:background.png

    android: background = "@ drawable/background"

    I was curious, so I tried to go around with"androidstudio background setting"as y_waiwai's answer.
    I haven't used the Android environment at all and haven't verified it at all.

Related articles