Creating a simple J2ME app: Part 3 of Java web services


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;

Configuring J2ME for Java web services in Net Beans

Configuring J2ME for Java web services in Net Beans

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.

You can download the login code in a pdf format here or in word format here

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.

Advertisements

3 thoughts on “Creating a simple J2ME app: Part 3 of Java web services

  1. Pingback: Creating the Login: Java web services part 4 « KiruinC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s