Pages

Thursday, August 9, 2012

Handler Menu Embedder

utilitycentre.blogspot.com
It is another software made by me for handler modders. It is able to add a handler menu in a j2me application. It is in beta, so better to use the same handler code that I have provided below. It just add handler menu, but didn't change the code of network so you have to do it manually.

Procedure to use :

1) Extract the j2me application , Here I am attaching menu in opera mini 6.5
So i extract the opera mini jar file . suppose it get extracted to E:/opera

2) Insert the attached handler scripts in the same folder where you have extracted the application. Like here I have extracted it in E:/opera , so i will paste the handler scripts in E:/opera. Thus , the handler scripts will be placed along with other class files of j2me application.


3) Start the handler embedder , I the first field , you have to enter the complete path of the folder where you have extracted the application , So , in my case , I will insert E:/opera in this field. There is also a browse button along with the field , so you can manually browse to the folder.

4) The second field in the name of class file that contains the startApp() method. This class is called the midlet class. You can find out the midlet class of any j2me application by viewing its manifest file ( MANIFEST.MF).
There , in the MIDlet -1 attribute , you can find the midlet class name.
for example , in opera mini , if you examine the manifest file , you will see an attribute like this :

MIDlet-1: Opera Mini, /i.png, Browser

Here , opera mini is the name of application , i.png is the name of icon file of application , and Browser is the name of midlet class .

So in my case , I will put Browser in the second filed of handler embedder.

Now note one thing here , In some applications , the MIDlet class is found in inside some folder . Like in ucweb , the midlet class is Webclient , and it is found inside cn/uc/WebClient.
In cases of like these , you have to insert the MIDlet class in pakaged form.
like if midlet class is in cn/uc/WebClient ;
Then you have to enter : cn.uc.WebClient
Simply saying , the "/" is replaced by "."

5) The Handler class name is the name of class file , that contains the handler menu code. In the attachments , HandlerUI is the name of this class. So you have to insert HandlerUI in this field if default constraint is applied.
Similarly , the Handler interface class is the name of interface class that must be implemented by our application. Again in the attachment of handler script , HandlerUIIFace is the name of this Interface. So you have to insert HandlerUIIFace in the last field.

6) After filling all the fileds appropriately , press the start processing button and your MIDlet class file will be modified in less than a second. The modified class file is saved in the same directory as original class file i.e. E:/opera in my case. Then insert the modifed MIDlet class file , HandlerUI.class file and HandlerUIIFace.class file back into the jar file and its done !

note : In the fields , enter only the names of class files . Dont add the extension along with them.
Also , the names are case sensitive. Make sure that the name that u r inserting is exactly the same as the class file.