Java – Can Mobile Games Use Fragments Instead of SurfaceViews?

All tutorials for Android mobile games (like this one) use the to display game objects. Most other applications usually use one Activity > Layout Resource architecture.

The guide explains why he uses a Activity > SurfaceView Subclass Architecture because of threading and canvasing at this point in the video.

  • Could you use fragments to perform threading and viewing game objects?
  • If so, why is a SurfaceView preferred?

Untagged – Is the iPhone eSim your home or roaming mobile operator?

The XR and XS iPhones are equipped with eSIM functions. For example, suppose the user lives in the US and uses T-Mobile. Does it make sense to use the eSIM with the home provider or with roaming providers in the Caribbean and EU countries?

If I assign the eSIM T-Mobile (USA), can I expect the phone to work just as if it had a standard SIM card?

android – Does a thread in a mobile game serve the same purpose as a view model in a mobile application?

I'm trying to improve my understanding of the coding differences and similarities between mobile phones game Design and mobile app Design for Android devices with Java / Kotlin.


A good design principle in mobile app design is Separation of Concerns, where the app has any number of different classes to serve different purposes. A design architecture divides these concerns into two classes, the "view model" and the "UI controller" (where the UI controller is an activity or a fragment).

The view model should contain code that contains data and makes logical decisions with these data. The UI controller is used to draw this data on the screen of the device and to receive input and operating system events.


In mobile game design, I saw an Activity class, a GameView class (which implements SurfaceView), and a thread subclass. The activity instantiates the GameView class and places the GameView class in its view hierarchy setContentView(GameView(this)), This is different from what the design of mobile apps is setContentView(R.layout.layout_xml_file) is used to provide views

Bitmaps can be drawn on the surface of the GameView object. The GameView object manipulates this interface using surface-specific callback functions much as the UI controller manipulates lifecycle status using lifecycle-specific callback functions. The GameView object also handles user input, such as the UI controller.

The GameView and the UI controller obviously have the same roles.


  • Does a thread in a mobile game have the same purpose as a view model in a mobile app?
  • If not, where should the data and logical decisions go? Are you going to the different bitmap classes?
  • If bitmap classes have the same function as view models, how do they make logical decisions (ie, a Mario object collects a coin object)?

CSS Background Color – Mobile Breakpoint

I'm trying to help for a page – If I scale my desktop browser – smaller than I would try to display it as a tablet / phone. The header is highlighted in red.

How can I make sure that the full desktop version of the header has the same background as the mobile page?

I do not know this template at all and can not figure out why it changes the background colors

mobile – navigate in a double top bar

I found a UX issue on a website I'm designing. I feel like there is an obvious solution, but I'm having trouble finding it.

I have a website with a global bar. In the middle of the site, I have a navigation component with tabs. There are 3 tabs and the windows each contain longer content.

I feel like my users want to be able to navigate between these tabs without having to swipe the page again.

Obviously, I do not want to double-stack horizontal glue sticks. I can not replace or edit the global bar at all.

I am thinking of a collapse to the side option. Or turn it into a carousel with sticky left / right arrows?

Design suggestion

mobile – Treat text overflow in wireframes

That bothered me a lot, how to proceed.

I like to use "ugly data" in my wireframes because my goal is not pretty but functional wireframes. Using simple single-line words is easy and pretty, but not real.

Here are ways to preview longer text before selecting an item:
A list of ways to handle long text in previews
But what if you have a nefarious user who uses Unicode to flood those fields?
Different ways to use Unicode

The first example is the user who uses either one or to create new lines by inaccurately counting a simple character.

The second example is the user who uses a long Unicode character abuse a character counting method.

The third example uses a whitespace rendering character to create an ellipse out of nowhere seemingly.

Not only do you have to measure the width of a piece of text, you also need to make sure that it does not flow vertically. Or clean up entries so that this does not happen at all. However, these precautions are technically not always feasible.

Also, you'll need to see the full text somewhere anyway, and the longer Unicode characters make it ridiculous. As an an example, longer title that ends in an ellipsis is 37 characters, below is an example of a 20 character string. When using line breaks, only 17 characters are required to completely overflow the screen at this font size.

Too long threads

How would you handle all this? Do you scroll over the text at a certain height? What if it's made up of line breaks? Decrease the font size?

I was told that it does not matter because it would be ridiculous for a user to enter such a long text. I do not like this answer as it will arrive and come in, and it should be my job to find the best way to display these marginal cases.

Plugins – The WordPress Revolution slider is not displayed in the mobile version

Since a consultant created our website 6 years ago, Slider Revolution has never landed on the phone. When searching for replies elsewhere in the stack, it was recommended that you enable the "disable slider on mobile devices" option. Actually that was enabled and I disabled it, but Slider still does not show up (I tried a few different browsers in case of caching).

I would appreciate any insight or help.

Wi-Fi – How do I disable the Mobile Hotspot feature?

As far as I can remember, some airlines disable this feature. Now we have a few dozen phones that we want to deploy to some schools, and we want to disable this feature.

How do I achieve this? A few guesses I would have would be to add / edit something build.prop or a hidden Android API (can not find one here).

To update: I found out a long time ago. The solutions here work well and the phones behave properly. Normal WiFi is not affected (because hostapd only manages the AP). The worst thing that happens in testing is

2018-12-04 23:12:23.680 3207-3753/? E/SoftapController: Unable to open connection to supplicant on "/data/misc/wifi/hostapd/wlan0": No such file or directory

by doing logcat, At the same time, the mobile hotspot settings switch is automatically reset.

What I did was just rename hostapd to something else. Moving / deleting / changing permissions would also work.

Mobile data offline or timeout while hotspot only works

How can I fix the following situation:

  • For mobile data, my phone often experiences a timeout of 100% (ERR_TIMED_OUT), or Chrome indicates that it's offline
  • There are no issues with my hotspot-connected laptop

On my phone the full connectivity and the presence of 4g is given.

This leads to my hypothesis that a configuration or a malicious app is flooding the local network stack on my phone.

Is there a way to further diagnose this? I really want to restore my mobile data connection!

Phone: Lenovo P2.
Operating system: Android 7.

Edit 15-09-2019
I reset my phone to factory settings, but to no avail. The problem persists. I also exchanged the SIM cards with another phone. No effect. The second SIM card in my phone does not solve the problem. And my SIM card in another phone works just fine there.