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 Studio WebView start in full screen #566

Open
Alestore opened this issue Oct 26, 2022 · 10 comments
Open

Android Studio WebView start in full screen #566

Alestore opened this issue Oct 26, 2022 · 10 comments

Comments

@Alestore
Copy link

Only this remains to be solved for the Android environment of TurboWarp Packager: in the guide #224 of packaging in Android using Android Studio and Kotlin it is indicated to use "Empty activity" as a model. This model works fine as expected, but leaves the smartphone status bar visible at the top of the screen. I have not tried to choose the "Full screen activity" model for fear of having some incompatible code with the guide (I am not very familiar with Android Studio and Kotlin).
Is there any way to bring up the full screen?

@GarboMuffin
Copy link
Member

Something here should be able to help you: https://developer.android.com/training/system-ui/status

Again, don't have a way to test this myself right now. Just try those things there and one of them should eventually work, or I'll figure it out this weekend

@Alestore
Copy link
Author

Something here should be able to help you: https://developer.android.com/training/system-ui/status

Again, don't have a way to test this myself right now. Just try those things there and one of them should eventually work, or I'll figure it out this weekend

It works perfectly. A thousand thanks!

I would say that for now you can try to launch support on the Android packager for the others too or would you rather wait to fix something more?

@GarboMuffin
Copy link
Member

The thing with the Android support PR is that

  • It's not automated like the others (probably can't be, though)
  • I'm not entirely confident in my ability to maintain and provide support for the Android environment

but we'll see, I'll put revisiting it on the weekend list

@Alestore
Copy link
Author

Alestore commented Oct 27, 2022

The thing with the Android support PR is that

  • It's not automated like the others (probably can't be, though)
  • I'm not entirely confident in my ability to maintain and provide support for the Android environment

but we'll see, I'll put revisiting it on the weekend list

For automated export to the Android environment I doubt this is possible. I think it's comfortable as it is, just follow the guide and I think anyone would be able to copy two lines of code and paste them in the right places. For other settings like changing the app icon, version etc. just add the procedure to the guide (it is very easy and fast), as well as I would add to the guide the line of code necessary to save the Cloud variables and maybe even say how you can put the full screen hiding the status bar.

Android Studio is very convenient especially for being able to publish an application on the Google Play Store for a paltry price (€ 25 here in Italy) having your own key.

As for the support to offer it depends a lot on what a specific user will want, as I see it at the moment it does what it has to do and it does it very well.

Regarding the guide you wrote on GitHub at #224 I encountered only one "problem": it is indicated to export the project as a zip file from the packager, yet doing so when the app is started there is the error message saying that the zip environment should be used on websites. By doing a classic HTML export it works correctly.

@Alestore
Copy link
Author

Alestore commented Nov 2, 2022

@GarboMuffin I know it may not be within your knowledge and you may not be able to support me with this, but it seems my app is working only on my phone (an Oppo Reno 4Z 5G with 8GB of RAM).

When I try to launch the app on my friend's Redmi Note 8 Pro (6 GB of RAM) and similar devices, the app starts correctly but once the initial loading of the project packaged by TurboWarp in HTML is completed, the app crashes.
I have tried on many phones and it seems that only mine is working properly.

I have no idea why, the generated apk weighs around 130MB and when I play the project in the APK it takes 2GB of RAM.

I don't know if it hits or not, but you mentioned that the packager uses a large string instead of using bytes, and for that reason I could no longer package large projects which took a lot more GB of RAM in #528. Maybe it also takes more RAM?

@GarboMuffin
Copy link
Member

@Alestore Does the project work on your friend's phone if you send them an HTML file or load the project in online TurboWarp?

On a somewhat related note, you may be interested in following TurboWarp/desktop#495

@Alestore
Copy link
Author

@Alestore Does the project work on your friend's phone if you send them an HTML file or load the project in online TurboWarp?

On a somewhat related note, you may be interested in following TurboWarp/desktop#495

Nop it doesn't work and the browser crashes at loading complete, I guess that it has no more RAM and crashes.

As for the idea of ​​having Sprites loaded individually at different times with the extension blocks, I find it great because doing so would drastically reduce the initial loading times.

My only concern is that in any case sooner or later we will have to load all the sprites and at that point there will not be enough RAM and it will crash again.
Could we maybe unload sprites when not required? And how it will work when a Sprite is loaded, it will take some time to do so and it won't be immediate so we will put a loading screen similar to the initial one from the packager?

@GarboMuffin
Copy link
Member

GarboMuffin commented Nov 20, 2022

Yes, we will need to have an unload block

Sprite loading will not be instant. You will probably have to implement your own "Loading..." screen.

@Djidjey
Copy link

Djidjey commented Nov 24, 2022

Did the image will be load in the RAM ? Allowing not having "lag spike" when displayed for the first time ?
And perfect, i already made "Loading..." screen, even if actually they are useless

@Alestore
Copy link
Author

Alestore commented Dec 18, 2022

Something to do with the WebView: I noticed that when I connect a Bluetooth controller to my phone and start the HTML game in the APK's WebView, the controller (using the extension from https://extensions.turbowarp.org/gamepad.js) works and responds correctly, but on the screen appears a sort of gray "filter", I don't know what to call it. It's not as intrusive, but it makes the colors softer and less bright. I enclose some screenshots in comparison to the problem.

Controller isn't connected:

image

Controller is connected:

image

Also, the controller rumble seems not to work in the application. I'm using a Nintendo Switch Pro Controller via Bluetooth on a Oppo Reno 4Z 5G.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants