How to remove unused classes of LWUIT? - java-me

I have written a simple J2ME app using Lwuit library, it is working good but my problem is that even my code is very small but the app size becomes 700kb means all the classes of lwuit gets included in my app though I am only using 5-6 of its classes. I have also tried Obfuscation with High level and app size decrease but still it is Big in size about 300kb(only for HelloWorld!). So please tell me any way to remove these unused classes and make this app smaller in size.

If you've done obfuscation properly (and it is pretty straight forward if you're using netbeans), then any unused classes will be removed. I would not recommend manually deleting the .class files because jar size is an important field in the jad and/or manifest files.
When you opened the jar, do you see a bunch of .class files?

I suppose that you can open the .jar with some application like winRar and delete the .class that you will not use, but be carefull removing this .class.

Related

Opening .grp .mps and .rsc .rsr

I recently re-opened the different editions of The Cluefinders to understand how it worked to potentially do a spinoff of it.
I downloaded the iso file from https://www.myabandonware.com/game/cluefinders-3rd-grade-adventures-bh9
Unfortunately, even if it works flawlessly (especially for a game so old), the files still have some secrets I want to uncover.
Primarily there are some .grp, .mps, .rsc and .rsr file that I can open, but cannot read properly. Thus since I can't decode it I can't find the master file that ensures the proper order of events and the different graphics files. There are references in some MPS files but I don't understand how it fetches the different sprites, etc ...
Does anyone know how to open these files properly? I'll try and do the maximum from them
Sincerely,

Pixi.js vs Pixi.min.js differences?

I'm new to web development and currently learning Pixi.js and I noticed there are few versions:
Pixi.js
Pixi.js.map
Pixi.min.js
Pixi.min.js.map
May I know is there any differences between these in terms of features?
they're not at all different version, it's just a common convention in javascript programming: "min.js" files are the "minified" lib source, that's mean the same ".js" file where spaces, end of line and other unnecessary (for the browser) characters are cut off, and also variables names were changed with shorter ones, to obtain a lighter source file, less heavy to download and easier to execute for the browser. This file is obviously automatically generated from tools like gulp and grunt and is the source file you have to upload to the server and finally serve to the user. ".map" files instead are, whell, maps who link minified files to their full size counterpart, whit just min and map files, chrome debugger can reconstruct the original source and show it to you in the inspector.
To answer your question: No they are exactly the same, when it comes to features.
A *.min.js file is just the original.js file but "minified".
That means names were shortened (e.g function getName changed to n).
It's size (bytes) is also reduced.

Check that no file is forgotten for the installshield project

we actually build an InstallShield project for our application with the functionality to include files dynamic into a component. All files will be taken which are in a specific place.
Because of problems, which are not part of this question, we want to change this to components where we add files explicit to custom separated components.
The question is, is there a best practice for this? We have the small fear that we easily can forget to add files to the component we new created. These can be dll files, .config files, pdfs or just xml.
(We build the installer every night using TFS.)
We found a solution for the problem.
What we wanted to solve:
During the build we want to be informed if files got removed
During the build we want to be informed if new files are missing
we solved this by two more or less easy things.
1. Information if a file is removed
This is easy sone, we have all files added explicitly, each single file is an own component now, if one file is missing the whole project does not build with the exact error message.
2. Information for missing files
For this we wrote a small tool which runs by a prebuild event of the installshield project.
There it opens the *.ism file as an xml file and searches for the "Files" table.
Than it takes all files from the drop folder and looks if all files are in there.
If there are files missing but we don't expect them, like pdb files or test dlls, we have an additional text file we just called "IgnoreList".
The tool skips these files by the check.
Now we are on a very good state to get informed directly on the next morning if the project was able to build or not, and if not what happened, so we can be sure that in the final target application are files are there :-)

How to prepare a Linux app to find ttf font directory?

I'm working on an application primary targeted for Linux, which use a TTF font. I need the font's file name and path, because I have to load it with SDL function TTF_OpenFont(char *file, ...). The problem is that there are a lot of different directories for TTF fonts on different distribution. Which is the best way to deal with this problem? I've came up some solutution, but each of them seems suboptimal for me:
pack the font along with the application, and install it to the application's own /usr/share/ directory.
check the font path with fc-list : file.
hardcode every path variation to the application and try them out when load the file.
Your first and second solutions are quite good, except it may be better to call FcFontList function. Third one is quite unreliable, but it highly depends on application type (it can be ok in some cases, if you have this path configurable by user).

make swf from fla without ever opening it

is it possible to change text and images in a fla file without ever opening it up and then making the swf via command line? I want to make a flash template and save the fla. Then be able to update my text and image name and convert it to swf. I have one template but tons of different text options and background images. It would be nice to be able to copy the master.fla twenty times and just change the source code (will do this from command line) and then convert to swf (via command line).
Any help would be appreciated.
With CS5, you can do half of what you're asking today, by using the XFL file format instead of FLA. Instead of a binary blob, you get an editable XML file and a tree of separate asset files: PNGs, AS3 files, etc. You can then modify the XML or AS3 files programmatically to get your variants.
(A CS5 FLA file is really just a zipped up version of the XFL, but there's no advantage to using that instead of an XFL. In CS4 and previous, FLA was a proprietary binary format.)
The missing piece is an XFL compiler. Adobe currently provides no such thing, and the third party market hasn't yet produced one.
You could use a systems automation tool to drive the Flash Professional environment through the compilation steps. On OS X, for example, either Automator or AppleScript should be able to do what you want. It'll just have more overhead than the command line compiler you were hoping for.
I agree with Jason, there are a lot of alternatives to what you suggest. Keeping content out of the SWF is good practice actually. This is a good way to avoid large files!
Depending on what you 're looking to achieve, there are a lot of solutions available. XML is an option, JSON another.
If you're looking to build a template, any of the above would seem appropriate.
It sounds like you're working from the Flash IDE, as Jason suggests you may want to have a look at another IDE, such as FlashDevelop, FDT or FlashBuilder as they make coding with AS3 a lot easier.

Resources