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 / What? How can the same apk produce 3 different on-device sizes?

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th May 2013 22:08
My WIP is compiling and running in v10812 now.

I just compared file sizes on three Android devices and they are all different:
Toshiba 7" Thrive (Android 4.0.1) - 14.26MB App, 68KB Data
Samsung Galaxy S III (Android 4.1.1) - 14.25MB App, 68KB Data
Nexus 7 (Android 4.2.2) - 11.07MB App, 80KB Data

This is after a complete, fresh reinstall of the WIP.

Is this somehow related to Android version?

The iOS version shows the same App size for both my iPod Touch and my iPad 2. But different sizes for 'Documents & Data'.

And just because I have the data near to hand...
iOS v1076 Player - 2.2MB App
iOS v10812 Player - 8.3MB App
Android v1076 Player (Samsung) - 5.32MB App
Android v10812 Player (Samsung) - 10.08MB App
Android v1076 Player (Nexus) - 2.72MB App
Android v10812 Player (Nexus) - 7.11MB App

I didn't count the 'Documents & Data' because that varies based on how many times the Player has run other apps and how much data they take up.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 24th May 2013 22:30
As a knee jerk response I'd say it's down to the file system. I haven't tested this so I'm not 100% sure, and I'm not all that failure with the android file system either. But here's un-researched explanation, be it accurate or not.

Cluster size.

If you right click on a file on windows you will see that there are two sizes listed. For example the word document I'm working on is 24.9k but the size on disc is 28k.

NTFS file systems are formatted into addressable sectors you get a choice between 512 bytes, 1kb, 2kb, 4kb, 8kb, 16kb, 32kb, 64kb depending on the size of the media you are using.

512 bytes for 7Mb to 512Mb partition sizes and 64KB for 128TB to 256TB sizes.

The downside of this is that you end up with "wasted space" if you write a 64 byte file to a 512 byte cluster then 448 bytes goto waste never to be used again.

Again I must remind you that it's been years since I've studied this stuff so I might be wrong!

So something similar may be happening with your android APK's.

Another thing might be, do APK's use file system compression? That might be another reason.

If anyone knows the answer for sure I'd be interested to know why as well.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th May 2013 23:00
I am very familiar with the issues of actual file size versus size on disk (cluster or block or sector size).

That might be the right answer. But I don't know how to check the file cluster size on an Android.

My understanding about APK's is even less. But I think it is a compressed format.

The apk for the app is showing as 10.6MB in the Mac's file mangler. Much closer to the Nexus' app size than the other two.

That might mean that the Nexus keeps some stuff more compressed after installation than the other devices.

I would also like to know the 'correct' answer to this. But it isn't going to kill me to never find out.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th May 2013 23:09
The APK is a zip file. So it probably boils down to whether this flavour only extracts on demand, or all in one go.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 25th May 2013 01:04
Are these supposed to be reporting the same value?

Toshiba 7" Thrive (Android 4.0.1) - 14.26MB App, 68KB Data
Samsung Galaxy S III (Android 4.1.1) - 14.25MB App, 68KB Data

shouldn't there be a 10k difference?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th May 2013 01:28
Most of the file size on the Android player is taken up by the various versions of our native library, one for ARMv5, one for ARMv7, and one for x86. Only one of these will be required for any particular device, all of those devices are ARMv7, so perhaps 4.2.2 only extracts the required library from the APK?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th May 2013 17:11
Daniel, the values I reported are correct. I don't post the total size, but split out the app and the data. If I did post the total size, it would show a 10k difference between the two.

Paul, my apps are Tier 2, so the interpreter isn't an issue. But the different devices might have different ARMs (but probably the same legs) and none are x86.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th May 2013 18:45
The tier 2 template project also has native libraries for each platform so it could still be that, but it's still just a guess.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th May 2013 23:38
I fully expect a difference between Android and iOS.

But the sizes for different devices on the same platform are different.

It's not an issue, just a curiosity.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th May 2013 02:38
Sorry, by "platform" I meant ARMv5 ARMv7, and x86. Android apps that use native libraries (like AGK) must include a version for each of these architectures as it is not known in advance which device the app will be installed on. My guess is that 4.2.2 is only extracting the required library whilst 4.1 and below are extracting them all unnecessarily.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th May 2013 05:16
I'll buy that. It makes sense.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-04 20:46:29
Your offset time is: 2024-05-04 20:46:29