<?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-5125797420998499820</id><updated>2011-11-24T02:57:33.275-03:00</updated><category term='midp 1.0'/><category term='applications'/><category term='adaptive'/><category term='commands'/><category term='custom ui'/><category term='build'/><category term='news'/><category term='small'/><title type='text'>Small and Adaptive</title><subtitle type='html'>Tips and good practices on how to create Small and Adaptive Java ME applications.
All knowledge posted here comes from my &lt;a href="http://smallandadaptive.blogspot.com/search/label/applications"&gt;free applications&lt;/a&gt;.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>63</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8698154946700973523</id><published>2011-07-19T11:40:00.001-03:00</published><updated>2011-07-19T11:42:25.381-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Don't use RecordComparator</title><summary type='text'>Even if you try to keep the number of classes to a minimum you must create some classes to represent your entities. More so if you use these entities on IO operations: save on recordStore; send on httpRequest; etc.This tip is for those who do not use/know Floggy and create methods to [de]serialize these entity classes from/to byte arrays:Do not use RecordComparatorWhy? Because this interface </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8698154946700973523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8698154946700973523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8698154946700973523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8698154946700973523'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2011/07/dont-use-recordcomparator.html' title='Don&apos;t use RecordComparator'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-6840076560420396926</id><published>2011-04-28T21:00:00.002-03:00</published><updated>2011-04-28T21:01:12.982-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>keyReleased not called</title><summary type='text'>Do not take for granted that a call to keyPress will have a keyReleased counterpart.Yes, Java ME VMs may not call it and the simple tip here is to not rely on keyReleased at all.One exception, however, is when you have a very closed set of target devices and can do manual tests on all of them.Do I need to say to NOT trust an emulator execution?Even in this situation, when would you use </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/6840076560420396926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=6840076560420396926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6840076560420396926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6840076560420396926'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2011/04/keyreleased-not-called.html' title='keyReleased not called'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8050044547929712664</id><published>2011-04-27T21:56:00.001-03:00</published><updated>2011-04-27T21:58:57.508-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>hasPointerEvents wrong return</title><summary type='text'>Touch enabled handsets are more and more common these days. Some does not even have a keyboard!Custom User Interfaces should adapt to touch screens and, at least, display with bigger selectable items.One easy way to know if your MIDlet is running on a touch enabled handset is to call Canvas.hasPointerEvents.Unfortunately some Java ME Virtual Machines do not return true even if the handset DOES </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8050044547929712664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8050044547929712664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8050044547929712664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8050044547929712664'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2011/04/haspointerevents-wrong-return.html' title='hasPointerEvents wrong return'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-36116900987135021</id><published>2011-04-17T19:00:00.000-03:00</published><updated>2011-04-17T19:08:10.176-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>sizeChanged not called</title><summary type='text'>To achieve the Single Jar theory we must deal with handsets fragmentation upfront.One special piece of these fragments is the orientation change.Screen orientations are: portrait (height &gt; width) and landscape (width &gt; height).When the change happens the Java Virtual Machine should notify the running MIDlet with a call to sizeChanged method on the currently displayed Canvas.Unfortunately this is </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/36116900987135021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=36116900987135021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/36116900987135021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/36116900987135021'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2011/04/sizechanged-not-called.html' title='sizeChanged not called'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-2934093389966163961</id><published>2010-12-10T18:00:00.004-03:00</published><updated>2010-12-10T18:04:32.498-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Touch Menu</title><summary type='text'>Cros-posted at Technè - Blog de Tecnologia do C.E.S.A.R.Continuing with the details on how to develop touch enabled Java ME applications, today we will see a way of using such screens as input: if the user touchs an area it will trigger an action, like a menu.This menu will also adapt to screen orientation.First lets create a class to represent a menu entry. It knows how to paint the entry and </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/2934093389966163961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=2934093389966163961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2934093389966163961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2934093389966163961'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/12/touch-menu.html' title='Touch Menu'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n2h0YU2KhbM/TQKVqDUgIxI/AAAAAAAAAOg/Qj4sgCLt4NY/s72-c/Touch%2BMenu%2Bem%2BJava%2BME%2B-%2Bfigura%2B1.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5038967051342460822</id><published>2010-12-09T09:25:00.002-03:00</published><updated>2010-12-09T09:32:33.766-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Touch Screen support</title><summary type='text'>Cros-posted at Technè - Blog de Tecnologia do C.E.S.A.R.More and more cell phones have touch screens. And when we hear about them the first thing that we think are the most expensive smartphones. Big screens and amazing computer power.But there are also feature phones with such screens. And amongst them there is a lot supporting Java ME. So, how do you enable an application to get the user's "</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5038967051342460822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5038967051342460822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5038967051342460822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5038967051342460822'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/12/touch-screen-support.html' title='Touch Screen support'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3788426752464516127</id><published>2010-12-07T16:22:00.003-03:00</published><updated>2010-12-07T16:29:06.626-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Bar Chart</title><summary type='text'>Cros-posted at Technè - Blog de Tecnologia do C.E.S.A.R.When developing a mobile application one must consider screen size fragmentation. If Apple have only two screen sizes for iPhone until now, this is the exception. All other manufacturers vary the screen sizes a lot.To make developers life easier each technology provides widgets and ways to combine them. But there are times when you need an </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3788426752464516127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3788426752464516127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3788426752464516127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3788426752464516127'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/12/bar-chart.html' title='Bar Chart'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n2h0YU2KhbM/TP6KsxvTTvI/AAAAAAAAAOQ/TxVsgzKJK0E/s72-c/Grafico%2Bde%2BBarras%2Bem%2BJava%2BME%2B-%2Bfigura%2B1.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3712856478312858291</id><published>2010-11-13T07:27:00.009-03:00</published><updated>2010-11-13T07:42:42.824-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>XML Data Binding</title><summary type='text'>Cross-posted (in Portuguese) at Technè - Blog de Tecnologia do C.E.S.A.R.It is an easy task to load XML data as Java Objects if you are using SE or EE versions. You can use, for example, JAXB or Castor. Is it possible to do it as easily on Java ME? Yes, let me show you how.The first restriction we have to face is the reduced number of reflection features available on CLDC. It is not possible to </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3712856478312858291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3712856478312858291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3712856478312858291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3712856478312858291'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/11/xml-data-binding.html' title='XML Data Binding'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n2h0YU2KhbM/TN5oXKg6qiI/AAAAAAAAANY/KZxHxh1V5Rk/s72-c/XML-databinding-em-Java-ME-figura-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3700908239993718573</id><published>2010-11-09T21:19:00.003-03:00</published><updated>2010-11-09T21:27:20.935-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Check for updates</title><summary type='text'>Cross-posted (in Portuguese) at Technè - Blog de Tecnologia do C.E.S.A.R.Nowadays it is very common to have a "Check for updates" feature on mobile apps. Specially if they are Android or iPhone apps, because their platform already provide this. And what about Java ME apps? Here is a way.First we need an official site and a public file in it. For example, http://mysite.com/myapp.txt. This file </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3700908239993718573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3700908239993718573' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3700908239993718573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3700908239993718573'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/11/check-for-updates.html' title='Check for updates'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4611607912821679757</id><published>2010-11-07T08:11:00.001-03:00</published><updated>2010-11-07T08:13:58.086-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Adding Crash Report</title><summary type='text'>Cross-posted (in Portuguese) at Technè - Blog de Tecnologia do C.E.S.A.R.Using only Twitter API for Java ME it is possible to add Crash Report to a Java ME application.Crash Report is a set of information with details of an issue that made an application stop working.Operating Systems like Microsoft Windows, Mac OS and Linux distros have this feature.We browsers like Mozilla Firefox and Google </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4611607912821679757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4611607912821679757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4611607912821679757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4611607912821679757'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/11/adding-crash-report.html' title='Adding Crash Report'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-6139964484319811382</id><published>2010-10-22T16:40:00.001-03:00</published><updated>2010-10-22T16:42:42.980-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Twitter API for Java ME</title><summary type='text'>Check out my first post accepted at Technè - Blog de Tecnologia do C.E.S.A.R.http://techne.cesar.org.br/twitter-api-para-java-me/ (Portuguese)</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/6139964484319811382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=6139964484319811382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6139964484319811382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6139964484319811382'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/10/twitter-api-for-java-me.html' title='Twitter API for Java ME'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5008653224090414916</id><published>2010-09-25T14:13:00.004-03:00</published><updated>2010-09-25T14:20:35.690-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Nine Slice Scalling</title><summary type='text'>Below is the public contract (constructor and methods) of my NineSliceImage component. It may be used to draw Buttons, Title bars and Frames.import javax.microedition.lcdui.Graphics;import javax.microedition.lcdui.Image;public class NineSliceImage {  public NineSliceImage (Image img, int vMargin, int hMargin) { ... }  public void paintFrameAround (Graphics g, int x, int y, int width, int height) </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5008653224090414916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5008653224090414916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5008653224090414916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5008653224090414916'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/09/nine-slice-scalling.html' title='Nine Slice Scalling'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_n2h0YU2KhbM/TJ4uUD_jwpI/AAAAAAAAANI/swdDBWVxiPI/s72-c/pattern.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3955062560725478075</id><published>2010-08-22T21:28:00.003-03:00</published><updated>2010-08-22T21:32:51.994-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Manipulate PNG palette</title><summary type='text'>I am not a graphic designer, thus I don't know how to create fancy icons/images for my apps and Microsoft Paint is just enough for my skills.For all my apps I've used black-and-white PNG files without transparency and that is ok, but... black and white?! I should be adding colors.Image class does not have a method to easily change colors. A workaround could be to call getRGB method and iterate </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3955062560725478075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3955062560725478075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3955062560725478075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3955062560725478075'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/08/manipulate-png-palette.html' title='Manipulate PNG palette'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-165948918581943734</id><published>2010-07-11T18:11:00.001-03:00</published><updated>2010-07-11T18:14:55.745-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Blog audience 2T10</title><summary type='text'>From 2010 March, 15 to June, 14 this blog had 215 visits from 54 countries.The top 10 countries are:Brazil: 34Indonesia: 25India: 15United States: 11Italy: 7Russia: 7Germany: 6Portugual: 6Poland: 4Romania, United Kingdom, Sweden and Canada has left the top 10 list. New to the list are Italy, Russia and Poland.Related topics:Blog audience 1T10Blog audienceKnow your audience</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/165948918581943734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=165948918581943734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/165948918581943734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/165948918581943734'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/07/blog-audience-2t10.html' title='Blog audience 2T10'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-6140949134494498552</id><published>2010-07-10T18:49:00.000-03:00</published><updated>2010-07-10T18:52:35.619-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Alert setTimeout FOREVER</title><summary type='text'>So you are showing error messages, but no emails are coming in. Is your application faultless? Or all users do not bother to write down some lines and click send?Maybe your users do not have a chance to see the error message because it was automatically dismissed before they could read it. How can it happen? - you ask.Not calling setTimeout method on an Alert object will leave the timeout as the </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/6140949134494498552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=6140949134494498552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6140949134494498552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6140949134494498552'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/07/alert-settimeout-forever.html' title='Alert setTimeout FOREVER'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7546822847819348815</id><published>2010-05-31T22:10:00.000-03:00</published><updated>2010-05-31T22:13:52.088-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Books: version 1.4</title><summary type='text'>Yesterday I shared Books version 1.4, new features are listed below on Related Topics.I also updated my blog entry on Books.Related Topics:Using pointerDragged methodAdapting to sizeChangedAvoiding OutOfMemoryError</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7546822847819348815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7546822847819348815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7546822847819348815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7546822847819348815'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/05/books-version-14.html' title='Books: version 1.4'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3714715825693436982</id><published>2010-04-24T16:48:00.000-03:00</published><updated>2010-04-24T16:50:07.361-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Avoiding OutOfMemoryError</title><summary type='text'>Some Java ME applications load all their resources from its own jar file, but other apps load resources dinamically, for example, from a network connection.My Books application can open text files using an Open File Dialog I have created. But what happens if a file is too big to open?If the Java Virtual Machine raises an Exception current version (1.3) will show an error message requesting the </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3714715825693436982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3714715825693436982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3714715825693436982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3714715825693436982'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/04/avoiding-outofmemoryerror.html' title='Avoiding OutOfMemoryError'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7561994160535561427</id><published>2010-04-17T08:47:00.000-03:00</published><updated>2010-04-17T08:50:14.312-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Using pointerDragged method</title><summary type='text'>Some cell phones do not have a keyboard. They only have a touch screen. In this case, if you have a Canvas screen on your application you will have to rely only on pointer methods.This fact came to me because a user of my Books application have such a phone and sent me an email informing that he could not go back to a previous page.I checked the application source code and found out the reason. </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7561994160535561427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7561994160535561427' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7561994160535561427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7561994160535561427'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/04/using-pointerdragged-method.html' title='Using pointerDragged method'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5394160760835329326</id><published>2010-03-15T12:22:00.001-03:00</published><updated>2010-03-15T12:27:16.805-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Blog audience 1T10</title><summary type='text'>Since 2009 December, 15 this blog had 241 visits from 59 countries.The top 10 countries are:Brazil: 37India: 22United States: 18Indonesia: 12Romania: 8Germany: 8United Kingdom: 6Sweden: 6Portugual: 5Canada: 5Poland, Turkey and Russia has left the top 10 list. New to the list are Indonesia, Romania and Canada.Related topics:Blog audienceKnow your audience</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5394160760835329326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5394160760835329326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5394160760835329326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5394160760835329326'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/03/blog-audience-1t10.html' title='Blog audience 1T10'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_n2h0YU2KhbM/S55ROJsrDeI/AAAAAAAAAMs/D4QRXuqnCL0/s72-c/mapoverlay-20100315.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-2808181344731403243</id><published>2010-03-13T22:23:00.000-03:00</published><updated>2010-03-13T22:24:50.133-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Adapting to sizeChanged</title><summary type='text'>Cell phones with accelerometers may automatically change the screen orientation from portrait to landscape.If you use LCDUI screens on your application there is nothing to worry.But if you use Canvas these changes are notified by sizeChanged method.At my Books application I show text in fullscreen landscape.The user will need to rotate the handset to read properly.If the cell phone automatically </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/2808181344731403243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=2808181344731403243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2808181344731403243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2808181344731403243'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2010/03/adapting-to-sizechanged.html' title='Adapting to sizeChanged'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4940025507190006291</id><published>2009-12-17T06:58:00.002-03:00</published><updated>2009-12-17T07:12:00.886-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Single Jar theory</title><summary type='text'>This month there was a Sun Tech Days event at São Paulo, Brazil.I could not be there, but I am thankful they shared the slides.The only presentation about Java ME was JavaME: Building Cool Interfaces with the Lightweight UI Toolkit (PDF document). I think there are also other cool things on Java ME, but the event is a lot smaller than Java ONE and there was more interesting stuff on Java Standard</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4940025507190006291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4940025507190006291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4940025507190006291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4940025507190006291'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/single-jar-theory.html' title='Single Jar theory'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4154994836804020595</id><published>2009-12-15T06:40:00.004-03:00</published><updated>2009-12-15T07:10:08.856-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Blog audience</title><summary type='text'>Since 26 April 2009 I am following this blog statistics with Google Analytics and it had 566 visiting users (855 pageviews).There are days days when I do not have a single visit, but it usually goes from two to six a day.The most interesting part of the statistics for me is the Map Overlay, where we can see from which part of the wordl the visits came from.Below is the world map with all 54 </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4154994836804020595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4154994836804020595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4154994836804020595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4154994836804020595'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/blog-audience.html' title='Blog audience'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n2h0YU2KhbM/Sydfj_PINFI/AAAAAAAAAMg/uUiSGtncvXU/s72-c/mapoverlay-20091215.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7372869782099112993</id><published>2009-12-14T06:50:00.000-03:00</published><updated>2009-12-14T06:51:11.442-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Books 1.3</title><summary type='text'>Last week I have posted all changes I made for Books version 1.3, they are listed below on Related Topics.I also updated my blog entry on Books.But the first place I notified the world about this version was on this tweet update.Related Topics:Reading UTF-8 streamsShowing error messagesFull Screen RepaintColor DistanceSquare Root Rounding</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7372869782099112993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7372869782099112993' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7372869782099112993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7372869782099112993'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/books-13.html' title='Books 1.3'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-455950192931256193</id><published>2009-12-11T06:21:00.002-03:00</published><updated>2009-12-11T06:24:10.420-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Reading UTF-8 streams</title><summary type='text'>If you have a byte array with Unicode characters encoded with UTF-8 you can create a String from it with the following constructors:String(byte[] bytes, int off, int len, String enc) String(byte[] bytes, String enc)This is useful when reading from local files. But what can you use if you are reading an UTF-8 stream?You can use class java.io.InputStreamReader with the following constructor:</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/455950192931256193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=455950192931256193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/455950192931256193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/455950192931256193'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/reading-utf-8-streams.html' title='Reading UTF-8 streams'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4210355147380731716</id><published>2009-12-10T06:44:00.001-03:00</published><updated>2009-12-10T07:00:40.276-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Showing error messages</title><summary type='text'>Exceptions are a powerful feature of Java. Applications may recover from expected error situations and present meaningful messages to the user.But when you catch an unexpected exception? What should you present to the user?I propose to show a generic error message prefix requesting user feedback like:"There was an unexpected situation, please send an email to a@b.c with the following details: "</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4210355147380731716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4210355147380731716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4210355147380731716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4210355147380731716'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/showing-error-messages.html' title='Showing error messages'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-6685761570283405519</id><published>2009-12-09T06:07:00.001-03:00</published><updated>2009-12-09T06:15:33.321-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Full Screen Repaint</title><summary type='text'>If for any reason you have to override getWidth or getHeight methods in a class that extends Canvas, the calls to repaint() might not update the whole display.And this is an expected behaviour. Check below documentation from API:public final void repaint()Requests a repaint for the entire Canvas. The effect is identical torepaint(0, 0, getWidth(), getHeight());If you want to always update the </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/6685761570283405519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=6685761570283405519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6685761570283405519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/6685761570283405519'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/full-screen-repaint.html' title='Full Screen Repaint'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-2479715823883126714</id><published>2009-12-08T09:03:00.000-03:00</published><updated>2009-12-08T09:05:04.278-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Color Distance</title><summary type='text'>We can represent a color in Java ME using integer literals. The four bytes represent different aspects of the color:Transparency: also known as Alpha channel. Indicates if the color should we drawn as solid or translucidRed: the red componentGreen: the green componentBlue: the blue componentIn a previous post I pointed how to get the handset theme color dinamically with Display.getColor. But I </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/2479715823883126714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=2479715823883126714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2479715823883126714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2479715823883126714'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/color-distance.html' title='Color Distance'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8257381707577243999</id><published>2009-12-07T14:02:00.001-03:00</published><updated>2009-12-07T14:11:25.142-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Square Root Rounding</title><summary type='text'>Since CLDC 1.1 Java ME applications can use floating point operations like sin, cos, tan, sqrt, etc. All these methods are available at java.lang.Math class.Some applications needs square root floating point precision and will have to use double variables. Other applications need only an approximation and this is what I present here.Lets first take a look at how I create my square pyramid. To </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8257381707577243999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8257381707577243999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8257381707577243999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8257381707577243999'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/12/square-root-rounding.html' title='Square Root Rounding'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5609014453119627371</id><published>2009-10-25T06:56:00.002-03:00</published><updated>2009-10-25T06:59:37.351-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Books version 1.2</title><summary type='text'>This week I shared version 1.2 of Books, so I updated the blog entry listing all features and related JSRs.</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5609014453119627371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5609014453119627371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5609014453119627371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5609014453119627371'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/10/books-version-12.html' title='Books version 1.2'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3164417499956270778</id><published>2009-10-12T07:46:00.005-03:00</published><updated>2009-10-13T22:50:05.239-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='small'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Alphabet: my third study case</title><summary type='text'>With this application you can help your children learn the alphabet. Three letters at a time. When the child correctly presses the key for each letter three other letters are presented. There is a counter to stimulate the child to achieve higher scores. You can change letter colors based on the handset theme, but the application also have predefined colors.The application is available for downloa</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3164417499956270778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3164417499956270778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3164417499956270778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3164417499956270778'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/10/alphabet-my-third-study-case.html' title='Alphabet: my third study case'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7494426832767328130</id><published>2009-09-16T07:08:00.002-03:00</published><updated>2009-09-16T07:14:16.962-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Adding a simple progress bar</title><summary type='text'>A progress bar is a visual representation of a Real Number between zero and one or a percentage between 0% and 100%.Below is a method for drawing a simple progress bar:/** * @param g Graphics * @param x * @param y * @param w width * @param h height * @param p part between zero and total * @param t total */void fillProgressBar (Graphics g, int x, int y, int w, int h, int p, int t) {  g.drawRect(x,</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7494426832767328130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7494426832767328130' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7494426832767328130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7494426832767328130'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/09/adding-simple-progress-bar.html' title='Adding a simple progress bar'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-440103252941374302</id><published>2009-09-09T07:02:00.004-03:00</published><updated>2009-09-09T17:10:49.364-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Application Sindication</title><summary type='text'>It has been only a week since I shared Books and it got more than one thousand downloads. Of course I am happy with this number, but I was wondering how did these people find out about it? Of course this blog does not have so many readers. I write to a very specific nich.So I did some search and navigation on GetJar and found out RSS Feeds for application updates. They are organized by platforms </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/440103252941374302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=440103252941374302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/440103252941374302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/440103252941374302'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/09/appliation-sindication.html' title='Application Sindication'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8257321524353893191</id><published>2009-09-02T21:15:00.006-03:00</published><updated>2010-05-31T22:10:27.915-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='small'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Books: a new study case</title><summary type='text'>Updated on 31/May/2010. New features on version 1.4I had some TXT books and wanted to read them on my cell phone. So I made this application and shared it. Features:Fullscreen landscape reading with biggest font available.Recent files list, so you do not need to browse for files every time you open the application.Resume reading from the same line you were (with progress bar since version 1.1) - </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8257321524353893191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8257321524353893191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8257321524353893191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8257321524353893191'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/09/books-new-study-case.html' title='Books: a new study case'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4281618059501921770</id><published>2009-08-23T22:29:00.000-03:00</published><updated>2009-08-23T23:56:28.160-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Fullscreen Landscape</title><summary type='text'>Most handset screens are portrait: higher than wider. What if you want to show content in landscape mode? Since MIDP 2.0 we can use an Sprite to rotate an image in 90 degrees.First thing we need is an Image of the correct size. Following code could be inside the constructor of a class that extends Canvas - considering an Sprite and an Image attributes:int width = Math.max(super.getWidth(), </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4281618059501921770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4281618059501921770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4281618059501921770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4281618059501921770'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/08/fullscreen-landscape.html' title='Fullscreen Landscape'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5339504439261776727</id><published>2009-08-17T22:46:00.004-03:00</published><updated>2010-07-10T19:10:52.804-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Open File Dialog</title><summary type='text'>Ok, this is not a Dialog... It is an Implicit List. As we do not have File Dialogs on LCDUI I decided to share my version with you. It did work with Sony Ericson and Motorola iDEN handsets and I use it in my Books application.import java.io.IOException;import java.util.Enumeration;import java.util.Stack;import javax.microedition.io.Connector;import javax.microedition.io.file.FileConnection;import</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5339504439261776727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5339504439261776727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5339504439261776727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5339504439261776727'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/08/open-file-dialog.html' title='Open File Dialog'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4644635679700293081</id><published>2009-07-06T17:30:00.003-03:00</published><updated>2009-07-07T15:34:00.274-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='midp 1.0'/><title type='text'>Know your audience</title><summary type='text'>Which handsets are actually downloading your Java ME application? How many users report that your applications runs fine with their handsets? The answers are available to GetJar developers at Download Stats - Compatibility report, but I had a problem with it...Since 2009 May, 14 my chess board has two versions available, one for MIDP 1.0 handsets and another for MIDP 2.0. From this day onwards I </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4644635679700293081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4644635679700293081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4644635679700293081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4644635679700293081'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/07/know-your-audience.html' title='Know your audience'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-1174082678040262257</id><published>2009-06-30T06:56:00.003-03:00</published><updated>2009-06-30T12:06:25.565-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Adding a scrollbar</title><summary type='text'>Sometimes you have more data to show than available space. One way to make this clear to the user is presenting a scroll bar.Lets update our custom alert to paint a scroll bar when necessary.Below is the source code of my simple scroll bar component:import javax.microedition.lcdui.Graphics;public class Scrollbar {  private int x, y, width, height;  private int total; // how much you have to </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/1174082678040262257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=1174082678040262257' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1174082678040262257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1174082678040262257'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/06/adding-scrollbar.html' title='Adding a scrollbar'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-628547285423202245</id><published>2009-06-20T09:16:00.001-03:00</published><updated>2009-06-20T09:26:53.486-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Key Repetition with TimerTask</title><summary type='text'>It is not friendly to force your user to repeat key presses. My CustomImplicitList had this fault. If you wanted to move the selection using up/down keys or 2/8 numbers you had to press the key once for every change. To avoid this I made a simple change, adding the following method:protected void keyRepeated(int keyCode) {  this.keyPressed(keyCode);}Now the user can press and hold a key to keep </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/628547285423202245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=628547285423202245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/628547285423202245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/628547285423202245'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/06/key-repetition-with-timertask.html' title='Key Repetition with TimerTask'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5154171676403475361</id><published>2009-06-14T12:41:00.001-03:00</published><updated>2009-06-14T12:50:10.116-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='midp 1.0'/><title type='text'>MIDP 1.0 long tail</title><summary type='text'>I don't know of any new handset that comes with a MIDP 1.0 Java Virtual Machine. New handsets comes with MIDP 2.0 or 2.1 and will come, eventually, with 3.0.But I know there is a market for these old handsets and began following the daily downloads of my Chess board. Below is an updated graphic of these downloads:We can see a trend with a smaller number of downloads for each week. Some day this </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5154171676403475361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5154171676403475361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5154171676403475361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5154171676403475361'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/06/midp-10-long-tail.html' title='MIDP 1.0 long tail'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n2h0YU2KhbM/SjUbOKv3IgI/AAAAAAAAAMA/gpAzfMXZ2yI/s72-c/dailydownloads-20090614.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4940115514160026363</id><published>2009-05-26T22:26:00.000-03:00</published><updated>2009-05-26T22:28:29.567-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Bordered text</title><summary type='text'>How about adding a fancy bordered text to your customized UI? Simple, draw the text with the border color four times around the anchor point with just one pixel difference. Then draw the text with the desired color at the anchor point. Did not get it? How about the source code below?public void drawBorderedText(Graphics g, String text,  int x, int y, int anchor, int textColor, int borderColor){  </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4940115514160026363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4940115514160026363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4940115514160026363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4940115514160026363'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/05/bordered-text.html' title='Bordered text'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7261685954345995036</id><published>2009-05-25T23:06:00.004-03:00</published><updated>2009-05-26T00:26:14.366-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>My News view</title><summary type='text'>I share what I consider interesting news at this site. If you want to easily follow them please use this RSS feed. These are the same news available at this blog, section "Also read...".</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7261685954345995036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7261685954345995036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7261685954345995036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7261685954345995036'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/05/my-news-view.html' title='My News view'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8757536464462401117</id><published>2009-05-16T15:09:00.002-03:00</published><updated>2009-05-16T15:24:39.284-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Development branches</title><summary type='text'>How can I evolve two different versions of the same application? Using the same source code? For example, if one version uses MIDP 2.0 but the other uses MIDP 1.0? The answer is preprocessing.Since October/2003 I use Antenna: an Ant plugin that allows a developer to easily build, preverify and package a Java ME application, but it also has a pre-processor built in. To use it you need to add </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8757536464462401117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8757536464462401117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8757536464462401117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8757536464462401117'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/05/development-branches.html' title='Development branches'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4103074673335313460</id><published>2009-04-30T18:07:00.003-03:00</published><updated>2009-06-14T12:50:31.149-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='midp 1.0'/><title type='text'>MIDP 1.0 still matters</title><summary type='text'>Is it worth to keep a MIDP 1.0 version of your product? I found out that the answer is yes and will share the reasons.The latest verstion of my chess board - 1.7 - requires MIDP 2.0 and minimum screen resolution of 128x96. The previous version - 1.6 - required the same minimum screen resolution, but MIDP 1.0 instead.I could delete 1.6 and focus only on newer handsets, but got curious about how </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4103074673335313460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4103074673335313460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4103074673335313460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4103074673335313460'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/04/midp-10-still-matters.html' title='MIDP 1.0 still matters'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_n2h0YU2KhbM/SfoURpD3kdI/AAAAAAAAAL4/dsZyMubCKhQ/s72-c/chess+-+downloads.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-706431215790447489</id><published>2009-04-19T07:55:00.003-03:00</published><updated>2009-04-19T08:06:07.747-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Adding colors</title><summary type='text'>Since MIDP 2.0 it is possible to discover some colors defined by the handset user.There is a new method Display.getColor(int), the parameter may be one of six public constants from class Display: COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, COLOR_HIGHLIGHTED_BACKGROUND, COLOR_HIGHLIGHTED_FOREGROUND, COLOR_HIGHLIGHTED_BORDER. The return is a valid color to be used with Graphics.setColor(int).</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/706431215790447489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=706431215790447489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/706431215790447489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/706431215790447489'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/04/adding-colors.html' title='Adding colors'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-1429877307145593651</id><published>2009-03-26T22:42:00.001-03:00</published><updated>2009-05-26T22:30:39.957-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><category scheme='http://www.blogger.com/atom/ns#' term='commands'/><title type='text'>Painting custom commands</title><summary type='text'>Commands should be the last elements drawn on the screen. This way the user will always know his options for that screen.We are using the height of commands area as the default font height, so we need to override getHeight method:private boolean hasCommands () {   return (this.leftCommand != null) || (this.rightCommand != null);}public int getHeight () {   int height = super.getHeight();      if </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/1429877307145593651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=1429877307145593651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1429877307145593651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1429877307145593651'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/03/painting-custom-commands.html' title='Painting custom commands'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3265863175743627665</id><published>2009-03-01T12:31:00.005-03:00</published><updated>2010-07-10T19:38:06.249-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><category scheme='http://www.blogger.com/atom/ns#' term='commands'/><title type='text'>Custom commands</title><summary type='text'>We presented ways to customize title and content with Canvas, but now it is time to also treat commands.For our code lets define the following attributes:private int leftCommandKey, rightCommandKey;A good example of adaptive code to identify command keys can be found at LWUIT class com.sun.lwuit.Implementation, method setKnownSoftKeyCodes.Below is an adapted snippet to treat Nokia and Motorola </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3265863175743627665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3265863175743627665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3265863175743627665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3265863175743627665'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2009/03/custom-commands.html' title='Custom commands'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5675756450890787633</id><published>2008-12-15T22:32:00.001-03:00</published><updated>2009-05-26T22:30:39.957-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Custom Monospaced Font</title><summary type='text'>If you want to use custom fonts the easiest one to start with is Monospaced.As each character has the same width a simple math can define the correct point to draw.Lets start with just numbers, from zero (Unicode value 48) to nine (Unicode value of 57).Below is a PNG image of a very small font with three pixels width and five pixels height.The following class can be used to draw numbers using </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5675756450890787633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5675756450890787633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5675756450890787633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5675756450890787633'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/12/custom-monospaced-font.html' title='Custom Monospaced Font'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_n2h0YU2KhbM/SUeSLn42VdI/AAAAAAAAAK0/gYuYa4YxiAo/s72-c/monospaced_3_5.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3811399034350060770</id><published>2008-12-10T23:25:00.004-03:00</published><updated>2009-09-02T21:14:07.872-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='small'/><category scheme='http://www.blogger.com/atom/ns#' term='applications'/><title type='text'>Chess: A study case</title><summary type='text'>Since June/2007 I have been studying how to develop small and adaptive Java ME applications. My study case is a simple chess board and is available for free at GetJar.Current version has help text, good usability, unselect feature and support for touch screen devices. But still does not support check mate.I have just uploaded a new version. A single 15k jar file that supports resolutions from </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3811399034350060770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3811399034350060770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3811399034350060770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3811399034350060770'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/12/study-case.html' title='Chess: A study case'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-5829394800112295681</id><published>2008-12-03T22:19:00.000-03:00</published><updated>2008-12-03T23:20:45.749-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Internationalization (or just I18N - count the letters between I and N)</title><summary type='text'>When developing adaptive Java ME applications one thing to take into account is the language used.There is a System.property where you can read the current language selected on the handset.String locale = System.getProperty("microedition.locale");The first two letters identify the language while the last two letters identify the country. For example, "en-US" represents English on United States of</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/5829394800112295681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=5829394800112295681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5829394800112295681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/5829394800112295681'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/12/internationalization-or-just-i18n-count.html' title='Internationalization (or just I18N - count the letters between I and N)'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3998408831874685553</id><published>2008-11-24T22:12:00.003-03:00</published><updated>2008-11-24T22:23:33.263-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Adding touch support</title><summary type='text'>No List implementation is complete without support for touch screen.Since MIDP 1.0 Canvas has support for touch screen devices with pointer methods.To make things easier we add an int attribute to hold the top pixel from where items are painted.Every time an item is added or removed this attribute is changed.Below are the changes on the code from previous post:public class CustomImplicitList </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3998408831874685553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3998408831874685553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3998408831874685553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3998408831874685553'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/11/adding-touch-support.html' title='Adding touch support'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-236877014814931385</id><published>2008-11-16T22:34:00.003-03:00</published><updated>2009-05-26T22:30:05.264-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>Custom Implicit List</title><summary type='text'>If you have a few items to choose from, you may not need an LCDUI List instance. Below is a class that implements some methods of List, but have a custom drawing as it extends Canvas.The main differences is that append method does not receive an Image parameter and the constructor receives only title as parameter.On the next post we will add support for touch screen devices.Attention: MIP 2.0 </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/236877014814931385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=236877014814931385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/236877014814931385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/236877014814931385'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/11/custom-implicit-list.html' title='Custom Implicit List'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-577313862552352285</id><published>2008-11-02T17:24:00.002-03:00</published><updated>2008-11-02T17:31:39.330-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Remove debug messages</title><summary type='text'>While developing an application it is common place to first use emulators. This environment gives access to stepping and watching variable values. Very useful, high development speed.Then you need to run the application on actual devices. Some manufacturers implement On Device Debugging so, the same environment is available even when the MIDlet is running on an actual device.For those that do not</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/577313862552352285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=577313862552352285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/577313862552352285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/577313862552352285'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/11/remove-debug-messages.html' title='Remove debug messages'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8799471531645610301</id><published>2008-10-24T22:14:00.004-03:00</published><updated>2008-10-24T22:23:58.664-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Vertically centered text</title><summary type='text'>Images can be easily drawn at the center of the screen because Graphics.drawImage supports both anchors: HCENTER and VCENTER. To drawString we can use only HCENTER. If VCENTER is passed as argument an IllegalArgumentException is raised.So how do we draw vertically centered text?The maximum number of lines that fits the screen is obtained with a division:int maxLinesPerScreen = getHeight() / </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8799471531645610301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8799471531645610301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8799471531645610301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8799471531645610301'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/images-can-be-easily-drawn-at-center-of.html' title='Vertically centered text'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-7898855947572706547</id><published>2008-10-19T21:41:00.000-03:00</published><updated>2008-10-19T21:41:34.243-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Work with proportions</title><summary type='text'>Lets say you have some data to present, for example, the amount of money per month you spend with food. How do we create an application that shows this data as columns?First thing is to know how much space the application has to use. This can be achieved with a Canvas child class calling the methods getWidth() and getHeight().The number of columns displayed at a time depends on the screen width </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/7898855947572706547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=7898855947572706547' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7898855947572706547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/7898855947572706547'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/work-with-proportions.html' title='Work with proportions'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n2h0YU2KhbM/SPvMV87ojZI/AAAAAAAAAIw/2yt49rUAmcg/s72-c/bars+177x177.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-1376556337555182398</id><published>2008-10-17T22:02:00.001-03:00</published><updated>2008-10-18T00:28:00.110-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>The smallest MIDlet</title><summary type='text'>A Java ME application must have at least on class that extends MIDlet. If the application has custom interface there must be at least one class that extends Canvas. In this case, how short can be the MIDlet?import javax.microedition.lcdui.Display;import javax.microedition.midlet.MIDlet;public class C extends MIDlet {  MyCanvas cCanvas;  public C() {    this.cCanvas = new MyCanvas(this);  }  </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/1376556337555182398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=1376556337555182398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1376556337555182398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1376556337555182398'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/smallest-midlet.html' title='The smallest MIDlet'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8626835453171371928</id><published>2008-10-13T23:06:00.005-03:00</published><updated>2009-05-26T22:32:45.387-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><category scheme='http://www.blogger.com/atom/ns#' term='custom ui'/><title type='text'>A better Alert</title><summary type='text'>Alert is a good screen for short messages like: "Settings saved", "Restored default values", "Network error", etc. A TextBox can only be used for user input. If you want to show a help text, with multiple lines, there is another way. On a previous post I showed a way to use Font.stringWidth, now we will see one more.Assume you have the following attributes:String [] message;int </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8626835453171371928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8626835453171371928' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8626835453171371928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8626835453171371928'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/better-alert.html' title='A better Alert'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-4845295372129525490</id><published>2008-10-08T21:46:00.002-03:00</published><updated>2008-10-08T22:04:03.059-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Fewer classes</title><summary type='text'>Each class definition creates a corresponding class file, even nested classes. The fewer classes you have the smaller your jar file will be. A Java ME application may have only one class, the MIDlet, and this single class can implement CommandListener and be responsible for all application GUI.If you are developing a game or an application with custom user interface, you will need another class </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/4845295372129525490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=4845295372129525490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4845295372129525490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/4845295372129525490'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/fewer-classes.html' title='Fewer classes'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-1629922350353418283</id><published>2008-10-07T18:45:00.002-03:00</published><updated>2008-10-07T19:04:51.838-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Centered text</title><summary type='text'>When you want to draw some centered text, lets say, "Press any key" on your Splash, you can usevoid paint (javax.microedition.lcdui.Graphics g) {  g.drawString("Press any key", getWidth() / 2, getHeight(), Graphics.HCENTER | Graphics.BOTTOM);}But what if the default font is so small you can not read easily. Or worse, your text width is bigger than the screen width? To be sure you can use </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/1629922350353418283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=1629922350353418283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1629922350353418283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/1629922350353418283'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/centered-text.html' title='Centered text'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-2407941337163196377</id><published>2008-10-05T18:36:00.003-03:00</published><updated>2008-10-05T19:33:44.361-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Optimize your images</title><summary type='text'>Java ME applications may use images in the PNG (Portable Network Graphics) format, version 1.0, but at least the critical chunks must be present. As ancillary chuncks are not necessary you may use a tool to remove them.One such tool is PNGGauntlet. It is strongly recommended that you use it, as you may up to 60% compression of an image file.</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/2407941337163196377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=2407941337163196377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2407941337163196377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2407941337163196377'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/optimize-your-images.html' title='Optimize your images'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8534958657101747214</id><published>2008-10-02T22:45:00.002-03:00</published><updated>2008-10-02T22:49:30.679-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Showing a Splash</title><summary type='text'>When customizing the User Interface with Canvas you can obtain the screen resolution with getWidth and getHight methods. Lets say you want to show a Splash screen to the user and have an image with your logo. How would you use it?Well, a single image will not fit all screens. But two will do.The smaller logo image should be less than 96x54, as this is the smallest screen resolution. This image </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8534958657101747214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8534958657101747214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8534958657101747214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8534958657101747214'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/showing-splash.html' title='Showing a Splash'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-2454416968187324443</id><published>2008-10-01T22:51:00.003-03:00</published><updated>2009-05-16T15:18:09.412-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='build'/><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Obfuscate your classes</title><summary type='text'>An obfuscator can shrink and optimize your classes. Unused classes, fields, methods and attributes may be removed. The remaining code may be renamed to short meaningless names.I use Proguard as an Ant task since 2003 and have good results with it.Below are the settings I often use on my projects:usemixedcaseclassnames="off", if class names reach z the next name will be aa instead of </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/2454416968187324443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=2454416968187324443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2454416968187324443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/2454416968187324443'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/10/obfuscate-your-classes.html' title='Obfuscate your classes'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-8382820881167656938</id><published>2008-09-30T22:36:00.004-03:00</published><updated>2008-09-30T22:42:48.354-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adaptive'/><title type='text'>Use LCDUI</title><summary type='text'>There is a great number of different screen resolutions out there. Bellow you can see various sizes, from the oldest 96x54 to the new 240x320. And these are not all of them. A more complete list of handsets and their screen resolutions can be found at MIDP Benchmark.So how can a Java ME application behave properly on so many different handsets? Use the standard UI classes: LCDUI.Ok, LCDUI is not </summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/8382820881167656938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=8382820881167656938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8382820881167656938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/8382820881167656938'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/09/use-lcdui.html' title='Use LCDUI'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n2h0YU2KhbM/SOLUu2UtXtI/AAAAAAAAAIM/Vs16ebX30AM/s72-c/screen+resolutions.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5125797420998499820.post-3148812425453061437</id><published>2008-09-29T00:01:00.002-03:00</published><updated>2008-09-29T00:19:42.851-03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='small'/><title type='text'>Keep it flat</title><summary type='text'>Jar files are Zip files with another extension and a special (and optional) folder named META-INF. For each file or folder there is a header associated. As headers take some space of the jar you better keep less files in it, but if you already took it to the bare minimum then keep all those files in the root directory.For MIDlet distribution the jar file must have the META-INF folder so, for best</summary><link rel='replies' type='application/atom+xml' href='http://smallandadaptive.blogspot.com/feeds/3148812425453061437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5125797420998499820&amp;postID=3148812425453061437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3148812425453061437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5125797420998499820/posts/default/3148812425453061437'/><link rel='alternate' type='text/html' href='http://smallandadaptive.blogspot.com/2008/09/keep-it-flat.html' title='Keep it flat'/><author><name>Telmo Pimentel Mota</name><uri>http://www.blogger.com/profile/04051227500777659491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='26' src='http://2.bp.blogspot.com/_n2h0YU2KhbM/SPIscRykkLI/AAAAAAAAAIY/-xTqef_0w6g/S220/telmo+logo.PNG'/></author><thr:total>0</thr:total></entry></feed>
