INTEGRATION OF MPOWERPLAYER INTO ECLIPSE IDE
 

This tutorial for porting the emulator and implementing the build.xml was created with the help of the Mpowerplayer developer Michael, and Tyler a.k.a "haikusw".

This is not an officialy document of any kind, but just a privately written help documentation, which might help a few people. This documentation is targeted towards mac (apple) users, running Eclipse IDE 3.0 and above.

Requirements:

  • A Mac :)
  • Eclipse IDE
  • Midp 2.0 Emulator/ SDK
  • JRE 1.4.2 for mac
  • Ant
  • Setting Up The IDE:

    I am already assuming you have all the above requirements set up already, if not, go to the specific site listed above to see there documentation on how to set it up, that won't be covered here. After installing you IDE it asks you for a default workspace, which you should create and remember it location.

    This is somewhat what your IDE will look like after this tutorial



  • Step 1: Once you have your IDE opened, go to Eclipse > Prefereences. This opens up the preference window, under that window click on the small arrow beside java, to expand it, and choose build path(without expanding). Under build path, select folders (to use src and bin folders respectively)



  • Step 2: Expand Build path and select Classpath Variables, click on new and import the midp and cldc jar libraries from your mpowerplayer directory



  • Step 3: We then click on the User Libraries , under that section, we click new, name it midp, click on the newly created file "midp" and click add jars, repeat the process above (adding the cldc and midp jars)



  • Step 4: Close the preference window, we are through with that for now. Now we create our new project, go to FILE > NEW > PROJECT, select java project, the first on the list, click the Next button and input your project name, choose "create project in workspace" which we defined at the begining, underneath it is project layout, choose "create separate source and output folders". Just to be sure, click "Configure details" and select "folders" (src, bin).



  • Step 5: After you input your project name, click next, and click on the "Libraries" tab, click "Add library" button, a small window will pop up, select "User library" and under that, you will see your "midp" library you created earlier. Select it and add it. Click Finish.


    Now we have a working MIDP project. If you go to your workspace folder, you will see your bin and src folders in there, just put yout MANIFEST file in your bin folder, and add your Resources folder, if you have resources. Finally, do not forget to put your buildfile in the base directory. (just similar to the tutorial layout directory that came with your sdk).

  • Step 6: You can skip this step, if you do know how to add classes to your source folder using default packaging. When you create your new project, expand the project, right click on the "src" folder and click on new, to add a new class. Input the class name and select your required modifiers, and nothing else. It might give a warning, "The use of default package is discouraged" ignore it and move on. IF YOU USE A PACKAGE, THE EMULATOR WONT WORK WITH YOUR DEFAULT MANIFEST SETTINGS.



    Now We have to make the IDE compile the program, and run it using ANT, and the Mpowerplayer emulator.

  • Step 7: Right click on your project and select "Properties", Select the "Builders" option, disable "Java builder" and click "new" button on the right, a pop up comes, choose "ant" and use "Browse workspace" button to choose the file location of your build.xml file. Also choose "Browse workspace" for your base directory and select your project name. When that is Done, you click the "Targets" tab, you will notice package[default] has been selected as your default target, add the run target also, and make sure its in the other of package, run.





    This allows you to run your program using ant. This Is fully integrated to run your programme now.

  • Step 8: Now we are going to configure Run Command to run the Emulator Directly from the IDE without the Ant. Click on your project, go to Run > Run. Double click "Java Application" to create a run type. Name this new run command Runmidp. For your main class, put in> com.mpp.player.mpob [More Details here on getting main class], and select "include External jars while searching for main class" . Click the "Argument" tab and this under program arguments ${project_loc}/bin/${project_name}.jar For Working Directory, use default. Finally, we go to class path, add your project (done already by default), and add your player.jar (under user settings)





  •  

    Well this is the end of the tutorial, if you have any problems, please go to the message board for help @http://developer.mpowerplayer.com/index.php or mail me osaideatgmaildotcom