<- ReadMe.html

goodViberations blog

Introduction

This file is maintained as the project progresses. The most recent entry is at the top of this file, the oldest at the bottom. This is how a blog works, I think.

The project sources can be found on GitHub: https://github.com/jplatipus/goodViberations

17 Dec 2025: git tag v4.0

I am now working on tag v4.0.

The following is to be carried out:

I did not know where html assets should be placed in the project, so I asked the agent:

where in the project should I put help files which are displayed to the user in the HelpActivity?

The agent responded with the following helpful answer:

For help files, especially HTML content, the best practice is to place them in the assets directory. In your project, this would be located at /pathToThisProject/goodViberations/app/src/main/assets. If this folder doesn't exist, you should create it.

You can then access these files in your HelpActivity by using the AssetManager.

The agent's context has been cleared. I intend generate to code again from the specs.

At this point I believe that everything intended for this build is now in place. It is time to ask the agent to perform the changes.

The agent generated the UI code but did not add appcompat = "1.7.1". I asked Gemini to do this, it claimed to have updated my gradle files, but it did not. So I did it manually

Adding the appcompat resolves the compilation errors.

I noticed that there is no code to generate a preview of each UI class. I asked Gemini to do this, but it did not. Gemini listed the code that it claimed to have added:


    @Preview(showBackground = true, name = "About Activity Preview")
    @Composable
    fun AboutActivityPreview() {
        // This Composable wraps the XML layout for previewing.
        AndroidView(
            factory = { context ->
                // Inflate the XML layout using the activity's context.
                android.view.View.inflate(context, R.layout.activity_about, null)
            },
            update = { view ->
                // You can add logic here to update the view in the preview if needed.
                // For example, finding a button and setting its text.
            }
        )
    }
I did it manually. and repeated the process for each class in the com.j3t.dataentryapp.ui package. THis involved pasting the method, changing its name and updating the call to android.view.View.inflate() to reflect the layout that should be previewed.

The code compiles, and is previewed in the Android Studio IDE. The code generated has generated member variables for the widgets. All looks good, so the tag v3.0 can be pusehd to GitHub.

16 Dec 2025: git tag v3.0

Code refactoring to move activity classes

As mentioned in tag v2.0, all the classes are in com.j3t.dataentryapp. The classes should be moved to com.j3t.dataentryapp.ui.activities.

The first prompt given to the agent was:

can you move all the activity classes to the package com.j3t.dataentryapp.ui.activities

The agent duly refactored the code and manifest to the new package structure without moving the files.

The next prompt was:

you also need to move the activity files to the ui folder

The agent duly moved the activity files to the correct folder.

The UIActivities.html file has been updated to reflect the new package structure. It is hoped that by doing so, a fresh code generation request will place the files in the correct package and folder. This has not been tried, as the code is already there at present.

The project has been compiled (build menu -> assemble app run configuration). The code compiled without a hitch. Once built, each generated UI activity is opened, a preview is displayed, which is very helpful: it is possible to see what the initial UI looks like, and it is also possible to see if each activity has the widgets (buttons, text fields, lists...) that it should have. Everything looks good. Below is a screenshot of Android Studio's preview:

v3_0_review_generated_UI_code.png
Preview of generated UI code.

Improve the documentation styles

A stylesheet (doc/img/styles.css) has been added to the project. This file defines the default font, page border, colours and a few other styles to make the documentation more attractive to me. Each HTML file has been updated to link to the stylesheet.

GitHub displays HTML files in the raw format. The project's readme file on GitHub, which must be in Markdown, has a hyperlink to my website (www.j3ltd.com), where the documentation can be viewed using a standard web browser.

15 Dec 2025: git tag v2.0

I am now working on tag v2.0, adding the ui specification (UIActivities.html), and a start for the functionality specification (Functionality.html). It is expected that the specs will be updated over the course of this project. Each addition to this blog should be accompanied by a git tag, in this way it is possible to get a snapshot of the project that matches the blog entry.

All the screens (activities) of the app are now described in UIActivities.html.

The data layer has been moved to DataLayer.html, a brief description of the data structure (list of entries) has been started on.

The functionality has not really been started on, it has a placeholder as described in Functionality.html.

At this point it is possible to run the agent on the specification files. The expected output is a set of class files for the UI and data layer. Once generated these can be reviewed to see what Gemini has created. This gives me the opportunity to get acquainted with using the IDE to preview UI classes and to learn a bit of Kotlin, from a consumer's viewpoint.

The following prompt is given, it was suggested by the IDE's smart code suggestion:

can you generate the code for the ui specification?

v2_0_ui_spec_generated_code.png

It looks like it generated the classes I hoped for, they now need to be reviewed: I hope to be able to preview them in the IDE.

One class and class file was generated per activity. It may be worth specifying a package to put these classes in, at present all the classes are in com.j3t.dataentryapp. It would be better in com.j3t.dataentryapp.ui.activities

Conversation to generate ui classes using the agent.

In the beginning (git tags v1.0 and v2.0)

I've created a new android app using Android Studio, and pushed it to git with the tag v1.0