6. MARCO TEÓRICO
6.5. EL RECREO COMO ESPACIO DE CONVIVENCIA Y APRENDIZAJE
you can use HTML for the user interface. It is backward compatible with the highlevel LCDUI framework 2. LWUIT22: A Swing inspired UI framework
3. Mewt23: Uses XML to define the UI
16 www.jcp.org/en/jsr/detail?id=226 17 jcp.org/en/jsr/detail?id=287 18 www.developer.nokia.com/Resources/Library/Full_Touch/ 19 www.developer.nokia.com/Community/Wiki/Nokia_UI_API_1.1b 20 developer.samsung.com/java/technical-docs/Multi-Touch-in-Samsung-Devices 21 j2mepolish.org 22 lwuit.java.net/ 23 mewt.sourceforge.net
Java ME (J2ME) 78
Screen resolutions for Java ME range from 176x208/220 to 360x640, with the most popular being 240x320. Handling so many different resolutions can be a challenge, but using the above tools you can create UI layouts that scale automatically. Creating custom UIs for each resolution is possible, but not recommended: it is time consuming, error prone and expensive.
Graphical assets should always be optimized. A great free
tool for this is PNGGauntlet24.
Testing
Because of device fragmentation, testing applications is vital. Test as early and as often as you can on a mix of devices. Some emulators are quite good, but there are some things that have
to be tested on devices. Vendors like Nokia25 and Samsung26
provide subsidized or even free remote access to selected devices.
Automated Testing
There are various unit testing frameworks available for Java ME,
including J2MEUnit27, MoMEUnit28 and CLDC Unit29; Advanced
tools like JInjector30 provide code-coverage and UI testing
support. 24 pnggauntlet.com 25 forum.nokia.com/rda 26 developer.samsung.com 27 j2meunit.sourceforge.net 28 momeunit.sourceforge.net 29 snapshot.pyx4me.com/pyx4me-cldcunit 30 code.google.com/p/jinjector
Java ME (J2ME) 79
Porting
At its core, Java ME is a set of standards and specifications, which vendors sometimes interpret differently. This results in all kinds of bugs and non-standard behavior. In the follow- ing sections we outline different strategies for porting your applications to different Java ME handsets and platforms. Lowest Common Denominator
You can prevent many porting issues by limiting the functional- ity of your application to the lowest common denominator. This usually means CLDC 1.0 and MIDP 1.0, or CLDC 1.1 and MIDP 2.0 if you only plan to release your application in more developed countries / regions.
While this approach is good for simple applications, compre- hensive and feature-rich applications will be limited by it. In this case, you might want to consider using Java Technology for the Wireless Industry (JTWI, JSR 185) or the Mobile Service Architecture (MSA, JSR 248) as your baseline, but be aware that these have more limited support in the market.
Porting Frameworks
Porting frameworks help you deal with fragmentation by au- tomatically adapting your application to different devices and platforms. To achieve this, they provide specialized run-time client libraries and built-time tools (such as cross compilers) that work together to make the process almost seamless.
Good porting frameworks enable you to use platform and device specific code in your projects. In other words: a good framework does not hide device fragmentation, but makes it more manageable.
Java ME (J2ME) 80
Software31 (available under both the GPL Open Source license
and a commercial license). Porting from C++ to Java ME is also
possible with the open source MoSync SDK32.
For more information about cross-platform development and the available toolsets, please see the “Going Cross-Platform” chapter.
Signing
The Java standard for mobile devices differentiates between signed and unsigned applications. Some handset functionality is available to trusted applications only.
Applications signed by the manufacturer or carrier of a device enjoy the highest security level and can access every Java API available on the handset.
Applications signed by JavaVerified33, Verisign34 or Thawte35
are on a lower security level, while unsigned applications are on the lowest security level.
Which features are affected and what happens if the applica- tion is not signed is largely dependent on the implementation. Furthermore, not every phone carries all the necessary root certificates. The result is something of a mess, so consider signing your application only when required. In some cases an app store may offer to undertake the signing for you, as Nokia Store does.
Another option is to consider using a testing and certifica- tion service provider and leaving the complexity to them.
Intertek36 is probably the largest such supplier.
31 enough.de 32 mosync.com 33 javaverified.com 34 verisign.com 35 thawte.com 36 intertek.com/wireless-mobile
Java ME (J2ME) 81
Distribution
App stores are probably the most efficient way to distribute your apps. Some of the most effective stores include:
— Handmark37 and Mobile Rated38 provide carrier and vendor
independent application stores.
— GetJar39 is one of the oldest distributors for free mobile
applications – not only Java applications.
— Nokia Store40 targets Nokia users worldwide and provides
a revenue share to the developer at 70% from credit card billing and 60% from operator billing
— Carriers are in the game also, such as Orange41 and O242.
An overview of the available app stores (not those sell- ing J2ME apps alone) can be found in the WIP App Store
Catalogue43. Also see the separate chapter on Appstores in this
guide to learn more.
Learn More
If you want to learn more about Java ME development, below are a few resources that might help you.
Online
As Java ME is one of the oldest mobile platforms still used, it is easy to find resources related to it. For example:
37 store.handmark.com 38 mobilerated.com 39 getjar.com 40 publish.ovi.com 41 www.orangepartner.com/distribute 42 mobileapps.o2online.de 43 wipconnector.com/appstores/
Java ME (J2ME) 82
— Tutorials from sites such as J2ME Salsa44.
— Resource archives from sites such as billday.com/javame
— Interesting projects via the blog at
opensource.ngphone.com or on the Mobile and Embedded
page of java.net45, for example the Bluetooth project
Marge46.
Books
Over the years, a number of good Java ME books have been written, for example:
— Beginning J2ME: From Novice to Professional by Jonathan Knudsen and Sing Li
— Pro Java Me Apps: Building Commercial Quality Java ME Apps by Ovidiu Iliescu
— Pro J2ME Polish: Open Source Wireless Java Tools Suite by Robert Virkus, dealing with J2ME Polish development. — LWUIT 1.1 for Java ME Developers by Biswajit Sarkar,
dealing with LWUIT development
Unfortunately, due to Java ME's decreasing popularity, very few Java ME books have been written in recent years.
44 j2mesalsa.com
45 community.java.net/mobileandembedded/ 46 marge.java.net/
Tizen 84
Tizen
The Ecosystem
Tizen is an open source, Linux based operating system designed to run on smartphones, netbooks, In-Vehicle-Infotainment (IVI) systems and other smart devices. It can be viewed as a successor to Nokia/Intel's Meego and Samsung's LiMo; earlier smartphone operating systems based on Linux. Samsung also merged the remains of their abandoned bada OS into Tizen, providing a framework for native apps. Tizen, as a brand of the Linux Foundation, was first announced by the Tizen Association in December 2011 and version 1.0 (codename 'Larkspur') was released in April 2012. Since then, the system has been under continuous development, with Tizen 3.0 due for releases later in 2014. The main drivers of Tizen are Samsung for the mobile branch and Intel for the IVI focus. Examples of other contribut- ing companies are Fujitsu, NTT Docomo, Huawei, Vodafone and Orange.
The first Tizen smartphones are expected to be released during 2014; at the time of writing Samsung only has a number of digital camera models running Tizen.
Development
The main focus of Tizen is to enable a standards-based operat- ing system for running apps written in HTML5. However, Tizen enables you to write native apps in C++ as well, giving you the power to max out the capabilities of the hardware. Both devel- opment paths are supported by a variety of popular frameworks and libraries, such as JQuery, to give you a good start with your
BY M ar co Büttn er & P atri ck M ortar a
Tizen 85
first Tizen app. If you have written native bada apps before, you can migrate them quite easily. Very few code-changes should be needed to make baba apps run on Tizen, there even is a migration tool available to make this process easier.
Web app developers can use a comprehensive list of HTML5 features, Tizen device APIs and libraries — such as JQuery and JQuery Mobile — to create beautiful apps. If you have created web apps for bada, you can use the most of the original code on Tizen. As with native apps, very few code changes should be needed.
The official Tizen SDK contains an Eclipse-based IDE, which can be used for both web and native app development. Former bada developers will probably recognize the roots of this SDK: Samsung's bada SDK. A code editor, UI designer, device emula- tor ... it is all in there, ready to go. For web-based applications you can also use Intel XDK, if you prefer.