Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Android Device Name

Author
Message
yamyam
11
Years of Service
User Offline
Joined: 12th Jan 2013
Location: Black Country
Posted: 21st Jun 2014 14:02
Can anyone tell me if there is commands for retrieving the android device name in Tier 1.

I know i can return the device manually with Devicex and Devicey if i know the size of the screen. but it would be good to be able to retrieve information from a AppGameKit keyword.

If not then could the AppGameKit developers maybe add this to the list of commands?

A soldier will fight long and hard for a bit of colored ribbon. ~Napoleon
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Jun 2014 23:33
I'm a little confused. What is DeviceX and DeviceY?
Are you looking for the device model (like Nexus 7)?
If so, no command for that.
You can use GetDeviceName() for determining if the device is android, windows, mac, or iOS.

It would be nice to be able to know the device model, but I'd really like to know the OS version.

What are you looking to do? Maybe there's a different way.

yamyam
11
Years of Service
User Offline
Joined: 12th Jan 2013
Location: Black Country
Posted: 22nd Jun 2014 13:37 Edited at: 22nd Jun 2014 13:40
Thanks gor your reply Naphier.

Yes i meant
Devicex = GetDeviceWidth()
Devicey = GetDeviceHeight()

would give me the height and width of a device and GetDeviceName()
would tell me its an "android" device.

What would have been ideal would be a command that tells me its a Nexus 7 Tablet, or Nexus 10 etc. With so many screen sizes, this way i could tell when it was a tablet and when it was a phone.

The reason i ask is because when i released my game TRAX the adverts on a tablet device are fine at the bottom, but need to be at the top on smaller devices like phones, i could put them all at the top of the playfield but they look better at the bottom on tablets. The problem seems to be that large screen phones S4,S5 have an higher resolution than some tablets.

This code modified from the forum works for Nexus 7
but not sure about other tablet devices.



Can you see a better way in Tier1?

A soldier will fight long and hard for a bit of colored ribbon. ~Napoleon
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 22nd Jun 2014 21:22 Edited at: 22nd Jun 2014 21:24
Unfortunately there's no better way. You could spend all day trying to get devices that you think are tablets and making cases for them like this, but the screen size variation on Android is way too varied.

I've asked for a GetDeviceDPI() which would help in making this determination. Also, it would be nice just to simply know if the device is a tablet or not, you could glean that from DPI
(DPI * w#)^2 + (DPI * h#)^2 = (diagonal in inches)^2
Then we could say, anything with a diagonal of over 6 inches we consider a tablet.
Please add a comment here to let AppGameKit know you're interested in this type of command:
https://code.google.com/p/agk/issues/detail?id=641&q=DPI

Another solution is not using banner ads You can use interstitials with AdMob or Chartboost. See: naplandgames.com/agk

yamyam
11
Years of Service
User Offline
Joined: 12th Jan 2013
Location: Black Country
Posted: 27th Jun 2014 15:53 Edited at: 27th Jun 2014 17:00
Thanks for the reply Naphier appreciated.

Added a few more cases for tablets and it seems to be working now with Galaxy S4 the adverts are now at the top on TRAX just been told thanks again.

Login to post a reply

Server time is: 2024-11-25 06:20:40
Your offset time is: 2024-11-25 06:20:40