The Source for Java Technology Collaboration
User: Password:



Tomas Brandalik's Blog

Community: Mobile & Embedded Archives


Java ME Platform SDK Early Access

Posted by tbrandalik on October 10, 2008 at 02:07 AM | Permalink | Comments (3)

Java ME Platform SDK Early Access has been released yesterday. Have a look at http://java.sun.com/javame/downloads/sdk30ea.jsp and don't forget to read what's new first, because a lot of cool features is waiting for you. My personal favorites are on-device features. One click on-device deployment and on-device debugging. Who wants to start immediately to discover them just go get and install Java cldc/midp runtime for Windows Mobile shipped with the product.
I'm really happy that ME developers can get an early access to play with it so soon. Let us know what you think, because ... it is still time until final release to add features and improve things. Your feedback is very valuable for us. Looking forward to your comments.

-Tomas

Skinning WTK on Linux

Posted by tbrandalik on February 15, 2007 at 03:00 AM | Permalink | Comments (9)

I'm working on Linux release for some time and I feel I need to have a fun little bit. I've googled for a look & feels which would work on linux and found a page http://www.javootoo.com/ with custom L&Fs and tried to plug some of them into wtk toolbar. Some are free, some commercial, some work only on windows ...

Start with jdk linux native look and feel. jdk 6 native L&F shows improvements comparing to jdk 5. But notice separators in the JToolBar, they aren't vertical.

jdk 5
jdk5.png


jdk 6
jdk6-1.png

Alternative look and feels
To plug-in L&F just edit ktoolbar script. Put L&F jar on classpath and set property -Dkvem.lookandfeel. An example for synthetica L&F:

-Dkvem.lookandfeel="de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel"

Napkin
napkinlaf.png

Synthetica Green and Dream
greendream-1.png

Tonic slim
toniclf_slim.png

Tiny YQForest
tinylaf-yqforest-1.png

L2FProd skins
You can try L2FProd skins if you edit ktoolbar starting script to look like this:

java -Dkvem.home="${KVEM_HOME} \
-Djava.library.path="${KVEM_HOME}/bin \
-cp $KVEM_LIB}/lf/skinlf.jar:${KVEM_LIB}/kenv.zip:${KVEM_LIB}/ktools.zip:${KVEM_BIN}/JadTool.jar:${KVEM_BIN}/MEKeyTool.jar:${KVEM_LIB}/customjmf.jar:${KVEM_API}/j2me-ws.jar:${KVEM_BIN}/schema2beansdev.jar:${KVEM_BIN}/j2me_sg_ri.jar:${KVEM_BIN}/jaxrpc-impl.jar:${KVEM_BIN}/jaxrpc-api.jar:${KVEM_BIN}/jaxrpc-spi.jar:${KVEM_BIN}/activation.jar:${KVEM_BIN}/mail.jar:${KVEM_BIN}/saaj-api.jar:${KVEM_BIN}/saaj-impl.jar:${KVEM_BIN}/xsdlib.jar \
Skinit -pack ${KVEM_LIB}/lf/themepack.zip com.sun.kvem.toolbar.Main "$@"

Evenif this is a linux script I believe you can edit also win32 ktoolbar.bat script acordingly. You just need skinlf.jar on the classpath and download apropriate themepack.zip. Here are some of them:


L2FProd cell shaded
l2fp-cellshaded.png

L2FProd Graphite
l2fp-graphite.png

L2FProd OpusOSDeep
l2fp-opusosdeep.png

L2FProd AAToxic
l2fp-toxic.png



Getting started with Mobile internationalization API. Part 1

Posted by tbrandalik on February 09, 2007 at 02:29 AM | Permalink | Comments (2)

Mobile Internationalization API (JSR 238) or shortly called MIA comes as a part of wireless toolkit version 2.5. This entry is a quick start for those who wants to get familiar with this new API. You may object that user won't find devices supporting JSR238 on the current market. Yes, that's true, but the time when MSA replaces current JTWI standard is coming and it's always good to be ready ;-) ...

Briefly JSR238 is a solution for internationalization and localization of MIDP applications. Who likes reading a theory has a chance to read more about both terms here. I personally like one sentence explanation which says that:

  • internationalization is a process of designing applications that way that it can be localized to various languages and regions."
  • localization is a process of translating software user interfaces from one language to another and adapting it to suit a foreign culture."


    Looking back at CLDC/MIDP it has already introduced essential support for internationalization. I'm sure you remember that:

  • Characters encoding is Unicode.
  • Locale identification (see RFC 3066) and microedition.locale property were defined.
  • Date, Calendar, TimeZone classes are available.
  • InputStreamReader and OutputStreamWriter allow reading/writing character streams.


    JSR238 goes further and addresses following problems:

  • Separating of resources from the application source code. All localizable resources are stored out of the source code. It helps to easier translate an application without need to recompile and lowers possibility to introduce error.
  • Formatting of dates, times, numbers, currencies and messages. These items are correctly formatted according to locale set by application.
  • String collation. Collation is correct for the locale set by application.

    Locale identification
    Locale is the only way how to tell jsr238 implementation classes to behave according to desired locale. Locale identifier follows pretty same rules like in javaSE and is built as 2 letters of language code followed by 2 letters of country code and optionally a language variant. As a separator both underscore "_" and dash "-" are allowed.
    en-US, cs-CZ, zh-CN, ja-JP ... 
    Interesting thing is that also empty string "" as a locale identifier is valid and signals that neutral formatting is required. I will talk about neutral formatting in next part of the guide ...


    Resource files
    To allow easy localization of application all localizable resources has to be stored into separate resource file. JSR 238 defines 2 categories of resources. device resources and application resources. The application resources are the resources bundled with the application, device resources are "burned into" the device. Application developer is responsible for creating and maintaining application resources, on the other hand device resources are read only.
    Resource files are hold in a structure of folders defined by the specification. If you have WTK 2.5 installed (and I hope you have ;-)), go into apps folder and look into i18nDemo a project which contains JSR238 sample MIDlet. Open MIDlet binary i18nDemo.jar and along with package folders containing classes there is also folder global with resources. Global is a root folder for all resource files. You will notice subfolders which naming follows locale identification schema. These folders then contain localized resource files. Look at following picture:
    basenames.png

    Resource file "common" appears there in 3 localized versions. Each is identified by the full path to the resource file.

    /global/common
    /global/en/common
    /global/en-US/common

    Resource inheritance principle was implemented here to save space. It means resource don't repeat in resource files. If a resource, we are looking for, isn't found in /global/en-US/common next resource file /global/en/common is queried and then as a last try common resource file /global/common is queried. You've probably noticed resource file stored directly under /global folder. It's good strategy to store resources which aren't intended to be translated into resource files right under /global folder. These are called common resources.
    Inspecting a structure of resource files and resource files itself just in file browser isn't very comfortable. We prepared small utility i18n Resource Manager which really simplifies the work with resources. Run WTK Toolbar and load i18nDemo project. I18n Resources Manger is right in project menu here:

    i18nmanager.png
    Another possibility to launch i18n Resource Manager is a script WTK_HOME/bin/i18ntool. Launch it with parameter <path to any resource global folder>
    i18ntool ../apps/i18nDemo/res


    In the next part we will look closer at resource files structure ...



    Wireless Toolkit 2.5 is Final!

    Posted by tbrandalik on February 05, 2007 at 07:38 AM | Permalink | Comments (8)

    Contributed by: Richard Gregor WTK engineering manager.

    After quite a long development, Sun Java Wireless Toolkit 2.5 for CLDC (oh man what's a long official name) is final, everybody can download it here:
    http://java.sun.com/products/sjwtoolkit/download-2_5.html .

    This is a really great release bringing the support for the Mobile Service Architecture (MSA). For those of you who are not aware, Mobile Service Architecture is a definition of a new Java platform for the mobile devices. It specifies what all APIs should be supported on the mobile phone that is MSA compliant. MSA is is a really rich platform that specifies essential client components of an end-to-end wireless environment. In comparison to its predecessor Java Technology for the Wireless Industry, MSA includes many more exciting APIs and I don't want to describe them all because it is long list and I need to do also something real for my living.

    Let's take a look at what's new and cool in the toolkit.

    toolkit.PNG

    Forget about Flash, now we have SVG!

    SVG is powerful language for describing two-dimensional vector and mixed vector/raster graphics in XML.

    SVG API implementation as specified in JSR 226 is included in the toolkit and contains also optional parts not demanded by specification. Toolkit comes with 2 SVG demos that should help you start with SVG programming.

    SVG Demo

    SVG Demo includes simple demos that you can use as a start point. You can browse and display your svg files located on device's filesystem, render simple svg picture, play svg animation, create svg picture from scratch, work with events and manipulate svg images - all basic stuff you can do with SVG API.


    * Location Based Service :

    svg2.PNG


    SVG Contact List Demo

    If you wanna see something more advanced in SVG, then please check this demo. You can also try to run it on Nokia S40 phones with SVG support -looks amazing and comes with 2 skins.

    * SVG Contact List:

    contact.PNG

    Payment or how to make money

    Payment API allows your MIDlet to initiate payment transaction in a secure manner. Nice example of monetization is a JBricks game included in toolkit. You can buy additional lives or advanced levels of the game and pay either with your credit card or by sending a Premium Priced SMS. Payment implementation comes with very nice support.

    * You can manage the price for a certain feature e.g. live or level in the update file (*.jpp). To change data in this file, toolkit includes Payment Update File Editor:

    payment-editor.PNG


    Utilities by the way were redesigned - should be seen on the picture, isn't it? You can choose when new prices are taking place. There is not only client side for Payment but also the Payment Server. Payment console allows you to see payment communication, you can track details of network communication in the Network Monitor. Of course preview of all transactions and their status is available as well. For Payment API details please check Payment API - JSR 229


    Good Morning, Buenos dias, Dobry den - Mobile Internationalization in Action

    With continuing globalization, the necessity for producing localized application is raising rapidly. Even though internationalization for !JavaSE and !JavaEE applications is well known process, with a lot of support from various tools, the situation in !JavaME/MIDP was not satisfactory for a long time, because there was no standard solution for solving internationalization issues. With the introduction of JSR 238 (Mobile Internationalization API), !JavaME application developers can leverage it to create truly internationalized applications.

    Basic ideas behind JSR 238 are here:

    * For multicultural/global applications
    * Allows developers to internationalize their MIDP applications
    * Central Concept – resource, data that is localized
    * String
    * Image
    * Object
    * Application - specific and Device - specific resources
    * Application Resources are bundled as part of MIDlets suite jar file
    * Includes support for cultural conventions


    Resources are in binary resource file, in format defined by JSR 238. Toolkit includes resource manager that makes it easy create and maintain different types of resources.

    i18n.PNG


    Session Initiation Protocol (SIP)

    There is few good reasons for this API to be included:

    * It is a standard way how applications can set up communication
    * Cost savings
    * Security

    SIP is used e.g. in Instant Messaging, Text and Voice Chat and Video Conferencing. Except API implementation, the Wireless toolkit includes demo SIP server (proxy and registrar). It is of course up to you, if you would rather use your real SIP server, no problem. Network Monitor has been extended so now you can track SIP communication too. There are 2 nice demos for SIP.

    * SIP Demo - for basic peer-to-peer communication
    * GoSIP Demo - advanced demo using Built-in SIP server for simple chat between 2 devices


    There is a lot more in new Sun java Wireless Toolkit 2.5. Don't wait, go and review it yourself!





    Powered by
    Movable Type 3.01D
  •  Feed java.net RSS Feeds