limit app size

36 views
Skip to first unread message

Peter Bell

unread,
Apr 28, 2020, 5:04:14 PM4/28/20
to CodenameOne Discussions
Hi

I have problems with the limit of 50 MB of size of the build.jar.
I am making a seacurrent map. For each map i have an image. I have eight  areas  with 13 maps and each map is about 1 MB size.  So in  total i have 105 MB.  The size of the image matters because i have to read the  current velocity. So i have to zoom in. With less mb the numbers are readable./ 
So i was wondering. How i can get workaround? Any clues  for a solution.  

ciao
Peter Bell

Shai Almog

unread,
Apr 29, 2020, 12:42:13 AM4/29/20
to CodenameOne Discussions
Hi,
the solution is simple. Host your data in the cloud and on first launch of the app download the extra maps. This would reduce the total download size of your app as well which is hugely important. It would make your builds shorter etc.
The 50mb limit is important and applies even on the enterprise level. A larger number will slow down your build significantly and result in larger apps that might cross appstore thresholds in terms of size. 

Dave Dyer

unread,
Apr 29, 2020, 12:56:20 PM4/29/20
to CodenameOne Discussions

It's not a constructive suggestion to say "re-engineer your apps" just to be able to host
a higher resolution map.

Storage is a cheap resource, and .res files are just baggage that is carried through
the whole build process - they don't impact anything else and don't impose any costs
on you, other than the extremely nominal cost of storing and transmitting them.

At the very least, we ought to be able to pay some nominal fee to allow bigger builds.

Just thinking here, but there ought to be a way to use a dummy .res file during the
build, and re-insert the real .res file into the result.  Presumably there would be
some code signing that would need to be re-done.

Shai Almog

unread,
Apr 29, 2020, 11:33:24 PM4/29/20
to CodenameOne Discussions
Dave. Your app demonstrates perfectly the reason for these limits. The larger size slows down all developers on a resource that has its limits.
If we'd let you do what you want builds from everyone will be queued. You'd then also blame us for the difficulty of ranking in the appstores.

Peter Bell

unread,
May 1, 2020, 5:21:51 AM5/1/20
to CodenameOne Discussions
Thanx Dave you set me on the right path

i have figured out that i can alter the apk wich codenameone builds. With winrar i can add files to the assets and creae a new keystore key and self sign the apk.

for other people who has the same problem with too many images the steps are to workaround the 50 mb limit for android
1 create apk file with codenameone with a fewer iamges
2 open the apk file in WinRar or other zip file
3 delete in META-INF  folder  the rsa and cf file
4 add to assets the image files 
5 create a new keystore key
- open cmd in administrator
- go to java folder 
- go to to the bin folder
- check if  keytool.exe exits
- run 
keytool -genkey -v -keyalg RSA -alias Naam  -keystore naamapp.jks -storepass password -validity 5000 -keysize 2048 -sigalg MD5withRSA 
6 put the apk file in the same jva/bin folder
7 create new signed apk
- run
jarsigner -verbose  -sigalg MD5withRSA -digestalg SHA1 -keystore naamapp.jks  naam apk file wtith.apk  Alias 
Alias is the same alias name in step 6 


Op woensdag 29 april 2020 18:56:20 UTC+2 schreef Dave Dyer:

Dave Dyer

unread,
May 2, 2020, 1:44:51 PM5/2/20
to CodenameOne Discussions

That's a lot of manual steps, but I suppose it can be scripted, and something similar could be done
for the IOS builds.    I'm going to hit the limit sometime soon, too; and will have to decide which workaround
to use.
a) downgrade graphics to make smaller builds
b) download some assets from a web site
c) repackage and resign the deliverables, which you have prototyped for me, thanks.

Reply all
Reply to author
Forward
0 new messages