Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android applications derive window title from the app name, not window.title #2015

Closed
freakboy3742 opened this issue Sep 1, 2021 · 8 comments · Fixed by #2058 or #2075
Closed

Android applications derive window title from the app name, not window.title #2015

freakboy3742 opened this issue Sep 1, 2021 · 8 comments · Fixed by #2058 or #2075
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.

Comments

@freakboy3742
Copy link
Member

By default, the formal app name and the window title are the same. However, you can pass title to the constructor for MainWindow; if you do, that name should be the name of the main window.

To Reproduce
Steps to reproduce the behavior:

  1. Create an Android app
  2. Pass in a custom title to the constructor for MainWindow.

Expected behavior

The main window should adopt the value of main_window.title, rather than the app's formal name.

Environment:

  • Operating System: Android
@freakboy3742 freakboy3742 added bug A crash or error in behavior. android The issue relates to Android mobile support. labels Sep 1, 2021
@charlietrumm
Copy link

Can you assign this issue to me?

@freakboy3742
Copy link
Member Author

@charlietrumm Done. If you need any pointers or assistance, let us know!

@charlietrumm
Copy link

I just want to make sure that I know exactly what the bug is. I beleive that the bug is when you supply the window name it is always set to the formal name. This is what I have recreated on the emulator by modifying this line: toga.MainWindow(title="Some Random Title"). I always get the title on android being the formal name (Hello World) even if I supply one with the code above.

@charlietrumm
Copy link

I am looking to fix bugs in briefcase. Is this not a bug with toga?

@freakboy3742
Copy link
Member Author

@charlietrumm You've correctly understood the problem; and yes, some of the solution will probably involve a change to Toga, and may be entirely Toga-based. However, there may also be a need to change the template that Briefcase uses so as to expose a capability that Toga can modify.

@charlietrumm
Copy link

I have been trying for a while to get my Toga code running.

I need to debug toga-android code.
Everytime I build toga-android with briefcase, it will install it with pip and overwrite my own modifications.
This is when I had the idea of editing the briefcase source code to make it not install anything with pip (I just commented out the pip install section).
I thought that this would make it still bundle the application dependencies, and they would be all installed because before I commented out the pip install, it would have installed everything.
But that didn't quite work...
The app crashed on android with: "Not setting RUBICON_LIBRARY" and then: "ModuleNotFoundError: No module named 'rubicon'".
This is running on the emulator.
I cannot fix the issue without being able to debut the toga code.
Thanks for any help in advance.

@freakboy3742
Copy link
Member Author

I'm not sure I completely understand what you're trying to do here, but reading between the lines, I think you're having problems using a "development" version of Toga inside your briefcase project.

If that's the case: You don't need to make any changes to Briefcase. In your briefcase project, modify the requires section in the android section that current reads:

requires = ['toga-android>=0.3.0.dev29']

to read:

requires = ['../../path/to/toga/src/android']

(modifying the path as appropriate to point at your Toga code checkout)

You'll also need to modify the "project-wide" requires block, which will be empty:

requires = []

to read:

requires = ['../../path/to/toga/src/core']

Then re-create, build, and run your Android project.

If that's not what you're trying to describe, you may want to drop into the Discord chat room so we can provide more interactive help.

@freakboy3742 freakboy3742 added the good first issue Is this your first time contributing? This could be a good place to start! label Mar 28, 2022
@freakboy3742
Copy link
Member Author

I'm going to migrate this to Toga, as it appears to be entirely a Toga issue, caused by the fact that set_title() isn't being invoked on MainWindow during application construction.

@freakboy3742 freakboy3742 transferred this issue from beeware/briefcase Jun 26, 2023
@freakboy3742 freakboy3742 removed the good first issue Is this your first time contributing? This could be a good place to start! label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants