Android resolutions and test

Previous topic - Next topic

erico

Hello Fellas,
I´m finishing up support to android resolutions the hard way (hardcoded), here are the supported resolutions for phones (no tablets yet):
1920 x 1080
1280 x 800
1280 x 768
1280 x 720
960 x 540
854 x 480
800 x 480
It seems to me to be a good set that currently covers about 87% of the android market.
I don´t see a reason to support any other resolution for android.

Does anyone have a device or know someone that has, that does not fit in there?



spacefractal

#1
SORRY FOR THE MANY EDITS AGAIN.



If you hardcode contain reolutions, you will face this issue seen on that screenshot. You have not covered toolbars by those resolutions, which is NOT reported by GETSCREENSIZE as well GETDESKTOPSIZE. In this case the reported resolution is 1024x552, not 1024x600 (48px is covered by the toolbar), a resolution which is not on your list.

Im thinks to fix the annoying issue is simply fall back to the nearst hard coded resolution, reported by the GETSCREENSIZE and then uses VIEWPORT/virutal screen to center it. Here im thinks its would been covered much more and better covered by eventuelly toolbars, even your game might not been fully fullscreen (in my case, 960x540), the game would still not been cropped.

Due that im recommered to add those three hard coded resolution to your list, based on nearst resolution method:
- 1024x600 (which property would uses on tables devices with 1024x768 with toolbars).
- 800x432 (if a tool bar used on a 800x480 screen).
- 480x320 (supports lowres screen, small screens in your manifest, here im have not seen toolbars used on those screens.

Then im thinks you would cover most devices out here.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

Should you actually cover the bottom icons though - would make it harder to people to exit, look at the time etc.

Nice graphics by the way.

spacefractal

you cant hide the toolbars as shown here, only temp for movie players (when hided, a touch will shown them again). Its by Android design to replace physical buttons. Im whish they used iOS design with smart uses of home button, but its property patented.

So this is why fixed hardcode resolution is really a bad idea if you ask me, and did not do that for my games at all. Howover its can been possible to uses clostest hardcoded resolution, even you might seen black borders in this case (like Snake Slider excellents did). So make sure you might can lost up to 128px, depend of resolution.


Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

The game happens on landscape (90 degrees counter clock), but the system stays at portrait, the ´top pull down´ bar comes from the left side of my phone when game is running. So here I can assume the toolbar will show on the left side, and will interfere the numbers of the highest resolution portion on , ex 1280x720 will report 1152x720 on getscreensize if considering a 128px bar, is that correct?

I have enough side parts to deal with the bar loss, it will just suck if you touch those buttons by mistake as the app will exit with the middle and right ones.
I also think I can get by without having to re-center the app.

Problem now is to find out if that menu bar is standard in pixel size, like either 48px or 128px so I can account for that.
If it can be ANY size between those numbers there will be trouble :P

Do you have any info on this Space? Maybe the bar manifests in 2 or 3 fixed sizes?

If too troublesome and deal break,  I will have to do a scale-to-anything routine, but I really don´t have the time to do it now, possibly on an update maybe. :(

Here a picture of it at the 854x480 size, the cyan lines are touch limits, I´m having them a lot bigger then the actual buttons so it gets comfortable for the player.
The game happens on a virtual screen of 428x240 and gets scaled, 28 of the native pixels (about 14 each side) are not accounted in game at all and is to support some device sizes where I would like to keep pixels square. On a 1280x720 android phone, those 28 pixels get to be 84 pixels, 42 each side. This, the no-centralized nature of things and the extended button areas might help I hope.

I guess I probably need to test on that kind of device to be sure.   

erico

Just for the records, I tried the apk on a galaxy s2, it has a 2.something android, and here the pull down status/settings bar does not show up. On my note II at android 4.3 it gets called if I pull the border. (this is that time/settings bar)


spacefractal

#6
Toolbars is mostly on the bottom, and its can been vareried from system to system. Sometimes they can been removed, sometimes not. Sometimes its 48px, but its can been 128px and sometimes in the middle. Its again vareried from system to system. They can been checked, but is really not  recommered. This is not a issue on iOS at all.

The screenshot was taking on a Samsung Tab2 and im could eventuelly test what it happens on that device if you wish.

But for you, im thinks, all you need is, just add a option to let the controller to been user moveablee without rescaling the great controller graphics it self. This could help very much for the user, if click area is too big or too small for the device. This would fix the controller issue.

Scaling to anything is best way, as you see my screen did reported to 1024x552 (1024x640 physical). But really you could uses the closest hardcoded resolution (here 960x540) and top/center it (using VIEWPORT), and could even crop some of the floor graphics, if reported resolution is a very close match.

in both Greedy Mouse and Karma Miwa, im used rescaling to anything without used virtual screen (its was too slow).

PS. if toolbar is rotated wrong, this is a glbasic bug, fixed by AE (which Search button is disabled and you can control the Back button).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Quote from: spacefractal on 2014-May-27
Toolbars is mostly on the bottom, and its can been vareried from system to system. Sometimes they can been removed, sometimes not. Sometimes its 48px, but its can been 128px and sometimes in the middle. Its again vareried from system to system. They can been checked, but is really not  recommered. This is not a issue on iOS at all.

There I meant the usual top bar you call up by dragging a finger over the top corner of the screen, it is where you have a few settings, wifi, gps, etc on 4.3 or the likes.
What I meant from the last post, and I recall talking about it somewhere else, is that when I had 4.2 android (and olders), this one bar would not show up, then I updated to 4.3 and now it shows. Maybe it is something related to the manifest, I might check that later.

The bottom bar I have no clue, I don´t have a device with such around neither my friends. The galaxy S and iphone seem to rule in brazil.

In my game´s case, I bet the tool bar you are talking about is going to be on the right side (the lower part of the phone when you hold him normally).
Visually, that is not going to cause much trouble, but I have to attend to those resolutions and possible bar sides.

For that, what I really need is to know the possible sizes of that bar that gets reported on GETSCREENSIZE.
Say, in my unrotated case, a 1280x720 resolution phone might report from GETSCREENSIZE a 1152x720 and thus fail to fit on what I have(here considerind a 128px bar).

I´m also failing to find a site that states this info, what are the bottom bar standard sizes? (standards in android hehe :D)

I currently can´t afford time to re-write the scaling code neither the touch controls, so I have to work with what I can.
I will get better next project. ;)

By what I checked, any device bellow 1ghz, won´t be able to hold the 60fps with the virtual screen, and I haven´t accounted for speed changes in game either, so they are probably out.

It would be a shame to skip great phones for a resolution check fail, so I need to attend for this bottom bar.




erico

As Space recommended, I may as well check into VIEWPORT command for my screen scale.

I have no experience with it, my game happens in a 428x240 virtual screen, when upscaled, I work with a 320x240 or a 400x240 centered part of it and get it to the final output screen size. Maybe VIEWPORT can give me an edge here.

The other thing is that the touch coordinates are checked on the output screen size, which is attached to my resolution check to boot.
Hopefully it is not much trouble to change. I have to at least check it.

I want my pixels moving on the 428x240 resolution grid.
In a 1920x1080 output, 1 original pixel mean 4.5 pixels. I didn´t want to deal with this and the pixel break on the many other resolutions, that is where a virtual screen is good for me.

It works already, I will give a quick try on it later to see what happens.
Damn, I should be doing the music... :(

erico

Here a good resource on the navigation bar size (ye the bottom bar).
http://www.emirweb.com/ScreenDeviceStatistics.php

I hope to be able to go around it by checking that.

erico

#10
Sorry the 300 posts...
Quote from: MrTAToad on 2014-May-27
Should you actually cover the bottom icons though - would make it harder to people to exit, look at the time etc.
Nice graphics by the way.
I don´t wanna cover them. but actually detect it.
The top bar is a pull down stuff, so it is fine and design wise escapable when setting (project options) compile to android with a resolution like 9999x9998 (instant landscape here working with a portrait phone). GETSCREENSIZE reports me a standard X/Y screen size. At least to this kind of game style and the devices I tested.

The navigation bar at bottom is not skipable and, according to Space, GLB reports a resolution considering less pixels of its screen state to compensate the bar.
I must check this out.

Those gfx are from Karma Miwa, available at the playstore. I did a few sprites there, check it out, it is a great game!

spacefractal

#11
Samsung Galaxy S is a quite old phone. Older phones does not have navigation toolbars. This due they have physical buttons, which is today is moved to the screen its self as those navigation toolbar and removed the physical buttons. So Android is quite very fragmented by returned supported resolution to the app by the device. So newer do hard code fixed supported resolution on Android (But fine to choices the closest one). Gernot or im with AE cant do anything about this at all. Its by Android design.

Im did used quite long time for Karma Miwa on this issue, which is why up/down scrolling is required for some devices, depend on detected resolution (the game dont do scaling if detected resolution is between 960x640 and 1280x720).

This is a issue not to been seen on iOS, here we have just 5 resolutions need to been supported, all fullscreen (or 4, if you not want support 3gs):
480x320, 960x640, 1136x640, 1024x768 and 2048x1536.

If the game cant hold 60fps, the game should not slowdown (lag), but instead uses some sort of frameskip measure to keep the same speed. Greedy mouse used a frameskip measure, while Karma Miwa used a timer to keep the speed.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Got one question Space...

When using GETSCREENSIZE on a phone/tablet with navigation bar, the final resolution stated by the command is the actual resolution minus the bar size right?
Like, suppose a phone is 768x1024 in portrait mode and the bar is 48px , will GETSCREENSIZE report 768x976?

spacefractal

#13
Its will return 768x976. Its the surface size created in SDLActivity.Java glbasic uses.

Im just checked now, im really uses GETDESKTOPSIZE(), not GETSCREENSIZE() to detect the current surface resolution (due its recommered in the help file), but its should not been any different at all (see log file below).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#14
just for fun, here is the logcat start of the Karma Miwa game:

Code (glbasic) Select

Android Debug Bridge version 1.0.31
List of devices attached
c1607391b81267f device

--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
I/SDL     ( 2969): ---------------------------------------------
I/SDL     ( 2969): ---               restart                 ---
I/SDL     ( 2969): ---------------------------------------------
I/SDL     ( 2969): onCreate
I/glbasic ( 2969): external files dir is /data/data/com.spacefractal.karmamiwa/files
I/glbasic ( 2969): external storage /storage/sdcard0/Download
I/glbasic ( 2969): DPI 169
I/glbasic ( 2969): SDL Surface: GT-P3110
I/glbasic ( 2969): Exception starting GPS: Provider gps requires ACCESS_FINE_LOCATION permission
I/glbasic ( 2969): Creating SoundPool instances...
I/glbasic ( 2969): SoundPool instances created
I/glbasic ( 2969): try to load a Interstitial
I/glbasic ( 2969): device: espressowifixx
I/glbasic ( 2969):    onCreate done
I/SDL     ( 2969): startApp, thread
I/glbasic ( 2969): surfaceCreated()
I/glbasic ( 2969): surfaceChanged()
I/SDL     ( 2969): pixel format RGB_565
I/glbasic ( 2969): startApp, thread
I/SDL     ( 2969): hint screensize to glb
I/glbasic ( 2969): glb_notify_screen_size 1024x552
I/SDL     ( 2969): SDL_Android_Init()
I/SDL     ( 2969): SDL_Android_Init() finished!
I/glbasic ( 2969): Can't init SDL.
I/glbasic ( 2969): Passed a NULL mutex
I/glbasic ( 2969): timer
I/glbasic ( 2969): rbow
I/glbasic ( 2969): rbow init
I/glbasic ( 2969): SDL_init video
I/glbasic ( 2969): SDL_GetVideoInfo = 1024x552 @ 0 bpp. Screen 1024x552
I/glbasic ( 2969): C++ calling SDL_CreateWindow (fs:1)
I/SDL     ( 2969): ceateGLContext
I/SDL     ( 2969): ceateEGLContext
I/SDL     ( 2969): [STUB] GL_SetSwapInterval
I/glbasic ( 2969): C++ SDL_CreateWindow stuff finished
I/glbasic ( 2969): get accurate timer - 1st call
I/glbasic ( 2969): flip - 1st call
I/glbasic ( 2969): BGRA ext supported
I/glbasic ( 2969): Texture size limit: 2048
I/glbasic ( 2969): init fbo
I/glbasic ( 2969): 2D VP
I/glbasic ( 2969): OGRB init [OK]
I/glbasic ( 2969): Cptn
I/glbasic ( 2969): Network
I/glbasic ( 2969): Input
I/glbasic ( 2969): Window mode
I/glbasic ( 2969): Create DXin
I/glbasic ( 2969): getexe
I/glbasic ( 2969): cd
I/glbasic ( 2969): exepath=curdir= /data/data/com.spacefractal.karmamiwa
I/glbasic ( 2969): shoeboxing...
I/glbasic ( 2969): init gettimer
I/glbasic ( 2969): clear screen
I/glbasic ( 2969): flip
I/glbasic ( 2969): mk2D
I/glbasic ( 2969): finding font...
I/glbasic ( 2969): SDL audio: wanted stereo 16-bit 44.1kHz, 1024 frames buffer
I/glbasic ( 2969): SDL audio: got stereo 16-bit 44.1kHz, 4096 frames buffer
I/glbasic ( 2969): open sound: 44100 Hz 2 chan, buffers 1024, format -32752
I/glbasic ( 2969): Init Finalized
I/glbasic ( 2969): [GLB]->******* STARTUP *******
I/SDL     ( 2969): [STUB] GL_SetSwapInterval
I/glbasic ( 2969): [GLB]->Platform: Platform=Android VersionAPI=16 Manufacturer=samsung device=espressowifi model=gt-p3110
I/glbasic ( 2969): [GLB]->GameWidth: 1187 640
I/glbasic ( 2969): [GLB]->Graphics Resoulutuon: 1024x552
I/glbasic ( 2969): [GLB]->Scaling Used: .8626790047
I/glbasic ( 2969): [GLB]->Frames Per Second: 60


Yes some spelling, but that me. There is a SDL error, but its do work correctly. IM not sure why its happens, but its does work.

glb_notify_screen_size 1024x552 is that line of code that tell glbasic, which surface Android have created for the app.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/