Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

Im trying to port an application from J2ME to BREW.

Im unable to find the equivalent of BREW for the following code. :confused:

Please help !!!!

private Player f[];
public InputStream a[];
VolumeControl g[];

f = new Player[6];
a = new InputStream[6];
g = new VolumeControl[6];

Thanks in Advance

private Player f[];
public InputStream a[];
VolumeControl g[];
f = new Player[6];
a = new InputStream[6];
g = new VolumeControl[6];
Here is the BREW code:
Player *f;
InputStream *a;
VolumeControl *g;
f = (Player *)MALLOC(sizeof(Player));
a = (InputStream *)MALLOC(sizeof(InputStream));
g = (VolumeControl *)MALLOC(sizeof(VolumeControl));
And call all respected constructors explicitly if new doesn't call it automatically.

private Player f[];
public InputStream a[];
VolumeControl g[];
f = new Player[6];
a = new InputStream[6];
g = new VolumeControl[6];
Here is the BREW code:
Player *f;
InputStream *a;
VolumeControl *g;
f = (Player *)MALLOC(sizeof(Player));
a = (InputStream *)MALLOC(sizeof(InputStream));
g = (VolumeControl *)MALLOC(sizeof(VolumeControl));
And call all respected constructors explicitly if new doesn't call it automatically.

Thanx rajni,
But the VolumeControl and Player are obtained from jar files in J2ME.
Whereas in BREW, where can i find library files for the above mentioned
To be Specific.. What should i include to use VolumeControl, Sound in my code ???
Many Regards

Thanx rajni,
But the VolumeControl and Player are obtained from jar files in J2ME.
Whereas in BREW, where can i find library files for the above mentioned
To be Specific.. What should i include to use VolumeControl, Sound in my code ???
Many Regards

Hi,
I am into a project of porting J2ME applications to BREW platform.
But we know the possible solution would be sit and start coding from scratch in C++.. ( Also im new to C++)...
Please help me in finding out any other simpler way to find the solution ????
Regards

Hi,
I am into a project of porting J2ME applications to BREW platform.
But we know the possible solution would be sit and start coding from scratch in C++.. ( Also im new to C++)...
Please help me in finding out any other simpler way to find the solution ????
Regards

Hi,
S ther any tool available for porting J2ME applications to BREW...
Also please let me know the steps to be followed during porting Applications from J2ME to BREW !!!!!!!!
Currently im manually implementing the porting.. Need ur Help !!!! :confused:
Regards

Hi,
S ther any tool available for porting J2ME applications to BREW...
Also please let me know the steps to be followed during porting Applications from J2ME to BREW !!!!!!!!
Currently im manually implementing the porting.. Need ur Help !!!! :confused:
Regards

Can anyone else help me out in finding out solution ???? :confused:
I need to port some Sound API's used in J2ME to BREW... So wat s d solution ??
Where can i find these equivalent API's in BREW ?

Can anyone else help me out in finding out solution ???? :confused:
I need to port some Sound API's used in J2ME to BREW... So wat s d solution ??
Where can i find these equivalent API's in BREW ?

Check ISOUND or ISOUND_PLAYER APIs.

Check ISOUND or ISOUND_PLAYER APIs.

Can u pls provide any links where i can find the details abt ISOUND & ISOUND_PLAYER ????
If possible with an example.. :o
Many Thanks

Can u pls provide any links where i can find the details abt ISOUND & ISOUND_PLAYER ????
If possible with an example.. :o
Many Thanks

Can anyone pls reply to my queries as soon as possible. Since im running out of time.
Many THanks

Can anyone pls reply to my queries as soon as possible. Since im running out of time.
Many THanks

keerthi.bhatt wrote:Can u pls provide any links where i can find the details abt ISOUND & ISOUND_PLAYER ????
If possible with an example.. :o
Many ThanksCheck the BREW documentation for the same (BREWAPIReference.chm).

keerthi.bhatt wrote:Can u pls provide any links where i can find the details abt ISOUND & ISOUND_PLAYER ????
If possible with an example.. :o
Many ThanksCheck the BREW documentation for the same (BREWAPIReference.chm).

keerthi.bhatt wrote:Hi,
S ther any tool available for porting J2ME applications to BREW...
Also please let me know the steps to be followed during porting Applications from J2ME to BREW !!!!!!!!
Currently im manually implementing the porting.. Need ur Help !!!! :confused:
Check this thread...
about java
http://brewforums.qualcomm.com/showthread.php?t=18542

keerthi.bhatt wrote:Hi,
S ther any tool available for porting J2ME applications to BREW...
Also please let me know the steps to be followed during porting Applications from J2ME to BREW !!!!!!!!
Currently im manually implementing the porting.. Need ur Help !!!! :confused:
Check this thread...
about java
http://brewforums.qualcomm.com/showthread.php?t=18542

keerthi.bhatt wrote:Can anyone pls reply to my queries as soon as possible. Since im running out of time.
Many THanks
Please don't do multiple posting for same topic.. it'll be difficult to track them..
Check this thread and continue discussion there..
Porting J2ME to BREW (keerthi.bhatt)
http://brewforums.qualcomm.com/showthread.php?p=65075#post65075

keerthi.bhatt wrote:Can anyone pls reply to my queries as soon as possible. Since im running out of time.
Many THanks
Please don't do multiple posting for same topic.. it'll be difficult to track them..
Check this thread and continue discussion there..
Porting J2ME to BREW (keerthi.bhatt)
http://brewforums.qualcomm.com/showthread.php?p=65075#post65075

Porting
Porting --- the application is ported from one platform (j2me) to BREW..It means that you need to use the appropriate resources in BREW to get the functionality. It is not like using a Soundplayer from J2me in BREW application. Make use of soundplayer interface in BREW to get the functionality.
This is a good document explaining on 'porting to BREW'.
Porting Applications to BREW
http://brew.qualcomm.com/brew_bnry/pdf/brew_2007/Tech-304_Rischpater_BRE...
Running j2ME application on top of BREW
As is clear by the title, it is running j2me application on top of BREW without any change to that application. This requires some interface b/w j2me and BREW. This is called JVM for BREW (Java virtual machine).
Check this thread on information on that..
http://brewforums.qualcomm.com/showthread.php?t=18542

Porting
Porting --- the application is ported from one platform (j2me) to BREW..It means that you need to use the appropriate resources in BREW to get the functionality. It is not like using a Soundplayer from J2me in BREW application. Make use of soundplayer interface in BREW to get the functionality.
This is a good document explaining on 'porting to BREW'.
Porting Applications to BREW
http://brew.qualcomm.com/brew_bnry/pdf/brew_2007/Tech-304_Rischpater_BRE...
Running j2ME application on top of BREW
As is clear by the title, it is running j2me application on top of BREW without any change to that application. This requires some interface b/w j2me and BREW. This is called JVM for BREW (Java virtual machine).
Check this thread on information on that..
http://brewforums.qualcomm.com/showthread.php?t=18542

keerthi.bhatt wrote:Can anyone else help me out in finding out solution ???? :confused:
I need to port some Sound API's used in J2ME to BREW... So wat s d solution ??
Where can i find these equivalent API's in BREW ?
InputStream[6]; -- IASTREAM
VolumeControl[6]; -- ISOUND or ISOUNDPLAYER
Player[6]; -- IMEDIA or ISOUND

keerthi.bhatt wrote:Can anyone else help me out in finding out solution ???? :confused:
I need to port some Sound API's used in J2ME to BREW... So wat s d solution ??
Where can i find these equivalent API's in BREW ?
InputStream[6]; -- IASTREAM
VolumeControl[6]; -- ISOUND or ISOUNDPLAYER
Player[6]; -- IMEDIA or ISOUND

Thanks a ton......... :)
The information given by you will solve my problems.

Thanks a ton......... :)
The information given by you will solve my problems.

Hi,
I have one more doubt in porting.
In J2ME the method startApp() is being called as soon as the compiled code gets loaded. We also call this as entry point for the application.
Similarly, what should be the replacment for the above in BREW ? CAn you explain me with an example, which would be more helpful to me. :(
Many Thanks

Hi,
I have one more doubt in porting.
In J2ME the method startApp() is being called as soon as the compiled code gets loaded. We also call this as entry point for the application.
Similarly, what should be the replacment for the above in BREW ? CAn you explain me with an example, which would be more helpful to me. :(
Many Thanks

keerthi.bhatt wrote:In J2ME the method startApp() is being called as soon as the compiled code gets loaded. We also call this as entry point for the application.
Similarly, what should be the replacment for the above in BREW ? CAn you explain me with an example, which would be more helpful to me. :(
In BREW, AEEClsCreateInstance is the entry point for a module. Here it creates a new applet using AEEApplet_New and set the handler,free function for it and then initializes the application data (like shell pointer and display pointer, anything else in the app structure which you want to init before app start). Then EVT_APP_START is send to the handler function to do actions to show the main screen.
Check this thread and you will know about app lifecycle event flow in BREW
about App Closing and starting state(event)
http://brewforums.qualcomm.com/showthread.php?t=17019

keerthi.bhatt wrote:In J2ME the method startApp() is being called as soon as the compiled code gets loaded. We also call this as entry point for the application.
Similarly, what should be the replacment for the above in BREW ? CAn you explain me with an example, which would be more helpful to me. :(
In BREW, AEEClsCreateInstance is the entry point for a module. Here it creates a new applet using AEEApplet_New and set the handler,free function for it and then initializes the application data (like shell pointer and display pointer, anything else in the app structure which you want to init before app start). Then EVT_APP_START is send to the handler function to do actions to show the main screen.
Check this thread and you will know about app lifecycle event flow in BREW
about App Closing and starting state(event)
http://brewforums.qualcomm.com/showthread.php?t=17019

thank u ..
from ur information i was able to create Entry point for my class.
Now the problem is with DataInputStream and ByeInputStream
Im unable to find equivalents in BREW also i searched in BREWAPIREFERENCE.
pls suggest wat can be used ???

thank u ..
from ur information i was able to create Entry point for my class.
Now the problem is with DataInputStream and ByeInputStream
Im unable to find equivalents in BREW also i searched in BREWAPIREFERENCE.
pls suggest wat can be used ???

keerthi.bhatt wrote:
Now the problem is with DataInputStream and ByeInputStream
pls suggest wat can be used ???
Check IAStream interface. At present, the IFile and ISocket classes implement the IAStream Interface. IAStream is an abstract class, so you can also define another interface deriving from IAStream to suit your needs.
The IFILE is used for all file operations. :) IFILE_Read, reads data into a void buffer, so I believe you can use it for both data and byte streams (accordingly void buffer pointer would be either a char ptr or byte ptr).

keerthi.bhatt wrote:
Now the problem is with DataInputStream and ByeInputStream
pls suggest wat can be used ???
Check IAStream interface. At present, the IFile and ISocket classes implement the IAStream Interface. IAStream is an abstract class, so you can also define another interface deriving from IAStream to suit your needs.
The IFILE is used for all file operations. :) IFILE_Read, reads data into a void buffer, so I believe you can use it for both data and byte streams (accordingly void buffer pointer would be either a char ptr or byte ptr).

THe code below in J2ME is like this ..........
byte abyte1[] = new byte[j1 = (datainputstream = new DataInputStream(midlet.getClass().getResourceAsStream(s))).read(abyte0)];
This is simpler to code in java. But in C++ im unable to convert ?
Pls help me .............
Thanks again !!!!!!!!!!!

THe code below in J2ME is like this ..........
byte abyte1[] = new byte[j1 = (datainputstream = new DataInputStream(midlet.getClass().getResourceAsStream(s))).read(abyte0)];
This is simpler to code in java. But in C++ im unable to convert ?
Pls help me .............
Thanks again !!!!!!!!!!!

When i declare
MediaUtil *pMediaUtil;
IFILE* a1;
in my brew code. It throws me the error
f:\wordgridproject\c_source\c_source\b.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I have included the following header in my .h file...
#include "AEEMediaUtil.h"
#include
#include "AEEFile.h"
Please tel me. What may be the problem ????

When i declare
MediaUtil *pMediaUtil;
IFILE* a1;
in my brew code. It throws me the error
f:\wordgridproject\c_source\c_source\b.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I have included the following header in my .h file...
#include "AEEMediaUtil.h"
#include
#include "AEEFile.h"
Please tel me. What may be the problem ????

:( i didnt get nay reply for my earlier queries. Im unable to proceed further.
Still i will some more queries please answer these......
Im trying to Use this code
#include
ISound d1;
ISound_StopTone(&d1);
But im getting the following error:
..\..\c_source\c_source\b.cpp(131) : error C3861: 'ISound_StopTone': identifier not found
Should i instantiate Sound in any other way ?? Or wat may be the reason...
Please revert back sooooon........... :(

:( i didnt get nay reply for my earlier queries. Im unable to proceed further.
Still i will some more queries please answer these......
Im trying to Use this code
#include
ISound d1;
ISound_StopTone(&d1);
But im getting the following error:
..\..\c_source\c_source\b.cpp(131) : error C3861: 'ISound_StopTone': identifier not found
Should i instantiate Sound in any other way ?? Or wat may be the reason...
Please revert back sooooon........... :(

Hi,
In J2ME we use H = Image::createImage("/pencilStrip.png"); to load the image.. Similarly in Brew we have something called IImage.. Are they both same ??
If so can you please let me know where can i find examples for the same ..
One More doubt is ... In J2Me ther s a method repaint() being called in my application. So wat can be used in BREW which replaces the method mentioned ???
Please answer me as soon as possible,,,,,
Thanks in Advance

Hi,
In J2ME we use H = Image::createImage("/pencilStrip.png"); to load the image.. Similarly in Brew we have something called IImage.. Are they both same ??
If so can you please let me know where can i find examples for the same ..
One More doubt is ... In J2Me ther s a method repaint() being called in my application. So wat can be used in BREW which replaces the method mentioned ???
Please answer me as soon as possible,,,,,
Thanks in Advance

keerthi.bhatt wrote:When i declare
IFILE* a1;
f:\wordgridproject\c_source\c_source\b.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Interface name is IFile and not IFILE. IN BREW interface name will be in Mixed case (like here) and function name starts with interface name all in caps (For eg: IFILE_Read)..
keerthi.bhatt wrote:#include
ISound d1;
ISound_StopTone(&d1);
But im getting the following error:
..\..\c_source\c_source\b.cpp(131) : error C3861: 'ISound_StopTone': identifier not found

Include AEEISound.h for the definition of ISound_StopTone
Declare ISound as a pointer. Eg: ISound *d1;
Assuming you are creating instance of ISound somwhere in the code. use ISound_StopTone(d1);

keerthi.bhatt wrote:When i declare
IFILE* a1;
f:\wordgridproject\c_source\c_source\b.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Interface name is IFile and not IFILE. IN BREW interface name will be in Mixed case (like here) and function name starts with interface name all in caps (For eg: IFILE_Read)..
keerthi.bhatt wrote:#include
ISound d1;
ISound_StopTone(&d1);
But im getting the following error:
..\..\c_source\c_source\b.cpp(131) : error C3861: 'ISound_StopTone': identifier not found

Include AEEISound.h for the definition of ISound_StopTone
Declare ISound as a pointer. Eg: ISound *d1;
Assuming you are creating instance of ISound somwhere in the code. use ISound_StopTone(d1);

keerthi.bhatt wrote:Hi,
In J2ME we use H = Image::createImage("/pencilStrip.png"); to load the image.. Similarly in Brew we have something called IImage.. Are they both same ??
If so can you please let me know where can i find examples for the same ..
One More doubt is ... In J2Me ther s a method repaint() being called in my application. So wat can be used in BREW which replaces the method mentioned ???
- Use ISHELL_LoadImage() to load the bitmap format image directly from the file. If your bitmap is contained in a file, call ISHELL_LoadImage() and pass the file name of the bitmap file. If the function is successful, it returns a valid pointer to the IImage Interface object. The result of loading will be available in the call back function.
Note: To load PNG/JPG image , apt decoders (PNG/JPG) should be available on the phone.
- Use IImage function to operate on the image file..IImage_SetParm, IImage_GetInfo etc etc
Search this forum for "ISHELL_LoadImage()" or any IImage function, you'll get lots of examples..

keerthi.bhatt wrote:Hi,
In J2ME we use H = Image::createImage("/pencilStrip.png"); to load the image.. Similarly in Brew we have something called IImage.. Are they both same ??
If so can you please let me know where can i find examples for the same ..
One More doubt is ... In J2Me ther s a method repaint() being called in my application. So wat can be used in BREW which replaces the method mentioned ???
- Use ISHELL_LoadImage() to load the bitmap format image directly from the file. If your bitmap is contained in a file, call ISHELL_LoadImage() and pass the file name of the bitmap file. If the function is successful, it returns a valid pointer to the IImage Interface object. The result of loading will be available in the call back function.
Note: To load PNG/JPG image , apt decoders (PNG/JPG) should be available on the phone.
- Use IImage function to operate on the image file..IImage_SetParm, IImage_GetInfo etc etc
Search this forum for "ISHELL_LoadImage()" or any IImage function, you'll get lots of examples..

in answer to your second question, you redraw things on the screen with
IDisplay_Update()
Prototype:
void IDisplay_Update(IDisplay * po)
Parameters
po :[in]: Pointer to the IDisplay interface object that needs to be updated.
Return Value
none
the best place to look all this up is in the BREW SDK API reference (from which I quoted above) that is in the documentation that comes with brew. It's actually pretty thorough and well written.

in answer to your second question, you redraw things on the screen with
IDisplay_Update()
Prototype:
void IDisplay_Update(IDisplay * po)
Parameters
po :[in]: Pointer to the IDisplay interface object that needs to be updated.
Return Value
none
the best place to look all this up is in the BREW SDK API reference (from which I quoted above) that is in the documentation that comes with brew. It's actually pretty thorough and well written.

marges_sisters wrote:in answer to your second question, you redraw things on the screen with
IDisplay_Update()
the best place to look all this up is in the BREW SDK API reference (from which I quoted above) that is in the documentation that comes with brew. It's actually pretty thorough and well written.
thankyou marges_sisters, i missed it :) :)

marges_sisters wrote:in answer to your second question, you redraw things on the screen with
IDisplay_Update()
the best place to look all this up is in the BREW SDK API reference (from which I quoted above) that is in the documentation that comes with brew. It's actually pretty thorough and well written.
thankyou marges_sisters, i missed it :) :)

Thank u Oceans Eleven & marges sister.....
Solution given by you helped me a lot !!!!!!!!!!!!!!!
Thanks once again .... :D
Many Regards.... :)

Thank u Oceans Eleven & marges sister.....
Solution given by you helped me a lot !!!!!!!!!!!!!!!
Thanks once again .... :D
Many Regards.... :)

HI ...
I have installed BREW SDK 3.1.5. Im unable to find AEEISOUND.h file.. But API reference doc of the same mentions about AEEISOUND.h ... What may be d reason that im unable to find the file... :confused:
Can u pls tel me where can i find the .h file for the above... Pls reply imeediately.. Sorry since its Urgent i have no other ways except this forum... :(
Thanks a ton ..... :)

HI ...
I have installed BREW SDK 3.1.5. Im unable to find AEEISOUND.h file.. But API reference doc of the same mentions about AEEISOUND.h ... What may be d reason that im unable to find the file... :confused:
Can u pls tel me where can i find the .h file for the above... Pls reply imeediately.. Sorry since its Urgent i have no other ways except this forum... :(
Thanks a ton ..... :)

keerthi.bhatt wrote:HI ...
I have installed BREW SDK 3.1.5. Im unable to find AEEISOUND.h file.. But API reference doc of the same mentions about AEEISOUND.h ... What may be d reason that im unable to find the file... :confused:
Search inside BREWSDK 3.1.5 installation folder. I believe it is inside BREW_SDK_folder\inc or if not found there, check in BREW_SDK_folder\sdk\inc

keerthi.bhatt wrote:HI ...
I have installed BREW SDK 3.1.5. Im unable to find AEEISOUND.h file.. But API reference doc of the same mentions about AEEISOUND.h ... What may be d reason that im unable to find the file... :confused:
Search inside BREWSDK 3.1.5 installation folder. I believe it is inside BREW_SDK_folder\inc or if not found there, check in BREW_SDK_folder\sdk\inc

Thanx ..
I got the file.

Thanx ..
I got the file.

Hi,
Im facing a weird problem. I odnt know whether its right....
I have class d and class c.. ill explain d code..
d.h
class d
{
d(c& c1); *****Error is shown here
---------
-----------------
};
and In d.cpp the implementation is:
#include "d.h";
d::d(c& c1) {
-------------
---------------
};
But im getting th following error :
c_source\c_source\d.h(45) : error C2460: 'd::c' : uses 'd', which is being defined
c_source\c_source\d.h(13) : see declaration of 'd'
Please let me know ur solution ASAP...
thnk u

Hi,
Im facing a weird problem. I odnt know whether its right....
I have class d and class c.. ill explain d code..
d.h
class d
{
d(c& c1); *****Error is shown here
---------
-----------------
};
and In d.cpp the implementation is:
#include "d.h";
d::d(c& c1) {
-------------
---------------
};
But im getting th following error :
c_source\c_source\d.h(45) : error C2460: 'd::c' : uses 'd', which is being defined
c_source\c_source\d.h(13) : see declaration of 'd'
Please let me know ur solution ASAP...
thnk u

Seems to be issue of forward declaration.
before using object of c you must declare it like
class c;
class d
{
d(c& c1);

Seems to be issue of forward declaration.
before using object of c you must declare it like
class c;
class d
{
d(c& c1);

Thanx a lot nishanth, problem of forward declaration is solved.
Now im facing another problem bcoz of this.
Class D
{
class c;
c e; // ERROR HERE
}
My code is as mentioned above............... also class c was added to avoid forward declaration ( Refer prev reply)
Now the errors coming are :
d.h(21) : error C2079: 'd::e' uses undefined class 'd::c'
--------------------------------------------------------------------------------------------------------
I have one more question !!
I have a class C
class c
{
c c;
SomeFunction(c);
}
I am tryin to do the similar thin.. trying to creat a object of same class n passing that object to a function. But im getting the error
c.h(28) : error C2460: 'c::c : uses 'c', which is being defined
I know im wrong somewhere .. But where ? Pls help in finding out ...
So pls gimme d solutions for both. :)
THanx a lot

Thanx a lot nishanth, problem of forward declaration is solved.
Now im facing another problem bcoz of this.
Class D
{
class c;
c e; // ERROR HERE
}
My code is as mentioned above............... also class c was added to avoid forward declaration ( Refer prev reply)
Now the errors coming are :
d.h(21) : error C2079: 'd::e' uses undefined class 'd::c'
--------------------------------------------------------------------------------------------------------
I have one more question !!
I have a class C
class c
{
c c;
SomeFunction(c);
}
I am tryin to do the similar thin.. trying to creat a object of same class n passing that object to a function. But im getting the error
c.h(28) : error C2460: 'c::c : uses 'c', which is being defined
I know im wrong somewhere .. But where ? Pls help in finding out ...
So pls gimme d solutions for both. :)
THanx a lot

Hi,
Got a problem while porting. Im using the porting framework provided by blue-edge. They have a class Canvas which has a virtual method repaint().
Since the class is abstract im unable to call the method. Is ther any other way aroun other than extending the class.
One more is in J2ME we use a method getKeyCode to identify the key pressed. Please tel me the function used to find out the keycode in BREW.
Thanks & Regards

Hi,
Got a problem while porting. Im using the porting framework provided by blue-edge. They have a class Canvas which has a virtual method repaint().
Since the class is abstract im unable to call the method. Is ther any other way aroun other than extending the class.
One more is in J2ME we use a method getKeyCode to identify the key pressed. Please tel me the function used to find out the keycode in BREW.
Thanks & Regards

It seems like you do not check the J2ME life cycle :D. Here a verys short description.
In J2ME there are two major things:
1. Midlet
2. Canvas
In midlet you can find some general function:
1. startApp()
--> Entry Point of any J2ME application.
--> Here Canvas object is created.
--> Canvas which need to be run can be set as displayble object.
2. pauseApp()
--> When TAPI or any other interrupt comes pauseApp() is called.
3. destroyApp()
--> When Application is exit this function is called.
Now one midlet can have multiple canvas. In canvas run(), repaint() and paint() method are the main method. Run is like a callback which is called on each thread.
repaint()

It seems like you do not check the J2ME life cycle :D. Here a verys short description.
In J2ME there are two major things:
1. Midlet
2. Canvas
In midlet you can find some general function:
1. startApp()
--> Entry Point of any J2ME application.
--> Here Canvas object is created.
--> Canvas which need to be run can be set as displayble object.
2. pauseApp()
--> When TAPI or any other interrupt comes pauseApp() is called.
3. destroyApp()
--> When Application is exit this function is called.
Now one midlet can have multiple canvas. In canvas run(), repaint() and paint() method are the main method. Run is like a callback which is called on each thread.
repaint()