<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Darryl Mocek&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/darryl_m/" />
<modified>2006-12-14T19:34:28Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/darryl_m/368</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2006, darryl_m</copyright>
<entry>
<title>phoneME Advanced Peer File Structure</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/darryl_m/archive/2006/12/phoneme_advance_1.html" />
<modified>2006-12-14T19:34:28Z</modified>
<issued>2006-12-13T20:01:31Z</issued>
<id>tag:weblogs.java.net,2006:/blog/darryl_m/368.6165</id>
<created>2006-12-13T20:01:31Z</created>
<summary type="text/plain">Discussion of the peer file structure in phoneME Advanced</summary>
<author>
<name>darryl_m</name>

<email>Darryl.Mocek@Sun.COM</email>
</author>
<dc:subject>Community: Mobile &amp; Embedded</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/darryl_m/">
<![CDATA[<P STYLE="margin-bottom: 0in">For those interested in creating a
phoneME Advanced implementation on other platforms with other
windowing toolkits, you may be wondering how and where to start.  The
first thing you'll want to do is get the CDC VM (CVM) up and running.
 I won't go into detail about this, but an important point to note is
that the CDC (Connected Device Configuration) specifies a set of Java
classes that must be present.  Besides porting the VM itself, the CDC
classes also need to be ported.  This, however, should be fairly
straightforward.  The bulk of the CDC Java code, which is usable
across platforms, is in the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/classes/">src/share/classes</A>
directory.  These Java classes require support of the underlying
native code which interfaces with the OS of choice directly.  The
bulk of the CDC native code can be found in the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/native">src/share/native</A>
directory.  For example, if you look at
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/classes/java/lang/Object.java">src/share/classes/java/lang/Object.java</A>,
it makes a native call (public final native Class getClass();) which
is serviced by <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/native/Object.c">src/share/native/java/lang/Object.c</A>.
 The files in the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share">src/share</A>
directory are shared by all implementations, regardless of the
hardware/OS.  If there are special requirements by the hardware/OS
which cannot be serviced by a shared file, you'll find files in
src/os&lt;-cpu&gt;.  For example, separate code is required to
interface with the audio device in Personal Profile.  So you'll find
audioDevice.c in these places:</P>
<UL>
	<LI><P STYLE="margin-bottom: 0in"><A NAME="DDE_LINK1"></A><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/darwin/personal/native/sun/audio/audioDevice.c">src/darwin/personal/native/sun/audio/audioDevice.c</A></P>
	<LI><P STYLE="margin-bottom: 0in"><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/linux/personal/native/sun/audio/audioDevice.c">src/linux/personal/native/sun/audio/audioDevice.c</A></P>
	<LI><P STYLE="margin-bottom: 0in"><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/win32/personal/native/sun/audio/audioDevice.c">src/win32/personal/native/sun/audio/audioDevice.c</A></P>
	<LI><P STYLE="margin-bottom: 0in"><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/solaris/personal/native/sun/audio/audioDevice.c">src/solaris/personal/native/sun/audio/audioDevice.c</A></P>
</UL>
<P STYLE="margin-bottom: 0in">The good news is that, as previously
stated in <A HREF="http://weblogs.java.net/blog/darryl_m/archive/2006/11/phoneme_advance.html"><SPAN STYLE="background: transparent"><FONT COLOR="#000000">this</FONT></SPAN></A>
article, the code which is NOT in the shared area is minimized as
much as is possible.</P><BR>
<P STYLE="margin-bottom: 0in">Once we get above the configuration to
the profiles, things become easier.  Sitting atop CDC is the
Foundation Profile (FP).  Almost all of the code for implementing the
FP is in the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/foundation">src/share/foundation</A>
directory.  And just like the CDC code, there is a
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/foundation/classes">src/share/foundation/classes</A>
directory for Java code and a <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/foundation/native">src/share/foundation/native</A>
directory for the native code which is called by the Java code. 
There are some files in the src/os&lt;-cpu&gt; directory which
support the Foundation Profile.  For example, the native
PlainSocketImpl_md.c file which supports FP's SocketImpl.java class
can be found in the src/os-&lt;cpu&gt; directories.</P><BR>
</P>
<P STYLE="margin-bottom: 0in">Above the FP lies the Personal Basis Profile (PBP).  Things get
a little more complicated here as the PBP adds windowing code in the
form of the Abstract Window Toolkit (AWT).  This complicates things
because there are different windowing toolkits on different platforms
(and even on the same platform!) which can be used.  Fortunately,
however, the PBP code is isolated to the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis">src/share/basis</A>
directory.  Again, the common <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis/classes">src/share/basis/classes</A>
directory contains the Java code and the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis/native">src/share/basis/native</A>
directory contains the supporting native code.  If you look in the
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis/classes/awt">src/share/basis/classes/awt</A>
directory, you'll see the Java classes which support the <A HREF="http://www.microwindows.org/">Microwindows</A>
and <A HREF="http://www.trolltech.com/">Qt</A> UI toolkits under the
microwindows and qt directories respectively.  And of course, under
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis/native/awt">src/share/basis/native/awt</A>
are also the microwindows and qt directories containing the
supporting native code.  The code in these native directories
interact directly with the microwindows and qt libraries.  This, plus
the corresponding Java code is the &ldquo;porting&rdquo; layer for
PBP.</P><BR>
<P>Above the PBP sits the Personal Profile
(PP).  PP is a bit different in that it re-implements some of the
classes in its underlying layer (PBP).  For example, you'll find an
AWTEvent.java and Graphics.java file in both PBP and PP.  This is
necessary to support the differences in PP.  PP has yet a different
directory structure from PBP underneath.  You'll notice in the
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/personal/classes">src/share/personal/classes</A>
directory, a directory named common.  This directory contains Java
classes which are common to the varying PP implementations.  For
example, there is a file named
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/personal/classes/common/java/awt/GraphicsDevice.java">src/share/personal/classes/common/java/awt/GraphicsDevice.java</A>.
 The various PP implementations have a GraphicsDevice class of
their own which extends this common GraphicsDevice class.  There is
also an awt directory which contains a peer_based directory. 
Underneath this is a directory (java/awt) containing files common to
all the peer-based PP implementations.  The specific peer-based
implementations are in the sun/awt/&lt;impl&gt; directories.  There,
you'll find qt, gtk, and pocketpc implementations.</P>]]>

</content>
</entry>
<entry>
<title>phoneME Advanced Directory Structure Explained</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/darryl_m/archive/2006/11/phoneme_advance.html" />
<modified>2006-11-28T17:41:02Z</modified>
<issued>2006-11-28T02:42:17Z</issued>
<id>tag:weblogs.java.net,2006:/blog/darryl_m/368.6041</id>
<created>2006-11-28T02:42:17Z</created>
<summary type="text/plain">In this entry, I&apos;ll explain how the phoneME Advanced directory structure is layed out.</summary>
<author>
<name>darryl_m</name>

<email>Darryl.Mocek@Sun.COM</email>
</author>
<dc:subject>Community: Mobile &amp; Embedded</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/darryl_m/">
<![CDATA[In this blog entry, I'll be talking
about the directory layout of the phoneME Advanced project.  You can
follow along by browsing the source code <A HREF="https://phoneme.dev.java.net/source/browse/phoneme">here</A>
while you're reading this blog.  You'll have to join the project to
do this.<BR>
<BR>
The start of the phoneME Advanced code
is located <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk">components/cdc/trunk</A>
directory.  Underneath the trunk directory are these directories:<BR>
<BR>
<UL>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/build">build</A>
	&ndash; contains the make files.  This is where you want to go to
	build.<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src">src</A>
	&ndash; contains the source files<BR>

	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/test">test</A>
	&ndash; contains the test files<BR>
</UL>
<BR>
This is obvious enough.<BR>
<BR>
Once you're at the src directory,
you're at the root of the source code for all platforms.  You'll
notice a listing of several hardware and os/hardware combination
directories here as well as a share directory, which I'll talk about
later.  These directories contain code specific to the os/hardware
(except the share directory).  Code in these directories are
minimized and are mainly native (non-Java) code. The majority of it
is cvm code.<BR>
<BR>
Underneath the share directory is the
bulk of the phoneME Advanced code.  
<BR>
<BR>
<UL>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/appmanager">appmanager</A>
	&ndash; contains the code for the application manager<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/basis">basis</A>
	&ndash; contains the code for the Personal Basis Profile<BR>

	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/cdc">cdc</A>
	&ndash; contains demo code for the Connected Device Configuration<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/classes">classes</A>
	- contains the code for the Connected Device Configuration<<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/foundation">foundation</A>
	&ndash; contains the code for the Foundation Profile<BR>

	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/javavm">javavm</A>
	&ndash; contains the code for the cvm<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/lib">lib</A>
	&ndash; contains Java security files<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/native">native</A>

	&ndash; contains shared native code<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/personal">personal</A>
	&ndash; contains the code for the Personal Profile<BR>
	<LI><A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/tools">tools</A>
	&ndash; contains tools<BR>

</UL>
<BR>
Each of these directories can be put
into categories: basis, foundation, personal, and the src directory
in which we're &ldquo;in&rdquo;, typically have a classes directory
and a native directory.  The classes directory contains all of the
Java code and the native directory contains supporting native code
for the Java classes.  The native directories contain JNI code and
code which interfaces with other native libraries, like Qt.<BR>
<BR>
<A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/appmanager">appmanager</A>
is an all-Java component and contains no native code.  <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/cdc">cdc</A>
contains only a demo file and <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/lib">lib</A>

contains two text files relating to Java security, a policy and
security file.  <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src/share/tools">tools</A>
contains both native and Java files, but the directory structure
underneath it is slightly different.  For now, I'll focus on the
profile code.<BR>
<BR>
Underneath the classes directory is,
for the most part, the root of the Java packages.  So here's where
you'll find the java/lang directory.<BR>
<BR>
The CDC profiles build upon each other.
 So the Personal Basis Profile includes Foundation Profile and the
Personal Profile includes the Personal Basis Profile.  For the most
part, the Foundation Profile code is in the foundation directory, the
Personal Basis Profile code is in the basis directory and so forth. 
There are some cases where you'll find the same file in different
profiles.  For example, you'll find Toolkit.java in basis:
basis/classes/common/java/awt/Toolkit.java and in personal:
personal/classes/common/java/awt/Toolkit.java.  This is to account
for the differences in the various profiles.<BR>
<BR>
Underneath the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/build">build</A>

directory, you'll find directories similar to the <A HREF="https://phoneme.dev.java.net/source/browse/phoneme/components/cdc/trunk/src">src</A>
directory, a share directory, which contains makefiles which are
shared across all platforms, and directories specific to each
os/hardware platform.  Again, the os/hardware-specific makefiles are
minimized.<BR>]]>

</content>
</entry>
<entry>
<title>Java Is Now Open Source</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/darryl_m/archive/2006/11/java_is_now_ope.html" />
<modified>2006-11-17T17:55:38Z</modified>
<issued>2006-11-17T17:48:06Z</issued>
<id>tag:weblogs.java.net,2006:/blog/darryl_m/368.5979</id>
<created>2006-11-17T17:48:06Z</created>
<summary type="text/plain">Java is now open source, brief introduction, where to get code.</summary>
<author>
<name>darryl_m</name>

<email>Darryl.Mocek@Sun.COM</email>
</author>
<dc:subject>Community: Mobile &amp; Embedded</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/darryl_m/">
<![CDATA[No doubt you've heard the news by now (Actually, this news is old by now.  This blog was supposed to go out the same day we announced the open sourcing of Java, but, as you can expect, things have been really busy around here and there's been a backlog getting Sun employees setup on java.net...so here's my "Java's Open Source" blog entry anyway), Java has been open sourced under the GPL v2 license.  Not just Java SE, but Java ME and Java EE as well.<BR>
<BR>
I work on the Java ME code, particularly CDC stack, the Connected Device Configuration.  This is the stack which is designed to run on set-top boxes, PDA's, smart phones, and the like.<BR>
<BR>
If you're interested in looking at the code, you can find it by going to http://mobileandembedded.org (This redirects you to the Mobile & Embedded community on java.net.  You'll need to register with java.net first.), selecting 'phoneME' under the Projects section on the left side of the screen, and either downloading the code by selecting 'Download' on the right side of the screen and downloading the 'phoneme_advanced-mr1-rel-src-b06-10_nov_2006.zip' file, or browse the code online by selecting the 'Browse' link on the right side of the screen, and traversing to components, cdc, trunk.  This is the root of the CDC code.<BR>
<BR>
Have fun checking out the code.
]]>

</content>
</entry>

</feed>