so i do not use my cell phone alot, i rarely even pick up calls but recently i actually used it and was playing java games available on it. and i was amaze at how some detailed some of the games are, but the games themselves are only 150kb which is crazy.
anyone knows how they compress all that information into something so small? cause i've written really crappy c++ programs that are bigger than 1mb and yet they wrote some complex games and are only 150kb in size. i'm just very curious.
If you're writing simple programs and the executables are 1 MiB, you're doing it wrong.
Anyway, they do it because it's Java. The code is small because the JDK or JRE takes care of that stuff or something. I don't know because I don't use Java but anyway, that's why.
Most of the images are actually very small. The code required is usally relatively small as well and dynamically load different things which is where a lot of the space taken up is.
cause i've written really crappy c++ programs that are bigger than 1mb
Size is not generally a good measure of complexity. MinGW 4.4 compiles a Hello World to 3 MiB because there's a lot of static linking going on (link time optimizations can take care of that). At the other end of the spectrum, take a look at the demo scene. I've seen physics simulations in ~4K.
Like chrisname said, the executable is small because it delegates a lot of responsibilities to the JRE. I wouldn't be surprised if most of those 150K were actually game resources.