Android deployment

Previous topic - Next topic

MrPlow

Hi Guys,

I have my first app nearly ready to go but need to know the following:

For Android (or iPhone):

1. Do i need to have checks for various screen resolutions or with 320x480 work as a standard and stretch?
   1b. If the case do I just using platforminfo and work away from there?

2.  Do I have to allow for landscape / portrait switching or is this an Apple-only requirement?

3. GLB v 11 - my Android compile is looking good - but the phone i am using is giving an "error parsing application" error when trying to run - gl_basic_debug.apk...ANY ideas?


Thks.
Gary
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

1. I think you need. There are a few ways to do that. In my case I´m rendering off screen and scalling it back to the android resolution checked on the beginning of code with getdesktopsize. Again you better take a look at diferent techniks done for that issue by other members. Sometimes the kind of game you have may play a role here too.

2. I´m not sure but I believe you have to attend for that. I use a kind of hardcoded landscape. It works fine on the phones I tried but I also believe there is something to do with the manifest too.

3. Id the phone on debugging mode? (usb debuging) 

spacefractal

1. Android have 117 differents resoulutions and have various format. Sometimes a task bar even might cover some of the screen. Depend your game, there is differents technics to been done. Myself I'm not uses offscreen, but scaling directly.

2. It's up to you, you can change that in the manifest. Howover there is a rotation bug with fixed orientation, which means you should uses androidextras and uses the get orientation feature to get the correct value.

3. Do you have correct adb drivers and is in debug mode? Or it's wont install it.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thanks for the info guys!

Is there a kind of standard function that is used for the screen scaling technique?

My app is quite basic (only 1 screen really)


So on landscape / portrait will i get away with 1 or do I need to code a separate path for landscape...

i.e.

if getscreensize

// scale up to each screen

endif

if orient = portrait

// do all portrait layouts and mouse detects

endif


if orient = landscape

// do all landscape layouts and mouse detects


endif
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

Also

I got this error trying to compile in debug mode with Android phone plugged in ...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1101: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1115: exec returned: 1
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

geekpeter

when u first compile you should get a manifest.xml file in your distribute/android folder, if you edit that file you can at least tell android to use the best/max resolution on your device otherwise it picks a squished smaller one, took me some rummaging around the forums to find that as a squished resolution didnt affect any other OS except android.

Code (glbasic) Select
<supports-screens android:resizeable="true"
  android:smallScreens="true"
  android:normalScreens="true"
  android:largeScreens="true"
  android:anyDensity="true" />


Just make sure the selection in yours all says "true" like the clip above, as i believe 1 or 2 of them are false as default, save the file and recompile.

as for what you mentioned regarding portrait/landscape, i havent made anything yet that swaps orientation, mine are all static but surely the only thing that you need to do is keep drawing or stretching to the current screen width/height?

erico

Mr.Plow, your pipeline looks fine.

Is it for a game or an application?

A tile based/map game can use the screen to simply show more área.
A Picture based game (let´s suppose a graphic adventure) will suffer crops or stretches.

In my case, my Project has the highest android resolution set on landscape order.
It is a landscape only game.

I run it on an off screen 428x320.
The final output is scalled 1x1 to the getscreensize information.
Some specific resolutions suffer small side crops.
Touch control coordenates are also checked based upon getscreensize.

Since I would like to support caanoo´s 320x240, some larger crop happens here, but the hud information is placed on the 320 safe área. Anyway, from 428 to 320 is enough of a crop that somethings inside the game have to be fixed to it. Like players screen limits and origins of new random objects, so it dosn´t get created outside the visible play área and so on.

I hope it helps. I can´t help much on the android compiling part since I´m away from HQ these days.

spacefractal

personaly im dont like stretches, which often look awful when happens, then im more perfer cropping or have a side border.

One of the game with borders is Snake Snider, which im also like how the borders is used, which works quite nice. Its a pretty simple idea, but its works.

On my own game, Greedy Mouse, "Sensor" is supported as well Retina graphics. on Karma Miwa, only "Landscape" is supports while graphics can been upscaled. Here upscaled graphics does look pretty nice, due the simple graphics theme. So its totally based which kind of game you uses.

Personlly, the most annoying is those various screen ratio, which can been pity to work with on Android. There is many of them.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Totally agree with those statments Space.
Stretch looks really ugly and on an action game it kind of gets on the way of players perception of movements.

Mr.Plow, I posted on the forum a link to a site that states screen sizes and aspects so you can work with the majorities.
That might come handy on this subject.

MrPlow

Thanks Guys,

This is my app currently hard coded with 320 x 480 so should I be using a more generic window size or use getscreen and place everything dynmically or will the Android device just stretch-to-fit so to speak...?

My app has a few menus so mouse press positions are a consideration...

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

#10
I´m not quite sure Android will scale it auto. I suspect it won´t as my 320x240 game didn´t on note II.
It used the 320x240 top left portion of the phone´s screen.

This is the thread with links to mobile/tablet/desktop resolution info:
http://www.glbasic.com/forum/index.php?topic=9241.msg79180#msg79180

Looks like there is a lot of them, but you can condense the majority of the resolutions to just a few and work from there (yep the more common ones so to have more marketing target).
1080p is also becoming a standard from these days on, and should be well considered for the future of your app.

Nice app by the way, a chess clock?

Generic window size+get screen sounds like a good solution.
Are you using any of the GUI available on the forum or is that a self made one?
I suspect some of the GUI routines around here may have the ability to fit to screen size.
There are some great GUI done by forum members it could be worth checking them.

Cheers.

EDIT: How about adding some sort of score options to the app? Simple stuff, like best of 3 or 5. Or maybe it is not needed, just some idea.

spicypixel

This might help Mr. Plow. It's a framework that will help with your screen scaling issues.

http://www.glbasic.com/forum/index.php?topic=9239.msg79109#msg79109
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrPlow

Thanks erico / spicypixel

I will look into those...I did everything myself except the DDgui is used for menus.

Yes, its a Chess Clock with various modes similar to those found on good digital clocks.



Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

Hi Guys

Couple of general queries on Android dev:

I am also looking to get a good Android development device - would you recommend a phone or tablet - and which one is a good one for development / testing?

Is the iPhone easier or more difficult to deploy on (the XCode compiling etc) and getting to market?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

both have advantage and disadvantage.

iOS can been trouble to setup the certificates up and get them working, which is required. But when they are first working (which can been a bit pain), then iOS is pretty easy to do with. on iOS you have also a lots fewer screen ratios to test with. There is only 3 of them, but have a far more resoulutions.

On Android, there is still issues here and there. You have 117 differents resolutions, rotation issue, screen ratio etc and take some work to deal with those thing. Here you cant really just do one resoulution and just scaling that. Then its will been cropped or stretched, which dont look good (im prefer side borders with some graphics like Snake Slider eventuelly). But Android is howover much easier to test and deploy than on iOS.

Im uses today Samsung Tab2 and OUYA today. Im still need a API-8 phone yet.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/