Java Micro Edition
SyncML is the standard for data synchronization and is accepted by Open Mobile Alliance (OMA). All the major players, including Ericsson, Nokia, IBM, Motorola, and Symbian support this protocol. The synchronization of data has great importance in today’s world. You carry email applications, contact database, files and other stuff on your handheld devices. It would be great of you can synchronize those with your desktop/notebook. For that there has to be a agreed format. ...
SMS stands for Short Messaging Service and it is very common in mobile communication. J2ME provides an API for SMS which makes messaging very easy. I will write a MIDlet to show how to create a messaging system using javax.wireless.messaging. First step is to import all the required APIs: Java Code: import javax.microedition.midlet.*; import javax.microedition.io.*; import javax.microedition.lcdui.*; import javax.wireless.messaging.*; ...
import javax.microedition.midlet.*; import javax.microedition.io.*; import javax.microedition.lcdui.*; import javax.wireless.messaging.*;
In this post, I will introduce you to the MIDlet suite. I assume that you people have worked with Eclipse. In Eclipse, you create projects and all the contents of the project are placed in the project folder. It is an approach for managing the work. MIDlet suite is very much like a standard Java project in Eclipse. Please note that it's not a requirement to place MIDlets inside a Java Archive (JAR) file, but JAR files provide the most common means of distributing MIDP ...
The subject topic is very interesting and a lot of people have asked me about this. It is just a matter of knowing how this works. I am sure you will find it very interesting. MIDlets are programmed using Java Development environments like Eclipse, JBuilder,Netbeans or Sun Java wireless Toolkit. Once coded, they are build and tested on emulators. When all the tests are passed, you want to finally deploy it to your mobile device to see how it works in real world scenerio. ...
RMS is a database (flat file) which MIDlets can use to persist data. In this post, I will introduce the audience with RMS. The device platform maintains the integrity of the MIDlet's record stores throughout the normal use. The reboots, battery changes, etc. won’t affect the RMS. An interesting question developers ask is, where is this Record Store created? It is created at platformdependent location, like nonvolatile device memory, and is not directly exposed to the MIDlets. ...
javax.microedition.lcdui provides TextField and TextBox which are sometimes confusing. Both are to allow the user to enter text, but question arises, when to use which one? In this post, I will try to address this issue. Let me first explain TextField (javax.microedition.lcdui.TextField). This class inherits from javax.microedition.lcdui.Item, so you should know that its an item that can be placed on a form. To create an instance of TextField, we use the TextField constructor: ...
JSR 75 specifies 2 optional packages for mobile devices. I will be talking about these in the next few posts. The two provided packages are: Java Code: javax.microedition.io.file javax.microedition.pim PIM stands for personal information and it contains following information: - contact list - todo list - events If you want to access these from a J2ME application, then javax.microedition.pim is to be used. ...
javax.microedition.io.file javax.microedition.pim
This post is all about reading and writing text files on mobile device. In order to write files on the mobile device, you need com.motorola.file.writeaccess. If your application has that permission, you can write files easily using the following code. Java Code: FileConnection sc = (FileConnection)Connector.open("file:///phone/tmp.txt"); OutputStream os = sc.openOutputStream(); os.write(("text to go into the file").getBytes()); ...
FileConnection sc = (FileConnection)Connector.open("file:///phone/tmp.txt"); OutputStream os = sc.openOutputStream(); os.write(("text to go into the file").getBytes());
This post presents a snippet for sending short text messages from J2Me applications. The com.sun.midp.io.j2me.sms package provides an API for the Short Message Service Messaging system and allows MIDlet to access SMS functionality on a GSM mobile device. You need javax.wireless.messaging.sms.send premission to send SMS messages from your J2ME application. The sample code is presented below: Java Code: sender = (MessageConnection)Connector.open("sms://"); ...
sender = (MessageConnection)Connector.open("sms://");
This post presents miscellaneous tasks that you can do in your J2ME application. Firstly, how to get GPS location. javax.microedition.location.Location provides support for this. Review the snippet below: Java Code: LocationProvider loc = LocationProvider.getInstance(null); loc.setLocationListener(ll,0,-1,-1); Location location = loc.getLocation(60*3); String lat = location.getQualifiedCoordinates().getLatitude(); String lon = location.getQualifiedCoordinates().getLongitude(); ...
LocationProvider loc = LocationProvider.getInstance(null); loc.setLocationListener(ll,0,-1,-1); Location location = loc.getLocation(60*3); String lat = location.getQualifiedCoordinates().getLatitude(); String lon = location.getQualifiedCoordinates().getLongitude();
MIDP provides a standard run-time environment that allows new applications and services to be deployed dynamically on end-user devices like cellular phones and pagers. The MIDP is built upon CLDC (Connected Limited Device Configuration). MIDP is an industry-standard profile for mobile devices and it is not dependent on a specific vendor. It is a provides foundation for mobile application development. MIDP contains following 3 core CLDC packages: java.lang java.io ...
To create an implementation of SyncML protocol, you may use sync4j. I will introduce you to sync4j in this post. You may download it from: http://sync4j.sourceforge.net. Sync4j possesses layered architecture and the layers are: Core layer - The actual SyncML handling is done by the core layer. Its responsibilities include XML parsing and conversion of the SyncML markup to an internal object representation. Sync4j can also convert internal ...
A lot of J2ME developers face problems when running multiple instance of Nokia Wireless Toolkit emulators. Some of the problems are linked with in.use file. This post is all about that. When your run the emulator, a file named in.use is created in the emulator’s root directory with will be something like: ..\j2mewtk\2.5.2\appdb\DefaultColorPhone\ This file is removed when the emulator shuts down. This emulator’s default directory will also ...
I will use several examples to show how to use RecordStrore in J2ME applications. Creating record store is simple. We use a static method to create or open an existing record store. Java Code: public static RecordStore openRecordStore(String recordStoreName, boolean createIfNecessary) throws RecordStoreException, RecordStoreFullException, ...
public static RecordStore openRecordStore(String recordStoreName, boolean createIfNecessary) throws RecordStoreException, RecordStoreFullException,
SMPP is a communication protocol designed for transfer of short messages between short message centre and SMS application. Some useful points about SMPP are listed below: - Binary encoded protocol data units are exchanged in request and response. - Transceiver support is added in version 2.4, which allows a single connection to send and receive messages. - Data exchange can be synchronous or a synchronous. External Short Message Entities ...
Each contact entry in a PIM Contact database is represented by Contact. This post is all about retrieving contact fields from PIM. The supported field list for a Contact depends on vCard specification from the Internet Mail Consortium. These set of fields included in this Contact class provides relevant information about a contact. ContactList restricts what fields a Contact can retain. This reflects that some native Contact databases do not support all o the fields available in a ...
javax.microedition.pim.ToDo is an interface that extends from PIMItem. It represents a single ToDo item in a PIMToDo database. I will present an example of how to retrieve ToDo list from PIM. Consider the following example. We create todos with fields of our interest. But before adding the field,w e should check if its supported on the platform or not. Java Code: ToDoList todos = null; try { todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST, ...
ToDoList todos = null; try { todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST,
Eclipse provides ‘Convert to J2ME Midlet Suite’ from the project pop-up menu to convert an existing Java project to EclipseME project. Let me show how to do that. When you select ‘Convert to J2ME Midlet Suite’’, you will be prompted for the appropriate device definition by the EclipseME plug-in. This plugin will then make the required changes to your project. When you convert a J2SE project to an EclipseME project, the J2SE libraries have to to be removed from the build ...
Many guys who are new to mobile application development often question: “Does Eclipse support MIDlet development?”. Yes it does. In the next few posts, I will explain how you can create a J2ME project in Eclipse. To cleate a EclipseME project, we should use the New Project Wizard and select J2ME Midlet Suite from within the J2ME item. You will then see a wizard pane which is actually the standard for almost all Eclipse projects. ...
java.lang.Thread is used to create and control threads. A new instance of this class must be created to use a new thread. Once a thread is created, it does not start running right away. Thread.start() must be called to actually make the thread run. On calling Thread.start(), the thread begins executing in the run() method of the target class. Remember that a new Thread class always starts running the public void run() method of a class. There are two ways to create a thread: ...
Updated 10-29-2011 at 07:32 PM by Java Tip
hollister and a full refund of...
Today, 11:46 AM in Java Software