<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9111161</id><updated>2011-12-14T19:12:21.050-08:00</updated><title type='text'>J2ME Setup</title><subtitle type='html'>A blog of "Avatar_J2ME": special interest group for Java™ micro edition technology (J2ME). Containing news, tutorials, current issues, and others useful information!
It's where developers seeks help, and share experience!
Visit the J2ME discussion group on http://groups.google.com/group/Avatar_J2ME.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9111161.post-113354300836918767</id><published>2005-12-02T09:01:00.000-08:00</published><updated>2005-12-02T09:30:46.100-08:00</updated><title type='text'>M3G - 3D Object Materials</title><content type='html'>&lt;p style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;a name="N10393"&gt;&lt;span class="atitle"&gt;Materials&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;          &lt;p&gt;A light can cause different effects. A shiny silver ball reflects the light in a different way than a sheet of paper does. M3G models these material characteristics with the following attributes:&lt;/p&gt;           &lt;ul&gt; &lt;li&gt;Ambient reflection: The light that is reflected by an ambient light source.&lt;/li&gt;&lt;li&gt;Diffuse reflection: The reflected light is scattered equally in all directions.&lt;/li&gt;&lt;li&gt;Emissive light: An object can send out light to imitate glowing objects.&lt;/li&gt;&lt;li&gt;Specular reflection: The light that reflects off objects with a shiny surface.&lt;/li&gt; &lt;/ul&gt;           &lt;p&gt;You can set a color for each material attribute. The shiny silver ball's diffused color would be silver and its specular component white. To get the final object color, the material's color mixes with the light's color. If you point a blue light toward the silver ball, it would turn bluish.&lt;/p&gt;           &lt;p&gt;Listing 9 shows how to use materials:&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt;           &lt;br /&gt;&lt;a name="N103B5"&gt;&lt;b&gt;Listing 9. Setting a material&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class="section"&gt;// Create appearance and the material.&lt;br /&gt;_cubeAppearance = new Appearance();&lt;br /&gt;_colorTarget = COLOR_DEFAULT;&lt;br /&gt;setMaterial(_cubeAppearance, _colorTarget);&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Sets the material according to the given target.&lt;br /&gt;*&lt;br /&gt;* @param appearance appearance to be modified.&lt;br /&gt;* @param colorTarget target color.&lt;br /&gt;*/&lt;br /&gt;protected void setMaterial(Appearance appearance, int colorTarget)&lt;br /&gt;{&lt;br /&gt;Material material = new Material();&lt;br /&gt;&lt;br /&gt;switch (colorTarget)&lt;br /&gt;{&lt;br /&gt;case COLOR_DEFAULT:&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;case COLOR_AMBIENT:&lt;br /&gt;  material.setColor(Material.AMBIENT, 0x00FF0000);&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;case COLOR_DIFFUSE:&lt;br /&gt;  material.setColor(Material.DIFFUSE, 0x00FF0000);&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;case COLOR_EMISSIVE:&lt;br /&gt;  material.setColor(Material.EMISSIVE, 0x00FF0000);&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;case COLOR_SPECULAR:&lt;br /&gt;&lt;br /&gt;  material.setColor(Material.SPECULAR, 0x00FF0000);&lt;br /&gt;  material.setShininess(2);&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;// no default&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;appearance.setMaterial(material);&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;      &lt;p&gt;&lt;code&gt;setMaterial()&lt;/code&gt; creates a new &lt;code&gt;Material&lt;/code&gt; object and sets the colors with &lt;code&gt;setColor()&lt;/code&gt; using the respective color component identifier. The &lt;code&gt;Material&lt;/code&gt; object is then assigned to an &lt;code&gt;Appearance&lt;/code&gt; object, which is used in the call to &lt;code&gt;Graphics3D.render()&lt;/code&gt;. Although not shown here, you can use &lt;code&gt;Material.setVertexColorTrackingEnable()&lt;/code&gt; in order to use the vertex colors for ambient and diffuse reflection instead of using &lt;code&gt;Material.setColor()&lt;/code&gt;. Both lights and materials are implemented in &lt;a href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/sidefile5.html"&gt;LightingMaterialsSample.java&lt;/a&gt;. Using keys, you can combine different lights with materials to experiment with the effects.&lt;/p&gt;            &lt;p&gt;In Figure 9, the different material characteristics are displayed using an omnidirectional light. Each screenshot sets a single color component to red to demonstrate its effect in isolation.&lt;/p&gt;               &lt;br /&gt;&lt;a name="N103E6"&gt;&lt;b&gt;Figure 9. Different color components: a) Ambient, b) Diffuse, c) Emissive, and d) Specular&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;      &lt;img style="width: 464px; height: 168px;" alt="Different color components: a) Ambient, b) Diffuse, c) Emissive, and d) Specular" src="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/figure9.jpg" /&gt;   &lt;br /&gt;      &lt;p&gt;The ambient reflection only reacts to ambient light; thus, using an omnidirectional light has no effect. The diffuse material component creates a matte surface, while the emissive component creates a glowing effect. The specular color component emphasizes the shininess. Again, you could improve the shading quality by using more triangles.&lt;br /&gt;&lt;/p&gt; &lt;p style="font-weight: bold;"&gt;&lt;span style="font-size:78%;"&gt;(picked from &lt;a href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/"&gt;IBM developer site&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;By Avatar
http://avatar21.superihost.com/&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9111161-113354300836918767?l=j2mesetup.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/113354300836918767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9111161&amp;postID=113354300836918767' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354300836918767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354300836918767'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/2005/12/m3g-3d-object-materials.html' title='M3G - 3D Object Materials'/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9111161.post-113354273186026830</id><published>2005-12-02T08:54:00.000-08:00</published><updated>2005-12-02T09:28:51.613-08:00</updated><title type='text'>Your first 3D object</title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;a name="N10077"&gt;&lt;span class="atitle"&gt;Your first 3D object&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;       &lt;p&gt;As a first example, you'll create a cube as displayed in Figure 1.&lt;/p&gt;                &lt;br /&gt;&lt;a name="N10082"&gt;&lt;b&gt;Figure 1. Sample cube: a) Front view with vertex indices, b) Side view with clipping planes (Front, Side)&lt;/b&gt;&lt;/a&gt;&lt;br /&gt; &lt;img style="width: 385px; height: 163px;" alt="Sample cube: (a) front view with vertex indices (b) side view with clipping planes" src="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/figure1.gif" /&gt;&lt;br /&gt; &lt;p&gt;The cube lives in what M3G defines as a right-handed coordinate system. If you take your right hand and stretch out your thumb, index finger, and middle finger so that each finger is in a right angle to the other two fingers, then the thumb is your x axis, the index finger the y axis, and the middle finger the z axis. Try to align your thumb and index finger with the x and y axis in Figure 1a; your middle finger should then point toward you. I've used eight vertices (the cube's corner points) and placed the cube's center at the coordinate system's origin.&lt;/p&gt;         &lt;p&gt;As you can see in Figure 1, the camera that shoots the 3D scene looks toward the negative z axis, facing the cube. The camera's position and properties define what the screen later displays. Figure 1b shows a side view of the same scene so you can easily see what part of the 3D world is visible to the camera. One limiting factor is the viewing angle, which is comparable to using a camera lens: a telephoto lens has a narrower view than a wide-angle lens. The viewing angle thus determines what you can see to the sides. Unlike the real world, 3D computing gives you two more view boundaries: near and far clipping planes. Together, the viewing angle and the clipping planes define what is called the &lt;i&gt;view frustum&lt;/i&gt;. Everything inside the view frustum is visible, everything outside is not.&lt;/p&gt;         &lt;p&gt;This is all implemented in the &lt;code&gt;VerticesSample&lt;/code&gt; class, whose members you can see in Listing 1.&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt;      &lt;br /&gt;&lt;a name="N100A4"&gt;&lt;b&gt;Listing 1. Sample displaying a cube, Part 1: Class members&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class="section"&gt;&lt;br /&gt;package m3gsamples1;&lt;br /&gt;&lt;br /&gt;import javax.microedition.lcdui.*;&lt;br /&gt;import javax.microedition.m3g.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Sample displaying a cube defined by eight vertices, which are connected&lt;br /&gt;* by triangles.&lt;br /&gt;*&lt;br /&gt;* @author Claus Hoefele&lt;br /&gt;*/&lt;br /&gt;public class VerticesSample extends Canvas implements Sample&lt;br /&gt;{&lt;br /&gt;/** The cube's vertex positions (x, y, z). */&lt;br /&gt;private static final byte[] VERTEX_POSITIONS = {&lt;br /&gt;-1, -1,  1,    1, -1,  1,   -1,  1,  1,    1,  1,  1,&lt;br /&gt;-1, -1, -1,    1, -1, -1,   -1,  1, -1,    1,  1, -1&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;/** Indices that define how to connect the vertices to build&lt;br /&gt;* triangles. */&lt;br /&gt;private static int[] TRIANGLE_INDICES = {&lt;br /&gt;0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;/** The cube's vertex data. */&lt;br /&gt;private VertexBuffer _cubeVertexData;&lt;br /&gt;&lt;br /&gt;/** The cube's triangles defined as triangle strips. */&lt;br /&gt;private TriangleStripArray _cubeTriangles;&lt;br /&gt;&lt;br /&gt;/** Graphics singleton used for rendering. */&lt;br /&gt;private Graphics3D _graphics3d;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;code&gt;VerticesSample&lt;/code&gt; inherits from &lt;code&gt;Canvas&lt;/code&gt; to be able to draw directly to the display. It also implements &lt;code&gt;Sample&lt;/code&gt;, which I defined to help organize this article's different source code samples. &lt;code&gt;VERTEX_POSITIONS&lt;/code&gt; defines eight vertices in the same order, as shown in Figure 1a. For example, vertex 0 is defined as position (-1, -1, 1). Remember that I placed the cube's center at the coordinate system's origin; therefore, the cube's edges will be two units long. The camera's position and viewing angle will later define the amount of pixels a unit will occupy on the screen. &lt;p&gt;The vertex positions are not enough, however; you also have to say what geometry you want to build. Like in a dot-to-dot painting, you have to connect vertices with lines until you see the resulting drawing. M3G poses one restriction though: you must build the geometry from triangles. Triangles are popular with 3D implementations because you can define any polygon as a set of triangles. A triangle is a basic drawing operation on which you can build more abstract operations.&lt;/p&gt;         &lt;p&gt;Unfortunately, if you had to describe the cube with triangles alone, you would need 6 sides * 2 triangles * 3 vertices = 36 vertices; this would be a waste of memory as many vertices are duplicated. To reduce memory, you first separate the vertices from their triangle definitions. &lt;code&gt;TRIANGLE_INDICES&lt;/code&gt; defines the geometry using the indices of the &lt;code&gt;VERTEX_POSITIONS&lt;/code&gt; array and can thus reuse vertices. Next, you reduce the number of indices by using triangle strips instead of triangles. With a triangle strip, new triangles reuse the preceding triangle's last two indices. For example, the triangle strip (0, 1, 2, 3) will translate to two triangles (0, 1, 2) and (1, 2, 3). When you follow the triangle definitions in &lt;code&gt;TRIANGLE_INDICES&lt;/code&gt; with Figure 1a, where I marked each corner with the respective index, you'll see that the triangles jump wildly between sides. This is just a pattern to avoid the definition of several strips. I managed with eight vertices and one single triangle strip with 14 indices for the cube.&lt;/p&gt;         &lt;p&gt;You use the rest of the class members to draw the cube. Listing 2 shows their initialization.&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt;      &lt;br /&gt;&lt;a name="N100D5"&gt;&lt;b&gt;Listing 2. Sample displaying a cube, Part 2: Initialization&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class="section"&gt;/**&lt;br /&gt;* Called when this sample is displayed.&lt;br /&gt;*/&lt;br /&gt;public void showNotify()&lt;br /&gt;{&lt;br /&gt;init();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Initializes the sample.&lt;br /&gt;*/&lt;br /&gt;protected void init()&lt;br /&gt;{&lt;br /&gt;// Get the singleton for 3D rendering.&lt;br /&gt;_graphics3d = Graphics3D.getInstance();&lt;br /&gt;&lt;br /&gt;// Create vertex data.&lt;br /&gt;_cubeVertexData = new VertexBuffer();&lt;br /&gt;&lt;br /&gt;VertexArray vertexPositions =&lt;br /&gt;new VertexArray(VERTEX_POSITIONS.length/3, 3, 1);&lt;br /&gt;vertexPositions.set(0, VERTEX_POSITIONS.length/3, VERTEX_POSITIONS);&lt;br /&gt;_cubeVertexData.setPositions(vertexPositions, 1.0f, null);&lt;br /&gt;&lt;br /&gt;// Create the triangles that define the cube; the indices point to&lt;br /&gt;// vertices in VERTEX_POSITIONS.&lt;br /&gt;_cubeTriangles = new TriangleStripArray(TRIANGLE_INDICES,&lt;br /&gt;new int[] {TRIANGLE_INDICES.length});&lt;br /&gt;&lt;br /&gt;// Create a camera with perspective projection.&lt;br /&gt;Camera camera = new Camera();&lt;br /&gt;float aspect = (float) getWidth() / (float) getHeight();&lt;br /&gt;camera.setPerspective(30.0f, aspect, 1.0f, 1000.0f);&lt;br /&gt;Transform cameraTransform = new Transform();&lt;br /&gt;cameraTransform.postTranslate(0.0f, 0.0f, 10.0f);&lt;br /&gt;_graphics3d.setCamera(camera, cameraTransform);&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt; &lt;p&gt;As a first step in &lt;code&gt;init()&lt;/code&gt;, you obtain the graphics context for 3D drawing. &lt;code&gt;Graphics3D&lt;/code&gt; is a singleton and &lt;code&gt;_graphics3d&lt;/code&gt; holds a reference for later use. Next, you create a &lt;code&gt;VertexBuffer&lt;/code&gt; to hold the vertex data. As you'll see later, you can assign several kinds of information to a vertex, and &lt;code&gt;VertexBuffer&lt;/code&gt; contains all of them. Currently, the only information you need is vertex positions in a &lt;code&gt;VertexArray&lt;/code&gt; that is set using &lt;code&gt;_cubeVertexData.setPositions()&lt;/code&gt;. The constructor of &lt;code&gt;VertexArray&lt;/code&gt; takes the number of vertices (eight), the number of components per vertex (x, y, z), and the size of each component (one byte). Because the cube is so small, one byte is enough to hold one coordinate. You can also create a &lt;code&gt;VertexArray&lt;/code&gt; using short values (two bytes) if you want to create larger objects. However, you can't use real numbers, only integers. Next, you initialize a &lt;code&gt;TriangleStripArray&lt;/code&gt; with the indices from &lt;code&gt;TRIANGLE_INDICES&lt;/code&gt;.&lt;/p&gt;         &lt;p&gt;The final part of the initialization code is the camera setup. In &lt;code&gt;setPersective()&lt;/code&gt;, you set the viewing angle, the aspect ratio, and the clipping planes. Notice that the aspect ratio and the values for the clipping planes are float values. M3G requires floating point support, which has been available since CLDC 1.1, from the Java Virtual Machine (JVM). After setting the perspective, you move the camera away from the cube so you have a full view of the object. You do this with a translation, a topic I'll explain in more detail in the section about &lt;a href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/#transformations"&gt;Transformations&lt;/a&gt;. For now, trust me that &lt;code&gt;postTranslate()&lt;/code&gt; with a positive third parameter moves the camera along the z axis.&lt;/p&gt;         &lt;p&gt;After the initialization, you render the scene to the screen. Listing 3 shows this.&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt;     &lt;br /&gt;&lt;a name="N10120"&gt;&lt;b&gt;Listing 3. Sample displaying a cube, Part 3: Drawing&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class="section"&gt;/**&lt;br /&gt;* Renders the sample on the screen.&lt;br /&gt;*&lt;br /&gt;* @param graphics the graphics object to draw on.&lt;br /&gt;*/&lt;br /&gt;protected void paint(Graphics graphics)&lt;br /&gt;{&lt;br /&gt;_graphics3d.bindTarget(graphics);&lt;br /&gt;_graphics3d.clear(null);&lt;br /&gt;_graphics3d.render(_cubeVertexData, _cubeTriangles,&lt;br /&gt;new Appearance(), null);&lt;br /&gt;_graphics3d.releaseTarget();&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt; &lt;table align="right" border="0" cellpadding="0" cellspacing="0" width="40%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td width="10"&gt;&lt;img alt="" src="http://www.ibm.com/i/c.gif" height="1" width="10" /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;         &lt;p&gt;In &lt;code&gt;paint()&lt;/code&gt;, &lt;code&gt;bindTarget()&lt;/code&gt; assigns the &lt;code&gt;Canvas&lt;/code&gt;'s graphics context to &lt;code&gt;Graphics3D&lt;/code&gt;. This enables rendering 3D objects until &lt;code&gt;releaseTarget()&lt;/code&gt; is called. After a call to &lt;code&gt;clear()&lt;/code&gt; erases the background, you draw the cube by using the vertex data and triangles created in &lt;code&gt;init()&lt;/code&gt;. Many of &lt;code&gt;Graphics3D&lt;/code&gt;'s methods throw unchecked exceptions, but I decided to do without a &lt;code&gt;try&lt;/code&gt;/&lt;code&gt;catch&lt;/code&gt; block because most of the errors are unrecoverable. You can find this sample's complete source code in &lt;a href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/sidefile1.html"&gt;VerticesSample.java&lt;/a&gt;.&lt;/p&gt;         &lt;p&gt;To display the sample, I wrote a simple MIDlet. You can get it from the &lt;a href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/#download"&gt;download section&lt;/a&gt; together with the article's entire source code. You can see the result of running the sample in Figure 2.&lt;/p&gt;        &lt;br /&gt;&lt;a name="N1016B"&gt;&lt;b&gt;Figure 2. The sample cube&lt;/b&gt;&lt;/a&gt;&lt;br /&gt; &lt;img alt="The sample cube" src="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/figure2.jpg" height="191" width="144" /&gt;&lt;br /&gt; &lt;p&gt;It's difficult to tell that the rectangle on the screen is a cube because I placed the camera directly in front of it, which is like standing too close to a white wall. Why is it white? Because I haven't yet assigned any colors and white is the default. The next section will fix that.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-weight: bold;"&gt;(picked from &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www-128.ibm.com/developerworks/java/library/wi-mobile1/"&gt;IBM developer site)&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;By Avatar
http://avatar21.superihost.com/&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9111161-113354273186026830?l=j2mesetup.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/113354273186026830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9111161&amp;postID=113354273186026830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354273186026830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354273186026830'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/2005/12/your-first-3d-object.html' title='Your first 3D object'/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9111161.post-113354246004963771</id><published>2005-12-02T08:40:00.000-08:00</published><updated>2005-12-02T08:54:20.543-08:00</updated><title type='text'>JSR-184 a.k.a. Micro3D a.k.a. Java Mobile 3D</title><content type='html'>&lt;span style="font-family:Times;font-size:180%;"&gt;&lt;span style="font-size: 34px; font-family: Times;"&gt;&lt;b&gt;What is Java Mobile 3D?&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;&lt;br /&gt;Definition from &lt;/span&gt;&lt;/span&gt;&lt;a href="http://developer.sonyericsson.com/"&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;Sony Ericsson &lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;&lt;a href="http://developer.sonyericsson.com/"&gt;developer site&lt;/a&gt;:&lt;br /&gt;&lt;a href="http://www.jcp.org/en/jsr/detail?id=184"&gt;Java Mobile 3D Graphics&lt;/a&gt; (also known as &lt;a href="http://www.jcp.org/aboutJava/communityprocess/final/jsr184/"&gt;&lt;span class="hl"&gt;JSR&lt;/span&gt; &lt;span class="hl"&gt;184&lt;/span&gt;&lt;/a&gt;) is an API tailored for the generation and presentation of 3D &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;content on mobile platforms. This section discusses this API and an alternate 3D implementation, HI Corporation’s &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;&lt;a href="http://www.mascotcapsule.com/"&gt;Mascot Capsule&lt;/a&gt; &lt;span class="hl"&gt;Micro3D&lt;/span&gt; version 3 (also known as &lt;span class="hl"&gt;Micro3D&lt;/span&gt;). Sony Ericsson has chosen to implement both API &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;sets, allowing Mascot Capsule &lt;span class="hl"&gt;Micro3D&lt;/span&gt; serve as a migration path for 3D applications until Java Mobile 3D-enabled &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;devices become widely available. Here, we’ll also briefly try to address any possible point of confusion related to&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt; the two implementations of 3D Java APIs  in &lt;a href="http://www.sonyericsson.com/"&gt;Sony Ericsson phones&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/products/sjwtoolkit/"&gt;M3G&lt;/a&gt; is a fun technology to play around for developers, ever in history 3D developement got so easy (well if compared with &lt;a href="http://www.microsoft.com/windows/directx/default.aspx"&gt;Direct3D&lt;/a&gt; and &lt;a href="http://www.opengl.org/"&gt;OpenGL&lt;/a&gt; programming)!&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times;font-size:100%;"&gt;&lt;span style="font-size: 12px; font-family: Times;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;By Avatar
http://avatar21.superihost.com/&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9111161-113354246004963771?l=j2mesetup.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/113354246004963771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9111161&amp;postID=113354246004963771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354246004963771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113354246004963771'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/2005/12/jsr-184-aka-micro3d-aka-java-mobile-3d.html' title='JSR-184 a.k.a. Micro3D a.k.a. Java Mobile 3D'/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9111161.post-113272489736319118</id><published>2005-11-22T21:48:00.000-08:00</published><updated>2005-11-22T21:48:17.370-08:00</updated><title type='text'></title><content type='html'>&lt;!-- Content --&gt; &lt;div name="content" style="border: 1px solid rgb(0, 0, 0); background-color: rgb(255, 255, 255); position: relative; width: 400px; height: 250px;"&gt;&lt;table valign="top" border="0" cellpadding="1" cellspacing="1" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor="#ff3300"&gt;Content&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;&lt;ul&gt;&lt;li&gt;Step 1:&lt;a href="http://j2mesetup.blogspot.com/#jdk"&gt;Install Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Step 2:&lt;a href="http://j2mesetup.blogspot.com/#j2me"&gt;Install J2ME Toolkit&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Step 3:&lt;a href="http://j2mesetup.blogspot.com/#test"&gt;Testing&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- JDK --&gt; &lt;div id="jdk" style="border: 1px solid rgb(0, 0, 0); background-color: rgb(255, 255, 255); position: relative; width: 400px; height: 250px;"&gt;&lt;table style="width: 400px; height: 33px;" valign="top" border="0" cellpadding="1" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor="#75a3ed"&gt;Installing JDK ...&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div id="jdk_body" style="position: relative; overflow: auto; width: 400px; height: 200px;"&gt;&lt;p&gt;Firstly, goto &lt;a href="http://java.sun.com/"&gt;"http://java.sun.com"&lt;/a&gt; and grab a copy of the latest JDK (notice: only J2RE will only allow you to run java apps, if you are going to developement MUST use a JDK).&lt;br /&gt; Unzip it and put it in a folder, here we use "c:/java/j2sdk" as a default directory!&lt;br /&gt; Then you have to setup an environment variable in order to make work.&lt;/p&gt;&lt;blockquote&gt;Setting up environment variable for Java ...&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Right click on "My Computer", select "properties"-&gt;"Advanced"-&gt;"Environment Variables", and you will see stuff like below:&lt;span style="font-weight: bold;"&gt;JAVA_HOME=C:\java\jdk1.2.4_01&lt;/span&gt; (refer to path where you install the Java sdk)&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;PATH= ... ;C:\java\jdk1.2.4_01\bin&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- J2ME --&gt; &lt;div id="j2me" style="border: 1px solid rgb(0, 0, 0); background-color: rgb(255, 255, 255); position: relative; width: 400px; height: 250px;"&gt;&lt;table valign="top" border="0" cellpadding="1" cellspacing="1" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor="#ff9900"&gt;Installing J2ME Toolkit ...&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div id="j2me_body" style="position: relative; overflow: auto; width: 400px; height: 200px;"&gt;&lt;p&gt;This may be as simple as it seems, just goto j2me &lt;a href="http://java.sun.com/products/sjwtoolkit/"&gt;download site&lt;/a&gt;, pick a copy of " Sun Java Wireless Toolkit" ... install it and start coding. Note that you may have a few choice either using an IDE like NetBean, JBuilder, and so on; to the build-in code writing module with the WirelessToolkit that you just downloaded or even start off with a Notepad!&lt;/p&gt;&lt;p&gt;Well my personal favor, a Notepad will do, try compiling with command prompt also, had a better feel of the whole development process.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- Test --&gt; &lt;div id="test" style="border: 1px solid rgb(0, 0, 0); background-color: rgb(255, 255, 255); position: relative; width: 400px; height: 250px;"&gt;&lt;table valign="top" border="0" cellpadding="1" cellspacing="1" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th bgcolor="#32cd32"&gt;Testing ...&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="position: relative; overflow: auto; width: 400px; height: 200px;"&gt;&lt;u&gt;Kick Start&lt;/u&gt;&lt;br /&gt;&lt;img src="http://java.sun.com/features/1997/oct/duke_power.gif" boder="1" /&gt;&lt;br /&gt;&lt;u&gt;Six simple Steps for writing a J2ME:&lt;/u&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Code a Java file.&lt;/li&gt;&lt;li&gt;Compile with CLDC and MIDP library.&lt;/li&gt;&lt;li&gt;Preverify it with "preverify.exe".&lt;/li&gt;&lt;li&gt;Write a manifest file, then package it with every classes and resources in a JAR file.&lt;/li&gt;&lt;li&gt;Write a JAD file for deploying purposes.&lt;/li&gt;&lt;li&gt;Test it on emulator or real device, do some performance tweaking and fine tuning for portability.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;ul&gt;Some assumption: &lt;li&gt;%J2ME_HOME%=C:\WTK22\&lt;/li&gt;&lt;li&gt;%JAVA_HOME%=C:\Program Files\Java\jdk1.5.0_04&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;u&gt;Writing a simple CLDC app...&lt;/u&gt;&lt;table align="left" border="0" cellpadding="10" cellspacing="0" width="100%"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc"&gt;&lt;pre&gt;import java.io.*;&lt;br /&gt;import javax.microedition.io.*;&lt;br /&gt;&lt;br /&gt;public class TestInputOutput {&lt;br /&gt;&lt;br /&gt;public static void main( String[] args ){&lt;br /&gt;try {&lt;br /&gt; String uri ="socket://www.ericgiguere.com:80";&lt;br /&gt; StreamConnection conn = (StreamConnection)&lt;br /&gt; Connector.open( uri );&lt;br /&gt;&lt;br /&gt; // Send HTTP request...&lt;br /&gt; PrintStream out = new PrintStream(conn.openOutputStream() );&lt;br /&gt; out.println( "GET /index.html HTTP/0.9\r\n" );&lt;br /&gt; out.flush();&lt;br /&gt;&lt;br /&gt; // Get raw HTTP reply...&lt;br /&gt; InputStream in = conn.openInputStream();&lt;br /&gt; int ch;&lt;br /&gt;&lt;br /&gt; while( ( ch = in.read() ) != -1 ){&lt;br /&gt;  System.out.print( (char) ch );&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; in.close();&lt;br /&gt; out.close();&lt;br /&gt; conn.close();&lt;br /&gt;}&lt;br /&gt;catch( ConnectionNotFoundException e ){&lt;br /&gt; System.out.println( "Socket could not be opened" );&lt;br /&gt;}&lt;br /&gt;catch( IOException e ){&lt;br /&gt; System.out.println( e.toString() );&lt;br /&gt;}&lt;br /&gt;System.exit( 0 );&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Writing a simple MIDP app...&lt;/u&gt;&lt;table align="left" border="0" cellpadding="10" cellspacing="0" width="100%"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc"&gt;&lt;pre&gt;import javax.microedition.lcdui.*;&lt;br /&gt;import javax.microedition.midlet.*;&lt;br /&gt;&lt;br /&gt;public class HelloMIDlet&lt;br /&gt;  extends MIDlet&lt;br /&gt;  implements CommandListener {&lt;br /&gt;private Form mMainForm;&lt;br /&gt;&lt;br /&gt;public HelloMIDlet() {&lt;br /&gt;  mMainForm = new Form("HelloMIDlet");&lt;br /&gt;  mMainForm.append(new StringItem(null, "Hello, MIDP!"));&lt;br /&gt;  mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));&lt;br /&gt;  mMainForm.setCommandListener(this);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void startApp() {&lt;br /&gt;  Display.getDisplay(this).setCurrent(mMainForm);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void pauseApp() {}&lt;br /&gt;&lt;br /&gt;public void destroyApp(boolean unconditional) {}&lt;br /&gt;&lt;br /&gt;public void commandAction(Command c, Displayable s) {&lt;br /&gt;  notifyDestroyed();&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;u&gt;To Compile your codes:&lt;/u&gt;&lt;pre&gt;%JAVA_HOME%\bin\javac -bootclasspath %J2ME_HOME%\lib\midpapi20.jar;%J2ME_HOME%\lib\cldcapi.jar MyJ2MEApp.java&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;To Preverify your class:&lt;/u&gt;&lt;pre&gt;%J2ME_HOME%\bin\preverify.exe -classpath %J2ME_HOME%\lib\midpapi20.jar;%J2ME_HOME%\lib\cldcapi.jar MyJ2MEApp&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;Writing a Menifest file:&lt;/u&gt;&lt;table align="left" border="0" cellpadding="10" cellspacing="0" width="100%"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc"&gt;&lt;pre&gt;MIDlet-Name: MyJ2MEApp&lt;br /&gt;MIDlet-Version: 1.0.0&lt;br /&gt;MIDlet-Vendor: Avatar&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;u&gt;To Package everything:&lt;/u&gt;&lt;pre&gt;%JAVA_HOME%\bin\jar cvfm MyJ2MEApp.jar Manifest.mf MyJ2MEApp.class&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;Writing a Java Application Describtion (JAD) file:&lt;/u&gt;&lt;table align="left" border="0" cellpadding="10" cellspacing="0" width="100%"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc"&gt;&lt;pre&gt;MIDlet-1: MyJ2MEApp, , MyJ2MEApp&lt;br /&gt;MIDlet-Name: MyJ2MEApp&lt;br /&gt;MIDlet-Version: 1.0.0&lt;br /&gt;MIDlet-Vendor: Avatar&lt;br /&gt;MIDlet-Jar-URL: MyJ2MEApp.jar&lt;br /&gt;MIDlet-Jar-Size:&lt;br /&gt;MicroEdition-Profile: MIDP-2.0&lt;br /&gt;MicroEdition-Configuration: CLDC-1.1&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;*&lt;strong&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Important notes&lt;/span&gt;&lt;/strong&gt; - remember to fill in the &lt;strong&gt;MIDlet-Jar-Size&lt;/strong&gt; with a correct file size of your jar (e.g.:MIDlet-Jar-Size: 1469)*&lt;br /&gt;&lt;u&gt;To Test your application:&lt;/u&gt;&lt;pre&gt;%J2ME_HOME%\bin\emulator.exe -Xdescriptor MyJ2MEApp.jad&lt;/pre&gt;&lt;br /&gt;Hooray, it is working!!!&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Resources:&lt;/u&gt;&lt;ol&gt;&lt;li&gt;Tutorial from &lt;a href="http://today.java.net/pub/a/today/2005/02/09/j2me1.html"&gt;java.net&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Sample code from &lt;a href="http://developers.sun.com/techtopics/mobility/configurations/reference/codesamples/"&gt;sun developer&lt;/a&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;By Avatar
http://avatar21.superihost.com/&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9111161-113272489736319118?l=j2mesetup.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/113272489736319118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9111161&amp;postID=113272489736319118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113272489736319118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113272489736319118'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/2005/11/contentstep-1install-javastep-2install.html' title=''/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9111161.post-113272460346357397</id><published>2005-11-22T20:38:00.000-08:00</published><updated>2005-11-22T21:46:51.586-08:00</updated><title type='text'>JDBC comes to J2ME finally?</title><content type='html'>&lt;a style="font-weight: bold;" href="http://java.sun.com/j2me/index.jsp"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;J2ME Brief Introduction&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a style="font-weight: bold;" href="http://java.sun.com/j2me/index.jsp"&gt;J2ME&lt;/a&gt; is always comes with limitation, limited memory, limited processing power, limited storage ... . It's made out of &lt;a style="font-weight: bold;" href="http://java.sun.com/products/midp/index.jsp"&gt;MIDP&lt;/a&gt; (&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;M&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;obile &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;I&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;nformation &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;D&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;evice &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;P&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;rofile&lt;/span&gt;) and &lt;a style="font-weight: bold;" href="http://java.sun.com/products/cldc/index.jsp"&gt;CLDC&lt;/a&gt; (&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;C&lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;onnected &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;L&lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;imited &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;D&lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;evice &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;C&lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;onfiguration&lt;/span&gt;), &lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;CLDC&lt;/span&gt; as defined by it's term ... represent a limited resource device. It &lt;span style="color: rgb(0, 0, 0);"&gt;minimum &lt;/span&gt; equiped with 128kb Java memory, 32kb heap, low power and low battery, &lt;span style="color: rgb(0, 0, 0);"&gt;network/wireless connectivity with low bandwidth&lt;/span&gt;. In those days, we can't put too much fancy stuffs in these kind of device, like database for instance.&lt;br /&gt;&lt;br /&gt;A big brother of &lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;CLDC&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, the &lt;a href="http://java.sun.com/products/cdc/"&gt;&lt;span style="font-weight: bold;"&gt;CDC&lt;/span&gt;&lt;/a&gt; (&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;C&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;onnected &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;D&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;evice &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;C&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;onfiguration&lt;/span&gt;) had far more capability than it's little brother (minimum 512kb memory, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;minimum 256kb heap, network persistent connectivity with high bandwidth&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;).&lt;br /&gt;&lt;br /&gt;So where do we see &lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;CDC&lt;/span&gt; and &lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;CLDC&lt;/span&gt;? &lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;CLDC&lt;/span&gt; is common among any j2me phones, but &lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;CDC&lt;/span&gt; can only be seen on high-end PDA phones like &lt;a href="http://www.forum.nokia.com/main/1,,010_50,00.html"&gt;Nokia S80 series&lt;/a&gt;, &lt;a href="http://developer.sonyericsson.com/site/global/newsandevents/latestnews/newsmar05/p_platform_strategy.jsp"&gt;Sony Ericsson smart phones&lt;/a&gt; and others which compliant with &lt;a href="http://www.jcp.org/en/jsr/detail?id=82"&gt;JSR-82&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;p style="font-weight: bold;"&gt; &lt;span class="subtitle"&gt;The JDBC Optional Package&lt;/span&gt; &lt;/p&gt;  &lt;p&gt; The &lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;JDBC&lt;/span&gt; optional package has been defined to enable CDC developers to write applications that access relational databases. This package is a subset of the &lt;code&gt;java.sql&lt;/code&gt; and &lt;code&gt;javax.sql&lt;/code&gt; packages in &lt;a href="http://java.sun.com/products/jdbc/"&gt;JDBC 3.0&lt;/a&gt; (it could be &lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;JDBC&lt;/span&gt; &gt; version 3.0 by the time you read this), with the smaller footprint required by &lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;CDC&lt;/span&gt;-based applications. &lt;/p&gt;  &lt;!--begin note --&gt; &lt;table bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;td colspan="5" class="dkgray" height="1"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td rowspan="3" class="dkgray" width="1"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt; &lt;td colspan="3" class="gray" height="10"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt; &lt;td rowspan="3" class="dkgray" width="1"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="gray" width="10"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt; &lt;td class="gray"&gt; &lt;span class="body"&gt; &lt;b&gt;Note&lt;/b&gt;: As of this writing, no reference implementation of the JDBC optional package exists. When an RI is released, you'll be able to build it with the CDC/FP using the &lt;code&gt;OPT_PKGS&lt;/code&gt;=&lt;b&gt;jdbc&lt;/b&gt; build option of CDC/Foundation or any other CDC-based profile.&lt;/span&gt; &lt;/td&gt; &lt;td class="gray" width="10"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td colspan="3" class="gray" height="10"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td colspan="5" class="dkgray" height="1"&gt;&lt;img src="http://developers.sun.com/techtopics/mobility/images/spacer.gif" alt="." border="0" height="1" width="1" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;  &lt;!-- end note --&gt; &lt;p&gt; To support the &lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;JDBC&lt;/span&gt; optional package, a device must meet the requirements for &lt;a href="http://www.jcp.org/aboutJava/communityprocess/final/jsr169/"&gt;CDC/Foundation&lt;/a&gt;, plus an additional 256KB of RAM and 256KB of ROM. &lt;/p&gt;By &lt;a href="http://avatar21.superihost.com/"&gt;Avatar&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;By Avatar
http://avatar21.superihost.com/&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9111161-113272460346357397?l=j2mesetup.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://j2mesetup.blogspot.com/feeds/113272460346357397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9111161&amp;postID=113272460346357397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113272460346357397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9111161/posts/default/113272460346357397'/><link rel='alternate' type='text/html' href='http://j2mesetup.blogspot.com/2005/11/jdbc-comes-to-j2me-finally.html' title='JDBC comes to J2ME finally?'/><author><name>Avatar Ng</name><uri>http://www.blogger.com/profile/17532077659766019555</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
