In this tutorial we are going to build a simple J2ME interface that enables a user to login in to a system. We will not create the actual system as the purpose of the tutorial is to show how web services can be used to connect a J2ME app to the web. You don’t need to have done the previous tutorials to understand this as we will not integrate the app with the web services in this tutorial.
Before we get started you must install Net Beans IDE on your computer. For the tutorial I will be using Net Beans 6.9.1. As we stated at the beginning of these tutorials the assumption is that you know how to create a J2ME application and so I will not actually show you how to create one but rather how to configure it such that you can use web services. A tutorial on how to create a J2ME application will be covered in another tutorial but not in this series.
The first thing we need to do is to change the emulator to that of a phone that can handle web services. This is a simple process; just follow the steps below:
1. On your project folder in Net Beans right click and select “Properties”. You will get a screen similar to the one shown below;
2. What we need to change is the Device. Using the dropdown please select “DefaultCldcMsaPhone1” and then on the “Optional Packages” make sure the following packages are selected;
- J2ME Web Services 1.0, J2ME ME Web Services 1.0
- Mobile Media API 1.1
- Wireless Messaging API 1.1
3. Now press “OK” to save the changes. The environment is now set.
That will be able for today; I have decided to keep the tutorials short and clear to make them easier to follow. In the next tutorial we are going to create the actual web service and test it.