Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get Maximum jar size supported on a handset?

 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I find maximum jar size supported on a particular handset from an application?
Like if I want to know the canvas size the I can print this.getWidth() and this.getHeight() on the canvas in paint() method.. like that is there any way to print the max. jar size supported on a handset on the screen ??

Thank you.
 
Tim Holloway
Saloon Keeper
Posts: 18366
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I'm missing something, the primary limitation on JAR size would be the RAM available to your JVM, but there'd be no simple way to calculate that, since the JVM can only access JAR info via classloaders, and they are going to do things that consume an unpredictable amount of memory. In short, the JAR size is less important than the actual runtime memory requirements. And the actual runtime memory requirements are determined not only by the classes, but also by what types of data objects the app constructs, how big they are, and how many of them there are. Assuming that the JVM isn't keeping the class code in a separate read-only memory.

A secondary limiting factor is the memory that the JAR itself is stored in, which most mobile devices present as a filesystem. The limits on this are based on how much of that filesystem space is in use by other objects. Additionally, a lot of devices support adding additional memory chips - which typically comes in a lot of different sizes.

In other words, it's virtually impossible to predict with total precision, but obviously a 4MB jar won't fit on a 2MB device.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic