<?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-6964266462542162002</id><updated>2012-01-19T01:22:13.004-08:00</updated><category term='android programming'/><category term='games'/><category term='ADC'/><category term='android'/><category term='mobile world congress'/><category term='sound'/><category term='monolithandroid'/><category term='sdk'/><title type='text'>A Computer Programming Blog</title><subtitle type='html'>&lt;strong&gt;Tasos Kleisas shares his programming experiences with the world&lt;/strong&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-7947878098107822598</id><published>2009-11-18T10:43:00.000-08:00</published><updated>2009-11-18T11:15:01.397-08:00</updated><title type='text'>Can N900 and Maemo save nokia?</title><content type='html'>I absolutely love android, don't get me wrong but strong competition is a good thing. And android's only solid competition seems to be the one coming from Apple. Even though Nokia practically owns over one third of the mobile phone market, it is way behind technologically in the prestigious smartphone sector. Symbian series 60, is considered old and boooooring... Maemo is still wearing diapers (it is in my opinion, more immature than android was when it launched one year ago). So what steps can be taken by Nokia to improve the situation? Here's my short list:&lt;br /&gt;&lt;br /&gt;1. Abandon Symbian series 60 models in favor of Maemo.&lt;br /&gt;2. Keep its series 40 line for dirt cheap mobile phones.&lt;br /&gt;3. Develop a series 60 emulator that can run series 60 apps on Maemo phones.&lt;br /&gt;4. Radically improve Maemo development tools. Let me elaborate on this. Compared to android and iPhone developer tools, Symbian series 60 tools have been really difficult to use. An entirely different sdk should be downloaded in order to support specific features found in specific models. And the SDK's were practically running only on Windows (and very specific versions of windows that is). Now, the new Maemo SDK is linux only, and it requires a lot of setup steps compared to android. So Nokia developers should make a move from windows to linux and from symbian to maemo. Whoa, that seems like a lot of work!&lt;br /&gt;On the other hand the android SDK runs on windows, linux and MacosX, is simple to setup (at least compared to symbian and Maemo) and the emulator and the IDE are really simple to use and quite fast. In only one year android has 10,000+ apps and a lot of them are very good. Of course Nokia is starting to make some moves on the right direction. One of those moves is QT Creator, a very good cross - platform IDE, that can create QT apps that can be compiled for mobile platforms like Maemo, in good, old, speedy C++. But until Nokia bundles a simple to use QT Creator and Maemo  SDK combo, I don't see developers fleeing their way.&lt;br /&gt;However, N900, the first Maemo smartphone device, looks cool and packs a lot of power. But as we all know, the apps count, so Nokia should help developers write some cooool apps or it may be heading palm's way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-7947878098107822598?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/7947878098107822598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=7947878098107822598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7947878098107822598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7947878098107822598'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/11/can-n900-and-maemo-save-nokia.html' title='Can N900 and Maemo save nokia?'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-5620862803048546023</id><published>2009-05-22T08:37:00.000-07:00</published><updated>2009-05-22T11:06:37.925-07:00</updated><title type='text'>Robotic Space Rock 1.0.10 for android 1.5 (cupcake)</title><content type='html'>Since the release of the android 1.5 SDK, I wanted to update the code of RSR to use the 1.5 SDK. It seems that as far as openGL/ES is concerned, programming is greatly simplified by the introduction of the class GLSurfaceView and the Renderer interface. It only took me a couple of hours to change the code to use the new programming interface. However I spent several days trying to find out why my application misbehaved when it was paused and then brought back to life. However I was able to track the problem down using the setDebugFlags(DEBUG_CHECK_GL_ERROR);&lt;div&gt;It had to do with incorrect rendering of a square (used for the moon/earth) surface. I also replaced the mediaPlayer class I was using to play back an mp3 with the JetPlayer class, which can be used to play back midi files that are a lot smaller compared to mp3's and they can use little cpu power. Now a midi file is used for playback, and the application size has reduced considerably to well under 1 Megabyte. However I did not find the time to write a proper midi song, so all you gonna hear is a repetitive ditty that is probably gonna drive you crazy...&lt;/div&gt;&lt;div&gt;Overall I think that the game is now a lot more responsive and fast but I only tested it on the emulator, so your feedback is welcome. Go to &lt;a href="http://code.google.com/p/monolithandroid/downloads/list"&gt;http://code.google.com/p/monolithandroid/downloads/list&lt;/a&gt; , download roboticspacerock1.0.10beta.apk and keep those bug reports coming...&lt;/div&gt;&lt;div&gt;The 1.0.9 version did not work, probably due to the &lt;span class="Apple-style-span" style="font-family: Verdana; font-weight: bold; "&gt;&lt;code&gt;getHolder().setType(android.view.SurfaceHolder.&lt;/code&gt;&lt;code&gt;SURFACE_TYPE_GPU&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;bug. In order for the game to work in real phones it seems that you still have to use the previous line.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-5620862803048546023?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/5620862803048546023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=5620862803048546023' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5620862803048546023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5620862803048546023'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/05/robotic-space-rock-109-for-android-15.html' title='Robotic Space Rock 1.0.10 for android 1.5 (cupcake)'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1710699979978386747</id><published>2009-05-01T02:58:00.000-07:00</published><updated>2009-05-01T03:15:22.227-07:00</updated><title type='text'>New! Improved! The 1.5 android SDK is here.</title><content type='html'>The android 1.5 SDK (based on the notorious cupcake code branch) is here and it is what the first release of the SDK should have been. Support for sound recording and playback through buffer manipulation (using the AudioTrack class) is something that game developers want. And easier OpenGL programming is now easier, too. However there are still spotty places. It seems that the new SDK broke a lot of programs, especially games. And the apk size limitation of 16 MB still holds. My application RSR kinda works but when you try to exit it, it freezes. So I will have to adapt it to the new SDK release. I will rewrite the openGL parts using the new classes and see what happens. Maybe I will try to use AudioTrack class, too...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1710699979978386747?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1710699979978386747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1710699979978386747' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1710699979978386747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1710699979978386747'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/05/new-improved-15-android-sdk-is-here.html' title='New! Improved! The 1.5 android SDK is here.'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-5737674379782594830</id><published>2009-04-04T01:14:00.000-07:00</published><updated>2009-04-04T06:10:56.922-07:00</updated><title type='text'>Robotic Space Rock and other games fell victims of the DMCA</title><content type='html'>Today, I received a notification from google stating:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;This is a notification that the application, Robotic Space Rock with package ID org.teacake.monolith.apk has been removed from Android Market due to a violation of the Developer Content Policy. Please review the Content Policies and Business and Program Policies before you create or upload additional applications. Note that repeated violations may result in a suspension of your Android Market Publisher account.&lt;br /&gt;&lt;br /&gt;For more information, or to contact us, please reply to this email, or visit the Android Market Help Center.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;The Android Market Team&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now my application looks like this in the developer console:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Qfga8utotf4/SdcX2xg-y7I/AAAAAAAAAO0/RJPYFJMbMso/s1600-h/DMCA.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 48px;" src="http://3.bp.blogspot.com/_Qfga8utotf4/SdcX2xg-y7I/AAAAAAAAAO0/RJPYFJMbMso/s400/DMCA.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5320747714533575602" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Additionaly they forwarded me a four page fax they received from Norris, McNaughlin &amp;amp;&lt;br /&gt;Marcus P.A. who represent the Tetris Company.&lt;br /&gt;&lt;br /&gt;Here's the fax:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Qfga8utotf4/SdcanAjkm1I/AAAAAAAAAO8/NngjG5b_RTU/s1600-h/gview01.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 313px; height: 400px;" src="http://2.bp.blogspot.com/_Qfga8utotf4/SdcanAjkm1I/AAAAAAAAAO8/NngjG5b_RTU/s400/gview01.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5320750742227950418" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Qfga8utotf4/SdcanNwoTvI/AAAAAAAAAPE/M_Zog6THhPA/s1600-h/gview02.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 313px; height: 400px;" src="http://2.bp.blogspot.com/_Qfga8utotf4/SdcanNwoTvI/AAAAAAAAAPE/M_Zog6THhPA/s400/gview02.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5320750745772379890" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Qfga8utotf4/SdcanoTc5rI/AAAAAAAAAPM/8I0GsknpoAo/s1600-h/gview03.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 314px; height: 400px;" src="http://4.bp.blogspot.com/_Qfga8utotf4/SdcanoTc5rI/AAAAAAAAAPM/8I0GsknpoAo/s400/gview03.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5320750752897754802" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Qfga8utotf4/Sdcan2oE19I/AAAAAAAAAPU/Ug3e8XGEO-s/s1600-h/gview04.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 312px; height: 400px;" src="http://1.bp.blogspot.com/_Qfga8utotf4/Sdcan2oE19I/AAAAAAAAAPU/Ug3e8XGEO-s/s400/gview04.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5320750756742354898" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see there are six applications listed for infringement:&lt;br /&gt;Blocks, Cubik, Net Tetris, Netblocks, Robotics Space Rock, Tetroid&lt;br /&gt;&lt;br /&gt;Actually, my application is called "Robotic Space Rock", not Robotics Space Rock. However I do not use the tetris name anywhere in my application, and I do not copy or reuse tetris related art or sound. The game mechanics are also quite different. And the application is free.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The question is, what should I do? I am not an american citizen nor do I live in the U.S. What's your take on this?&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-5737674379782594830?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/5737674379782594830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=5737674379782594830' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5737674379782594830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5737674379782594830'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/04/robotic-space-rock-and-other-games-fell.html' title='Robotic Space Rock and other games fell victims of the DMCA'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Qfga8utotf4/SdcX2xg-y7I/AAAAAAAAAO0/RJPYFJMbMso/s72-c/DMCA.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-8272732183514232194</id><published>2009-02-26T08:37:00.000-08:00</published><updated>2009-02-26T09:22:04.091-08:00</updated><title type='text'>Some lessons learned from the android market</title><content type='html'>Sometime in December, I released a game I wrote, Robotic Space Rock (RSR for short) in the android market. This lead to a small stream of emails from angry users, claiming that the app I published was not working. I unpublished RSR and started scratching my head and trying to figure out what went wrong. My first mistake was that I only tested RSR on the emulator, because at the time I had no access to a T-Mobile G1. As a matter of fact, I still don't because, Android Developer Phone (ADP) is not yet available in Greece where I live, and Google has not given a timeframe for the release of ADP in my region. So I  searched the internet in order to find out why my users got a blank screen. A few days later, I found the problem, and corrected it. I asked for volunteers to test the corrected application before I resubmit it to the android market. Of course, my app was already buried (under 2 stars rating), so when I resubmitted, most guys were reluctant to try it out. Despite this, I continued to release updates. After a few days, I got an email from google. They asked me to rename it. Initially it was called MonolithAndroid but it seems that you are not allowed to have the term android in your application title, because it violates android market policies. So I had to rename to RSR and re-release. As days passed by, I got everything from 1 to 5 stars, and users saying that they hate or love RSR and everything in between. Some claimed that the background music slowed the game down, and others that RSR kept force closing. One of the worst things about the android market is that you cannot see the user comments of the users in the developer console, as someone would expect. This void was filled by the excellent cyrket web site by saurik. When the paid apps were introduced about a week ago, a flood of apps appeared and my app was further pushed down in the popularity rank. A few days ago, some apps with screenshots became visible through the android market website, but they were only the top rated apps. No chance for RSR appearing on the android market website, it seems...&lt;br /&gt;So what are my conclusions for now:&lt;br /&gt;1. Never, ever release an app, unless you thoroughly test it on a real device. If you don't get it passably right the first time, your app will be buried.&lt;br /&gt;2. The phone memory limit is a severe limitation. My application has some original music. I wanted to add a couple of songs or more but I do not want to, because that would make it bigger and big apps, especially games are not going to stay on the phone for long. So keep your app small (under 1 MB) in order to maximize the chance of your application staying on the phone. Google should permit program installation on the SD card, increase the APK size limit and maybe increase the amount of internal storage to 1 GB or more.&lt;br /&gt;3. Games are not that popular on the G1. It seems that geeks don't like gaming so much, or the games currently available are not so hot. So focus on applications, especially if you want to make some $$$. &lt;br /&gt;4. Sound support for android is not good yet. If you use SoundPool, you increase the chance of your application hanging, making the user unhappy. I think that sound problems should be corrected immediately, because that affects all kinds of applications and especially games.&lt;br /&gt;In my next blog entry I will try to compare android to iphone and symbian developer tools and market publishing. Stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-8272732183514232194?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/8272732183514232194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=8272732183514232194' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8272732183514232194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8272732183514232194'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/02/some-lessons-learned-from-android.html' title='Some lessons learned from the android market'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-3175030295584000622</id><published>2009-02-07T02:09:00.000-08:00</published><updated>2009-02-07T02:15:20.109-08:00</updated><title type='text'>Robotic Space Rock 1.0.8 beta released!</title><content type='html'>I just released Robotic Space Rock 1.0.8 beta on the android market. Here's the changelog:&lt;br /&gt;1. Added easy mode. Now the screen spins in Normal and Expert Difficulty. The screen does not move in Easy Difficulty.&lt;br /&gt;2. Changed texture size to 32x32 from 64x64 in order to improve performance.&lt;br /&gt;3. Changed the way explosions are drawn.&lt;br /&gt;4. Added a game over sound effect.&lt;br /&gt;5. Changed the way that playfield rotation is calculated by introducing a new LinearInterpolator class.&lt;br /&gt;As always your remarks, bug reports and suggestions are welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-3175030295584000622?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/3175030295584000622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=3175030295584000622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3175030295584000622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3175030295584000622'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/02/robotic-space-rock-108-beta-released.html' title='Robotic Space Rock 1.0.8 beta released!'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-7064391649181168810</id><published>2009-02-05T13:31:00.000-08:00</published><updated>2009-02-05T14:12:07.321-08:00</updated><title type='text'>A class for playing music and sound effects revisited</title><content type='html'>A while back, I published a class that could be used for playing music and sound effects. That class used the android.media.MediaPlayer class and was developed against a pre 1.0 android SDK version. The media player object is good for playing music, but it is not suitable for playing short sound effects. It is a heavyweight object and a bit unstable, too. But a new class called SoundPool (found in android.media package again) is available. This class is good for playing sound effects, but currently does not support .ogg or .mp3 files. Since I wanted my game to have both music and sound, I decided to design a class called SoundPoolManager which utilises both MediaPlayer and SoundPool objects. SoundPool objects are used to play sound effects and MediaPlayer objects are used to play back looping music.&lt;div&gt;SoundPoolManager creates a new thread and uses a LinkedList to queue sound events. So when you want to play a sound, you create a SoundPoolEvent and push it to the sound event queue. The SoundPoolManager thread picks up the queued events and plays them back for you. Time to show you some code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;This is the Sound interface used to abstract soundplaying functions.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package org.teacake.monolith.apk;&lt;br /&gt;public interface Sound {&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;public void addSound(int resid, boolean isLooping);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void startSound();&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void stopSound();&lt;br /&gt;&amp;nbsp;public void stopSound(int resid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void playSound(int resid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void startMusic(int resid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void stopMusic(int resid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void pauseMusic(int resid);&lt;br /&gt;&amp;nbsp;&amp;nbsp;public void resumeMusic(int resid);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And now for the main dish, SoundPoolManager class&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package org.teacake.monolith.apk;&lt;br /&gt;import android.media.SoundPool;&lt;br /&gt;import android.util.Log;&lt;br /&gt;class SoundPoolEvent&lt;br /&gt;{&lt;br /&gt; public SoundPoolEvent(int eventType,int eventSound)&lt;br /&gt; {&lt;br /&gt;  this.eventType = eventType;&lt;br /&gt;  this.eventSound = eventSound;&lt;br /&gt; }&lt;br /&gt; public int eventType;&lt;br /&gt; public int eventSound;&lt;br /&gt; &lt;br /&gt; public static final int SOUND_PLAY=0;&lt;br /&gt; public static final int SOUND_STOP=1;&lt;br /&gt; public static final int SOUND_MUSIC_PLAY=2;&lt;br /&gt; public static final int SOUND_MUSIC_PAUSE=3;&lt;br /&gt; public static final int SOUND_MUSIC_STOP=4;&lt;br /&gt; public static final int SOUND_MUSIC_RESUME=5;&lt;br /&gt;}&lt;br /&gt;class SoundStatus&lt;br /&gt;{&lt;br /&gt; public SoundStatus()&lt;br /&gt; {&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; public static final int STATUS_LOOPING_NOT_STARTED=0;&lt;br /&gt; public static final int STATUS_LOOPING_PAUSED=1;&lt;br /&gt; public static final int STATUS_LOOPING_PLAYING=2;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;public class SoundPoolManager extends Thread implements Sound&lt;br /&gt;{&lt;br /&gt; SoundPoolManager(android.content.Context context)&lt;br /&gt; {&lt;br /&gt;  this.context = context;&lt;br /&gt;  soundEvents = new java.util.LinkedList&lt;SoundPoolEvent&gt;();&lt;br /&gt;  sounds = new java.util.HashMap&lt;Integer, Boolean&gt;();&lt;br /&gt;  handles = new java.util.HashMap&lt;Integer, Integer&gt;();&lt;br /&gt;  mediaPlayers = new java.util.HashMap&lt;Integer, android.media.MediaPlayer&gt;();&lt;br /&gt;  isRunning = false;&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; public void addSound(int resid, boolean isLooping)&lt;br /&gt; {&lt;br /&gt;  &lt;br /&gt;  sounds.put(resid, new Boolean(isLooping));&lt;br /&gt;  if(isLooping)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    android.media.MediaPlayer mp = android.media.MediaPlayer.create(context, resid);&lt;br /&gt;    mp.setLooping(true);&lt;br /&gt;    mp.seekTo(0);&lt;br /&gt;    //mp.prepare();&lt;br /&gt;    mediaPlayers.put(resid, mp);&lt;br /&gt;    &lt;br /&gt;   &lt;br /&gt;    //mp.seekTo(0);&lt;br /&gt;    //mp.setAudioStreamType(android.media.AudioManager.STREAM_MUSIC);&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    Log.d("ERROR",e.getMessage());&lt;br /&gt;   }&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void run()&lt;br /&gt; {&lt;br /&gt;  android.media.MediaPlayer mp = null;&lt;br /&gt;  while(isRunning)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    while(soundEvents.size()&gt;0)&lt;br /&gt;    {&lt;br /&gt;     SoundPoolEvent event = soundEvents.remove();&lt;br /&gt;     if(event!=null)&lt;br /&gt;     {&lt;br /&gt;      switch(event.eventType)&lt;br /&gt;      {&lt;br /&gt;      case SoundPoolEvent.SOUND_PLAY:&lt;br /&gt;       android.media.AudioManager mgr = (android.media.AudioManager) context.getSystemService(android.content.Context.AUDIO_SERVICE); &lt;br /&gt;       int streamVolume = mgr.getStreamVolume(android.media.AudioManager.STREAM_MUSIC); &lt;br /&gt;       soundPool.play(handles.get( event.eventSound).intValue(), streamVolume, streamVolume, 1, 0, 1.0f);&lt;br /&gt;&lt;br /&gt;       break;&lt;br /&gt;      case SoundPoolEvent.SOUND_STOP:&lt;br /&gt;&lt;br /&gt;       break;&lt;br /&gt;      case SoundPoolEvent.SOUND_MUSIC_PLAY:&lt;br /&gt;       currentPlayer = event.eventSound;&lt;br /&gt;       if(sounds.get(currentPlayer)!=null)&lt;br /&gt;       {&lt;br /&gt;        mp = mediaPlayers.get(currentPlayer);&lt;br /&gt;        &lt;br /&gt;        if(!mp.isPlaying())&lt;br /&gt;        {&lt;br /&gt;         mp.seekTo(0);&lt;br /&gt;         mp.start();&lt;br /&gt;        }&lt;br /&gt;       }&lt;br /&gt;       &lt;br /&gt;       break;&lt;br /&gt;      case SoundPoolEvent.SOUND_MUSIC_STOP:&lt;br /&gt;       currentPlayer = event.eventSound;&lt;br /&gt;       mp = mediaPlayers.get(currentPlayer);&lt;br /&gt;       mp.pause();       &lt;br /&gt;       break;&lt;br /&gt;      case SoundPoolEvent.SOUND_MUSIC_PAUSE:&lt;br /&gt;       currentPlayer = event.eventSound;&lt;br /&gt;       mp = mediaPlayers.get(currentPlayer);&lt;br /&gt;       mp.pause();       &lt;br /&gt;       break;&lt;br /&gt;      case SoundPoolEvent.SOUND_MUSIC_RESUME:&lt;br /&gt;       currentPlayer = event.eventSound;&lt;br /&gt;       mp = mediaPlayers.get(currentPlayer);&lt;br /&gt;       mp.start();&lt;br /&gt;       break;&lt;br /&gt;      &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    //Log.d("Error",e.getMessage());&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    this.wait(100);&lt;br /&gt;    //java.lang.Thread.currentThread().sleep(100);&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }   &lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; public void startSound()&lt;br /&gt; {&lt;br /&gt;  this.soundPool = new android.media.SoundPool(this.sounds.size(),android.media.AudioManager.STREAM_MUSIC,100);&lt;br /&gt;  java.util.Iterator &lt;Integer&gt; iterator = sounds.keySet().iterator();&lt;br /&gt;  &lt;br /&gt;  while(iterator.hasNext())&lt;br /&gt;  {&lt;br /&gt;   int soundid = iterator.next().intValue();&lt;br /&gt;   int soundhandle = this.soundPool.load(this.context, soundid, 1);&lt;br /&gt;   handles.put(new Integer(soundid), new Integer(soundhandle));&lt;br /&gt;  }&lt;br /&gt;    &lt;br /&gt;  isRunning=true;&lt;br /&gt;  this.start();&lt;br /&gt; }&lt;br /&gt; public void stopSound()&lt;br /&gt; {&lt;br /&gt;  java.util.Iterator &lt;Integer&gt; iterator = sounds.keySet().iterator();&lt;br /&gt;  &lt;br /&gt;  while(iterator.hasNext())&lt;br /&gt;  {&lt;br /&gt;   &lt;br /&gt;   int soundid = iterator.next().intValue();&lt;br /&gt;   if(this.sounds.get(soundid).booleanValue())&lt;br /&gt;   {&lt;br /&gt;    android.media.MediaPlayer mp = mediaPlayers.get(soundid);&lt;br /&gt;    mp.stop();&lt;br /&gt;    mp.release();&lt;br /&gt;    mp=null;&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;    this.soundPool.pause( this.handles.get(soundid).intValue());&lt;br /&gt;    this.soundPool.stop(this.handles.get(soundid).intValue());&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;  }  &lt;br /&gt;  &lt;br /&gt;  isRunning=false;&lt;br /&gt;  this.soundPool.release();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public int currentPlayer;&lt;br /&gt; private boolean isRunning;&lt;br /&gt; private java.util.HashMap&lt;Integer, Boolean&gt; sounds;&lt;br /&gt; private java.util.HashMap&lt;Integer, Integer&gt; handles;&lt;br /&gt; private android.content.Context context;&lt;br /&gt; private java.util.LinkedList&lt;SoundPoolEvent &gt; soundEvents;&lt;br /&gt; private java.util.HashMap&lt;Integer, android.media.MediaPlayer&gt; mediaPlayers;&lt;br /&gt; public void stopSound(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_STOP,resid));&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt; public void playSound(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_PLAY,resid));&lt;br /&gt;    this.notify();&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; public void startMusic(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_MUSIC_PLAY,resid));&lt;br /&gt;    this.notify();&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt; public void stopMusic(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_MUSIC_STOP,resid));&lt;br /&gt;    this.notify();&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt; public void pauseMusic(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_MUSIC_PAUSE,resid));&lt;br /&gt;    this.notify();&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt; public void resumeMusic(int resid)&lt;br /&gt; {&lt;br /&gt;  if(soundEvents!=null)&lt;br /&gt;  {&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;    soundEvents.add(new SoundPoolEvent(SoundPoolEvent.SOUND_MUSIC_RESUME,resid));&lt;br /&gt;    this.notify();&lt;br /&gt;   }&lt;br /&gt;   catch(Exception e)&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt; SoundPool soundPool;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;How do you use it?&lt;br /&gt;First create an instance of the class.&lt;br /&gt;Then add the resources to the SoundPoolManager (Sounds and music tracks)&lt;br /&gt;Then start the SoundManager thread.&lt;br /&gt;Then use the playSound() method to play a sound effect or playMusic() to play a song.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SoundPoolManager m = new SoundPoolManager(context);&lt;br /&gt;m.addSound(R.raw.bang, false);&lt;br /&gt;m.addSound(R.raw.mysong,true);&lt;br /&gt;m.startSound();&lt;br /&gt;m.playSound(R.raw.bang);&lt;br /&gt;m.playMusic(R.raw.mysong);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;If you want to pause the music use the pause call.&lt;br /&gt;&lt;br /&gt;Use the stopSound() method to stop the sound thread.&lt;br /&gt;The code is crude and the method names are not quite appropriate but it is published under the assumption that you may find it useful. You can take a look at the Robotic Space Rock code found at &lt;a href="http://code.google.com/p/monolithandroid"&gt;http://code.google.com/p/monolithandroid&lt;/a&gt; for actual examples.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-7064391649181168810?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/7064391649181168810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=7064391649181168810' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7064391649181168810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7064391649181168810'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/02/class-for-playing-music-and-sound.html' title='A class for playing music and sound effects revisited'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1011903521076648187</id><published>2009-01-28T23:16:00.001-08:00</published><updated>2009-01-28T23:26:42.819-08:00</updated><title type='text'>MonolithAndroid renamed to Robotic Space Rock</title><content type='html'>Today, I received an email from google asking me to rename the game I published for free in the android market. The game is called MonolithAndroid. Was called, actually, because from now on, it shall be called Robotic Space Rock! Yes, they informed me that I cannot use the word android, becase users may think that it is officialy endorsed from google, so I decided to drop the MonolithAndroid name alltogether and use the new improved and b-moviey name Robotic Space Rock.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1011903521076648187?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1011903521076648187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1011903521076648187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1011903521076648187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1011903521076648187'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/monolithandroid-renamed-to-robotic.html' title='MonolithAndroid renamed to Robotic Space Rock'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-6974814407681005861</id><published>2009-01-22T03:17:00.000-08:00</published><updated>2009-01-22T04:02:38.381-08:00</updated><title type='text'>How to display a license agreement on your android application.</title><content type='html'>It is usually good practice to present the user with a license agreement the first time it uses an app. You can show the user a preferably short text with the license agreement. A license agreement gives you some legal protection if your application causes a problem to someone. You can use a checkbox to indicate that the user accepted the license agreement and proceed to the application.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Qfga8utotf4/SXhYJljREEI/AAAAAAAAAN0/RAVhvgy1Gw0/s1600-h/eula.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 267px; height: 400px;" src="http://2.bp.blogspot.com/_Qfga8utotf4/SXhYJljREEI/AAAAAAAAAN0/RAVhvgy1Gw0/s400/eula.png" alt="" id="BLOGGER_PHOTO_ID_5294078283696115778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;We can use the shared preference mechanism to check if the user has agreed to the license agreement during the activity. If the user has previously agreed to the license then we proceed as normal. Otherwise, we show him the EULA. If the user checks the "I accept the license agreement" checkbox and presses OK, then we write to the preferences that the user accepted the license. If the user presses Cancel, we exit the app. You can see this in the following code excerpt&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private android.widget.CheckBox checkboxAcceptLicense;&lt;br /&gt;private android.widget.Button buttonOK;&lt;br /&gt;private android.widget.Button buttonCancel;&lt;br /&gt;private android.widget.TextView textviewLicense;&lt;br /&gt;public SharedPreferences.Editor prefsEditor;&lt;br /&gt;public SharedPreferences prefs;&lt;br /&gt;public android.view.View licenseView;&lt;br /&gt;private boolean soundInitialized;&lt;br /&gt;/** Called when the activity is first created. */&lt;br /&gt;@Override&lt;br /&gt;public void onCreate(Bundle icicle) {&lt;br /&gt;super.onCreate(icicle);&lt;br /&gt;soundInitialized = false;&lt;br /&gt;prefs = this.getPreferences(android.content.Context.MODE_PRIVATE);&lt;br /&gt;prefsEditor = prefs.edit();&lt;br /&gt;if(!prefs.getBoolean("LicenseAccepted", false))&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//this.licenseView = this.findViewById(R.layout.licenseagreement);&lt;br /&gt;this.licenseView = View.inflate(this, R.layout.licenseagreement, null);&lt;br /&gt;this.setContentView(licenseView);&lt;br /&gt;this.checkboxAcceptLicense = (android.widget.CheckBox)this.findViewById(R.id.checkLicenseAgreement);&lt;br /&gt;this.textviewLicense = (android.widget.TextView)this.findViewById(R.id.textviewLicenseAgreement);&lt;br /&gt;this.buttonOK= (android.widget.Button)this.findViewById(R.id.buttonOK);&lt;br /&gt;this.buttonCancel = (android.widget.Button)this.findViewById(R.id.buttonCancel);&lt;br /&gt;this.buttonCancel.setOnClickListener(&lt;br /&gt;         new View.OnClickListener()&lt;br /&gt;         {&lt;br /&gt;          public void onClick(View view)&lt;br /&gt;          {&lt;br /&gt;           exitNotAcceptedApplication();&lt;br /&gt;          }&lt;br /&gt;         }&lt;br /&gt;        );&lt;br /&gt;this.buttonOK.setOnClickListener(&lt;br /&gt;new View.OnClickListener()&lt;br /&gt;{&lt;br /&gt;public void onClick(View view)&lt;br /&gt;{&lt;br /&gt; if(checkboxAcceptLicense.isChecked())&lt;br /&gt; {&lt;br /&gt;  prefsEditor.putBoolean("LicenseAccepted", true);&lt;br /&gt;  prefsEditor.commit();&lt;br /&gt;  licenseView.setVisibility(View.INVISIBLE);&lt;br /&gt;&lt;br /&gt;  initActivity();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;initActivity();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;the initActivity() method contains the actual code that you would normally execute on the onCreate() method of your Activity. The layout file for the license agreement is the following (licenseagreement.xml):&lt;br /&gt;  &lt;!--   @page { size: 8.5in 11in; margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;xml&lt;/span&gt; &lt;span style="color: rgb(127, 0, 127);"&gt;version&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"1.0"&lt;/i&gt;&lt;/span&gt; &lt;span style="color: rgb(127, 0, 127);"&gt;encoding&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"utf-8"&lt;/i&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;LinearLayout&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/widget24"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"fill_parent"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"fill_parent"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:background&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"#ffffffff"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:padding&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"0px"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;xmlns:android&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"http://schemas.android.com/apk/res/android"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:orientation&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"vertical"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;TextView&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/textviewLicenseAgreement"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:padding&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"0px"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:text&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"Monolith Android Licence Agreement. This software package is provided to you, the end user, by the sofware package creator, Tasos Kleisas, as is. The software package is provided free of charge by the developer. However, the means of delivering the software to your device, (mobile phone, computer or other) may induce a service fee. The developer cannot be held responsible for any damage or loss that you may suffer by the use or installation of this application package to your device. Use at your own risk. The code, sound effects, and music are copyrighted by Tasos Kleisas (C) 2007-2009."&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textSize&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"14sp"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textColor&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"#000000"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:typeface&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textStyle&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_weight&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"0"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_gravity&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"left"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;TextView&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;CheckBox&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/checkLicenseAgreement"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"fill_parent"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:text&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"I accept the license agreement"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textColor&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"#000000"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textSize&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"12sp"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:typeface&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textStyle&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:checked&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"false"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:orientation&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"horizontal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;CheckBox&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;TableRow&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/widget32"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"fill_parent"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:orientation&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"horizontal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;Button&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/buttonOK"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:padding&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"10px"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:text&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"OK"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textSize&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"14sp"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:typeface&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textStyle&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_weight&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"0"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_gravity&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"left"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;Button&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;Button&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:id&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"@+id/buttonCancel"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_width&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_height&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:padding&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"10px"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:text&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"Cancel"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textSize&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"14sp"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:typeface&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:textStyle&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"normal"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_weight&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"0"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(127, 0, 127);"&gt;android:layout_gravity&lt;/span&gt;&lt;span style="color: rgb(26, 26, 26);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(42, 0, 255);"&gt;&lt;i&gt;"left"&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;Button&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;TableRow&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;span style="font-family:Monospace;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(63, 127, 127);"&gt;LinearLayout&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Unfortunately, as you can see the server messed up the xml layout a bit. But you can find the full code at &lt;a href="http://code.google.com/p/monolithandroid/source/browse/"&gt;http://code.google.com/p/monolithandroid/source/browse/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-6974814407681005861?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/6974814407681005861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=6974814407681005861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/6974814407681005861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/6974814407681005861'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/how-to-display-license-agreement-on.html' title='How to display a license agreement on your android application.'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Qfga8utotf4/SXhYJljREEI/AAAAAAAAAN0/RAVhvgy1Gw0/s72-c/eula.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-8840179928547161579</id><published>2009-01-22T03:01:00.000-08:00</published><updated>2009-01-26T00:52:03.096-08:00</updated><title type='text'>Android 3D graphics and SurfaceView</title><content type='html'>If you want to use OpenGL/ES, you have to use a SurfaceView class. The problem is that there are various parameters for the SurfaceView class. This, for example may work fine in the emulator:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;getHolder().setType(android.view.SurfaceHolder.SURFACE_TYPE_NORMAL);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;on a real device, however, you may get a blank screen, or very slow redraws, so you should use this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;getHolder().setType(android.view.SurfaceHolder.&lt;/code&gt;&lt;code&gt;SURFACE_TYPE_GPU&lt;/code&gt;&lt;code&gt;);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;or even this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;getHolder().setType(android.view.SurfaceHolder.&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;SURFACE_TYPE_HARDWARE&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So i came up with this solution for the SurfaceView initialization:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public GameSurfaceView(Context context,GameOverlay overlay,Sound soundManager)&lt;br /&gt;{&lt;br /&gt;super(context);&lt;br /&gt;this.soundManager = soundManager;&lt;br /&gt;this.context = context;&lt;br /&gt;this.overlay = overlay;&lt;br /&gt;this.viewType = GLThread.VIEW_INTRO;&lt;br /&gt;this.gameType = Game.GAME_MONOLITH;&lt;br /&gt;getHolder().addCallback(this);&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;  getHolder().setType(android.view.SurfaceHolder.&lt;/code&gt;&lt;code&gt;SURFACE_TYPE_GPU&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;);&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;    getHolder().setType(android.view.SurfaceHolder.&lt;/code&gt;&lt;code&gt;SURFACE_TYPE_HARDWARE&lt;/code&gt;&lt;code&gt;);&lt;br /&gt;  }&lt;br /&gt;  catch(Exception e2)&lt;br /&gt;  {&lt;br /&gt;    try&lt;br /&gt;    {&lt;br /&gt;      getHolder().setType(android.view.SurfaceHolder.SURFACE_TYPE_NORMAL);&lt;br /&gt;    }&lt;br /&gt;    catch(Exception e3)&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So in the code above, we first try to get a hardware accelerated surface (fastest), if that fails a gpu memory surface(still fast) and if that fails a normal software surface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-8840179928547161579?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/8840179928547161579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=8840179928547161579' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8840179928547161579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8840179928547161579'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/android-3d-graphics-and-surfaceview.html' title='Android 3D graphics and SurfaceView'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-6343283333450212420</id><published>2009-01-20T08:46:00.000-08:00</published><updated>2009-01-20T09:43:09.063-08:00</updated><title type='text'>MonolithAndroid 1.0.4 beta is out</title><content type='html'>It' s been almost two weeks since I released an updated version of MonolithAndroid. But now version 1.0.4 beta is out! I've corrected a few bugs and added some features but there are still some critters in there. So to sum up, here's a small changelog.&lt;br /&gt;&lt;br /&gt;1. Switched from using media player for sound effects and music to a hybrid SoundPool / MediaPlayer implementation. Now the sounds are played using SoundPool and the music is played with MediaPlayer. Of course some problems remain. The most important problem is that the music cannot reliably be stopped.&lt;br /&gt;2. Added a highscore table. Now you can find out who is the best player. The highscore table persists, so if you restart the game, your highscore is still there.&lt;br /&gt;3. Added an options menu. Now you can select the type of game you want to play, the level and the difficulty. Two types of game are provided: Classic, which resembles a well known 6 letter game, and Monolith. Monolith introduces special white blocks. If you complete a line with a white block in it, the game grid evolves according to Conway's game of life. The difficulty setting enables you to choose between two settings. Normal is your meat and potatoes game. You can drag the touch screen to rotate the playfield. That may be useful practice for the expert difficulty mode. In Expert, the playfield rotates in various axes (depending on the level you currently play) so if you suffer from motion sickness do not play this mode! Ahhh, you have been warned! The level (1-10) determines the speed of the falling blocks as well as the rotation of the screen in expert mode. In the options screen you can enable/disable the music (not currently working) and the sound effects of the game. When you are happy with the game options go to OK, press right and then choose Play to start your game.&lt;br /&gt;4. Changed the music format from mp3 to ogg because it reportedly causes less crashes on the MediaPlayer.&lt;br /&gt;5. The program now exits if you press the back or the home button.&lt;br /&gt;&lt;br /&gt;A bit of a warning... I do not currently own an android  hardware device, because they are not available yet in Greece where I live. So if you happen to install the game on a real device I would like to hear your comments and bug reports. You can download a signed apk from &lt;a href="http://code.google.com/p/monolithandroid/downloads/list"&gt;http://code.google.com/p/monolithandroid/downloads/list&lt;/a&gt;. Choose the monolithandroid 1.0.4 beta apk. You can post your comments here, or you can use the issue tracker found on &lt;a href="http://code.google.com/p/monolithandroid/issues/list"&gt;http://code.google.com/p/monolithandroid/issues/list&lt;/a&gt;&lt;br /&gt;Here's a grainy video made from the emulator. You can almost hear me talking in the background...&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/neJOwlsmKmU&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/neJOwlsmKmU&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-6343283333450212420?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/6343283333450212420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=6343283333450212420' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/6343283333450212420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/6343283333450212420'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/monolithandroid-104-beta-is-out.html' title='MonolithAndroid 1.0.4 beta is out'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-3693643981678456458</id><published>2009-01-07T06:03:00.000-08:00</published><updated>2009-01-07T06:09:06.962-08:00</updated><title type='text'>Monolithandroid 1.0.3 beta release</title><content type='html'>The release frenzy continues with the release of monolithandroid 1.0.3 beta apk. This release corrects the texture loading problem of the previous 1.0.2 beta release. The problem manifested itself as holes in the textures used. Instead of using custom loading code, we use a function from the GLUtils class. So try it out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-3693643981678456458?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/3693643981678456458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=3693643981678456458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3693643981678456458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3693643981678456458'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/monolithandroid-103-beta-release.html' title='Monolithandroid 1.0.3 beta release'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-2886433564993382440</id><published>2009-01-06T23:15:00.000-08:00</published><updated>2009-01-07T02:15:07.848-08:00</updated><title type='text'>monolithandroid 1.0.2 beta version update</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Qfga8utotf4/SWR_t0cbhCI/AAAAAAAAAM0/YmoXKjUSds8/s1600-h/device.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 267px; height: 400px;" src="http://1.bp.blogspot.com/_Qfga8utotf4/SWR_t0cbhCI/AAAAAAAAAM0/YmoXKjUSds8/s400/device.png" alt="" id="BLOGGER_PHOTO_ID_5288492287588533282" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;A new apk is up for grabs. I am referring to the monolithandroid 1.0.2 beta which can be found at &lt;a href="http://code.google.com/p/monolithandroid/downloads/list"&gt;http://code.google.com/p/monolithandroid/downloads/list&lt;/a&gt; The new apk uses the   &lt;br /&gt;setType(SurfaceHolder.SURFACE_TYPE_GPU) parameter during the initialization of the display surface. Maybe the omission of this parameters caused the black screens on the G1 devices in the previous releases. However this change has caused the textures to appear incorrectly in the emulator.Note the picture on the left. The texture is full of black holes. I do not know if this occurs in an actual hardware device however... Can a guy with a real phone try it out and tell us the result?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-2886433564993382440?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/2886433564993382440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=2886433564993382440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2886433564993382440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2886433564993382440'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2009/01/monolithandroid-102-beta-version-update.html' title='monolithandroid 1.0.2 beta version update'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Qfga8utotf4/SWR_t0cbhCI/AAAAAAAAAM0/YmoXKjUSds8/s72-c/device.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-3530293240242374463</id><published>2008-12-30T12:28:00.000-08:00</published><updated>2008-12-30T12:45:24.435-08:00</updated><title type='text'>Another monolithandroid beta is out</title><content type='html'>I just released another monolithandroid beta (monolithandroid1.0.1beta.apk). It seems that most of the previous beta 1.0.0 problems were related to 3 things.&lt;br /&gt;First, the prepareAsync call used in media player to play sounds caused problems. Now synchronous playback is used.&lt;br /&gt;Second, The textures that I was using were pretty big. Now the texture sizes (used for the moon and earth) are reduced below 64x64 pixels. Third, I had a starfield class that drew 3d points in order to give the player the illusion of space travel. The problem was I was trying to draw 10000 points which is way too much. Now only 100 points are drawn. So go to &lt;a href="http://code.google.com/p/monolithandroid"&gt;http://code.google.com/p/monolithandroid&lt;/a&gt; and grab the latest apk. Give it a try on your android phone and you may even have some fun. I hope that the music won't drive you crazy! Post your comments  here or use the Issue tracker found on &lt;a href="http://code.google.com/p/monolithandroid"&gt;http://code.google.com/p/monolithandroid&lt;/a&gt;&lt;br /&gt;Oh, and don't forget to say what device you used for your tests!&lt;br /&gt;I would like to take the opportunity to wish you a happy new year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-3530293240242374463?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/3530293240242374463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=3530293240242374463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3530293240242374463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3530293240242374463'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/12/another-monolithandroid-beta-is-out.html' title='Another monolithandroid beta is out'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1157633886549481446</id><published>2008-12-23T02:44:00.000-08:00</published><updated>2008-12-23T03:02:23.085-08:00</updated><title type='text'>MonolithAndroid needs you!</title><content type='html'>That is, I need beta testers to try the game out on a real hardware device like the T-Mobile G1. Yesterday, I published MonolithAndroid version 1.0.0 on the android market. Because I live in Greece, I cannot get hold of an actual G1 Phone, so I only tested my application on the emulator. And it seems that testing on the emulator is not enough. Hours after monolithandroid was published on android market, I got a couple of emails saying that the program presented them with a black screen and they only heard some music but they saw no graphics. So I unpublished the application. And here's where I need your help.&lt;br /&gt;I would like you to download the installation package from http://code.google.com/p/monolithandroid and try it out on your TMobile G1. And here's what I would like to know:&lt;br /&gt;&lt;br /&gt;1. Does the application start?&lt;br /&gt;2. Do you hear music?&lt;br /&gt;3. Can you see the letters MonolithAndroid going on and off?&lt;br /&gt;4. You only see a black screen?&lt;br /&gt;5. If the game seems to run,  does it run smoothly, or it feels sluggish?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1157633886549481446?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1157633886549481446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1157633886549481446' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1157633886549481446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1157633886549481446'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/12/monolithandroid-needs-you.html' title='MonolithAndroid needs you!'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1520472398655195857</id><published>2008-09-23T07:17:00.000-07:00</published><updated>2008-09-23T08:01:03.921-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='android programming'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Some thoughts on google android as a gaming platform</title><content type='html'>With the launch of the first android device (T-Mobile G1) just around the corner, I would like to share with you a few thoughts regarding the viability of the android platform for gaming purposes.&lt;br /&gt;Android has rich multimedia and graphics api's:&lt;br /&gt;1.Support for openGL/ES and 2D drawing.&lt;br /&gt;2.Media api's.&lt;br /&gt;3.Support for sensors (GPS and accelerometer).&lt;br /&gt;4.Networking.&lt;br /&gt;5.Optional touch interface.&lt;br /&gt;&lt;br /&gt;So in theory, it should be ideal for gaming, right?&lt;br /&gt;&lt;br /&gt;Well yes, but there are some caveats:&lt;br /&gt;1. Not all devices will support touch interfaces and sensors.&lt;br /&gt;2. Not all devices will have the same screen size.&lt;br /&gt;3. For gaming, some sort of joystick or D-PAD device is essential. A D-PAD was standard in the various emulator images, since the first SDK, but the first device (The T-Mobile G1) comes without a D-PAD! Instead, we get a tiny trackball, not the best IO device for gaming!&lt;br /&gt;So the problem is that as it seems, we will have a lot of different devices, with different configurations. Some will have touch interfaces, some will not, some will have a D-PAD, some will have trackballs, some will have acceleration sensors and so on. So, a game developer that develops for android will have the same kind of problems that a PC game programmer has. Different screen sizes and IO devices and so on... That increases the amount of time and resources a developer has to use in order to make his game playable on most phones. The same problems that drive a lot of PC game developers to game consoles.&lt;br /&gt;&lt;br /&gt;So how can this be remedied? Well I guess that one possible solution is the introduction of a limited set of device profiles. Something like basic, gaming and advanced profiles, that will provide the developer with the same set of IO features. &lt;br /&gt;Otherwise, I see a lot of developers fleeing to the apple iPhone, with it's game console simplicity, rather than the android's PC like capabilities.&lt;br /&gt;&lt;br /&gt;I'd love to see your opinion on those thoughts, so shoot!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1520472398655195857?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1520472398655195857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1520472398655195857' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1520472398655195857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1520472398655195857'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/09/some-thoughts-on-google-android-as.html' title='Some thoughts on google android as a gaming platform'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-4171495035933564655</id><published>2008-08-26T13:54:00.000-07:00</published><updated>2008-08-26T14:06:12.272-07:00</updated><title type='text'>Yet another SDK update</title><content type='html'>I just returned from my summer holidays and found a brand new android SDK (0.9beta) available for download. I downloaded it, and found that it introduces a lot of changes. Packages were renamed and openGL/ES programming has changed quite a lot. Even menus are now different. So a lot of work is required to update monolithandroid in order to make it work with this SDK. Maybe I will be able to pump out a new, compatible version till the end of the week. Since this SDK is a 0.9 beta version, not a lot of things will change in the final 1.0 release and that means that the next releases will require a lot less work. And since the first android devices are scheduled for release in Q4, maybe we will be able to get our hands on a device just in time for Christmas. Now I must leave you and return to my project. I have a lot of work to do and correct some nasty bugs. Stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-4171495035933564655?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/4171495035933564655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=4171495035933564655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/4171495035933564655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/4171495035933564655'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/08/yet-another-sdk-update.html' title='Yet another SDK update'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1237400192780161956</id><published>2008-08-04T04:39:00.000-07:00</published><updated>2008-08-04T04:54:31.730-07:00</updated><title type='text'>Summer &lt;&gt; development</title><content type='html'>Summer (especially in Greece) is really counterproductive. While the android engineers are working hard to put the finishing touches on our beloved operating system, I am going to the beach every day, drinking beer and coffee, and enjoying the summer vacations. No time for android programming. Tomorrow, my girlfriend and I are going to Crete for a twenty day vacation. We are going to visit our friends in Chania, and go to the archeological sites of Knossos and Faistos. We will end up camping in Gaidouronisi and relax next to the sea. When we return I hope that a new android SDK will be available for download and that one or more devices will be scheduled for release before the end of the year. Next summer I hope that I will be travelling with my android phone.&lt;br /&gt;For those who are lucky enough to be on vacation, enjoy the sea and the sun. For those of you who are still working, take care guys, and don't burnout. Take a break, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1237400192780161956?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1237400192780161956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1237400192780161956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1237400192780161956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1237400192780161956'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/08/summer-development.html' title='Summer &lt;&gt; development'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-7212457002424497667</id><published>2008-05-27T14:34:00.000-07:00</published><updated>2008-05-27T14:36:40.452-07:00</updated><title type='text'>Video for monolithandroid 1.0.3c alpha</title><content type='html'>I decided to put together a video to show graphics, gameplay and music for my game, monolithandroid. Comments are welcome!&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/aYeol_2j9YY&amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/aYeol_2j9YY&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-7212457002424497667?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/7212457002424497667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=7212457002424497667' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7212457002424497667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7212457002424497667'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/05/video-for-monolithandroid-103c-alpha.html' title='Video for monolithandroid 1.0.3c alpha'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-8109176263381841773</id><published>2008-05-24T06:24:00.000-07:00</published><updated>2008-05-24T07:05:43.448-07:00</updated><title type='text'>Working with textures in android's OpenGL/ES.</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Qfga8utotf4/SDgYVmMyo2I/AAAAAAAAAIU/yPaGyeHy71A/s1600-h/monolithandroid_textures.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Qfga8utotf4/SDgYVmMyo2I/AAAAAAAAAIU/yPaGyeHy71A/s400/monolithandroid_textures.jpg" alt="" id="BLOGGER_PHOTO_ID_5203936128737125218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As you may recall, I use textures to draw the moon backdrop for my android application, monolithandroid. Originally, I only used one texture and I used some code from Ed Burnette's forthcoming book "Hello, Android". However, I decided to add more textures in order to improve the game's graphics. So I created a class named GLTextures, that can be used to make working with multiple textures easier.&lt;br /&gt;Here's the code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package org.teacake.monolith.apk;&lt;br /&gt;import javax.microedition.khronos.opengles.*;&lt;br /&gt;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.graphics.Bitmap;&lt;br /&gt;import android.graphics.BitmapFactory;&lt;br /&gt;import java.lang.Integer;&lt;br /&gt;import java.nio.ByteBuffer;&lt;br /&gt;import java.nio.ByteOrder;&lt;br /&gt;import java.nio.IntBuffer;&lt;br /&gt;public class GLTextures {&lt;br /&gt;	public GLTextures(GL10 gl,Context context)&lt;br /&gt;	{&lt;br /&gt;		this.gl = gl;&lt;br /&gt;		this.context = context;&lt;br /&gt;		this.textureMap = new java.util.HashMap&lt;Integer, Integer&gt; ();&lt;br /&gt;	}&lt;br /&gt;	&lt;br /&gt;	public void loadTextures()&lt;br /&gt;	{&lt;br /&gt;		int[] tmp_tex = new int[textureFiles.length];&lt;br /&gt;		gl.glGenTextures(textureFiles.length, tmp_tex, 0);&lt;br /&gt;		textures = tmp_tex;&lt;br /&gt;		for(int i=0;i&lt;textureFiles.length;i++)&lt;br /&gt;		{&lt;br /&gt;	    	Bitmap bmp = BitmapFactory.decodeResource(context.getResources(), textureFiles[i]);&lt;br /&gt;	    	ByteBuffer bb = extract(bmp);&lt;br /&gt;	    	// Get a new texture name&lt;br /&gt;	    	// Load it up&lt;br /&gt;	    	this.textureMap.put(new Integer(textureFiles[i]),new Integer(i));&lt;br /&gt;	    	int tex = tmp_tex[i];&lt;br /&gt;	    	int width = bmp.getWidth();&lt;br /&gt;	    	int height = bmp.getHeight();&lt;br /&gt;	    	gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);&lt;br /&gt;	    	gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA,width, height, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, bb);&lt;br /&gt;	    	gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);&lt;br /&gt;	    	gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);&lt;br /&gt;	    	&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;	public void setTexture(int id)&lt;br /&gt;	{&lt;br /&gt;		try&lt;br /&gt;		{&lt;br /&gt;			int textureid = this.textureMap.get(new Integer(id)).intValue();&lt;br /&gt;	    	gl.glBindTexture(GL10.GL_TEXTURE_2D, this.textures[textureid]);&lt;br /&gt;		&lt;br /&gt;		}&lt;br /&gt;		catch(Exception e)&lt;br /&gt;		{&lt;br /&gt;			return;&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;    private static ByteBuffer extract(Bitmap bmp)&lt;br /&gt;    {&lt;br /&gt;    	ByteBuffer bb = ByteBuffer.allocateDirect(bmp.height() * bmp.width() * 4);&lt;br /&gt;    	bb.order(ByteOrder.BIG_ENDIAN);&lt;br /&gt;    	IntBuffer ib = bb.asIntBuffer();&lt;br /&gt;    	// Convert ARGB -&gt; RGBA&lt;br /&gt;    	for (int y = bmp.height() - 1; y &gt; -1; y--)&lt;br /&gt;    	{&lt;br /&gt;    		&lt;br /&gt;    		for (int x = 0; x &lt; bmp.width(); x++)&lt;br /&gt;    		{&lt;br /&gt;    			int pix = bmp.getPixel(x, bmp.getHeight() - y - 1);&lt;br /&gt;    			int alpha = ((pix &gt;&gt; 24) &amp; 0xFF);&lt;br /&gt;    			int red = ((pix &gt;&gt; 16) &amp; 0xFF);&lt;br /&gt;    			int green = ((pix &gt;&gt; 8) &amp; 0xFF);&lt;br /&gt;    			int blue = ((pix) &amp; 0xFF);&lt;br /&gt;    			&lt;br /&gt;    			// Make up alpha for interesting effect&lt;br /&gt;    			&lt;br /&gt;    			//ib.put(red &lt;&lt; 24 | green &lt;&lt; 16 | blue &lt;&lt; 8 | ((red + blue + green) / 3));&lt;br /&gt;    			ib.put(red &lt;&lt; 24 | green &lt;&lt; 16 | blue &lt;&lt; 8 | alpha);&lt;br /&gt;    		}&lt;br /&gt;    	}&lt;br /&gt;    	bb.position(0);&lt;br /&gt;    	return bb;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;     &lt;br /&gt;	public void add(int resource)&lt;br /&gt;	{&lt;br /&gt;		if(textureFiles==null)&lt;br /&gt;		{&lt;br /&gt;			textureFiles = new int[1];&lt;br /&gt;			textureFiles[0]=resource;&lt;br /&gt;		}&lt;br /&gt;		else&lt;br /&gt;		{&lt;br /&gt;			int[] newarray = new int[textureFiles.length+1];&lt;br /&gt;			for(int i=0;i&lt;textureFiles.length;i++)&lt;br /&gt;			{&lt;br /&gt;				newarray[i]=textureFiles[i];&lt;br /&gt;			}&lt;br /&gt;			newarray[textureFiles.length]=resource;&lt;br /&gt;			textureFiles = newarray;&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;	private java.util.HashMap &lt;Integer, Integer&gt; textureMap; &lt;br /&gt;	private int[] textureFiles;&lt;br /&gt;	private GL10 gl;&lt;br /&gt;	private Context context;&lt;br /&gt;	private int[] textures;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So, what can you use this code for?&lt;br /&gt;This code enables you to load resources as textures.&lt;br /&gt;At first you create a GLTextures object like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  GLTextures textures = new GLTextures(gl, context);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Then you add the resource images you want to use as textures:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  this.textures.add(R.drawable.moon);&lt;br /&gt;  this.textures.add(R.drawable.earth);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;And then you loadup the textures:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  textures.loadTextures();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;When you want to use the texture in your OpenGL code, you can use:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  textures.setTexture(R.drawable.moon);&lt;br /&gt;  .&lt;br /&gt;  .&lt;br /&gt;  //OpenGL drawing code&lt;br /&gt;  .&lt;br /&gt;  .&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Actually the setTexture() method calls glBindTexture() which sets the current texture to the correct one.&lt;br /&gt;Of course, you have to enable textures in your OpenGL code in order to do that! If you want more details and examples study the classes GLThread, Square and GLTextures found at &lt;a href="http://code.google.com/p/monolithandroid"&gt;http://code.google.com/p/monolithandroid&lt;/a&gt;&lt;br /&gt;As you may find, loading pictures and converting them to textures can take a lot of time, so one improvement that you can make is to create a caching scheme. You can, for example, store the textures in a file, after converting them from a picture for the first time, so the next time the application is run, it will load the textures without having to do a conversion. Happy hacking!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-8109176263381841773?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/8109176263381841773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=8109176263381841773' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8109176263381841773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8109176263381841773'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/05/working-with-textures-in-androids.html' title='Working with textures in android&apos;s OpenGL/ES.'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_Qfga8utotf4/SDgYVmMyo2I/AAAAAAAAAIU/yPaGyeHy71A/s72-c/monolithandroid_textures.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-2134418536197221317</id><published>2008-05-18T10:38:00.000-07:00</published><updated>2008-05-18T11:20:10.984-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sound'/><category scheme='http://www.blogger.com/atom/ns#' term='android programming'/><title type='text'>A simple class for playing music and sound effects for android</title><content type='html'>I think that android has a few problems in the area of sound/music playback. After much digging, the only way that I have found to play back music and sound effects is android.media.MediaPlayer. I wanted to add music and sound effects to my game monolithandroid. So I came up with the following class, aptly named SoundSystem. This class uses a separate thread for playback, because we don't want our sound to slowdown our game rendering.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package org.teacake.monolith;&lt;br /&gt;import android.media.MediaPlayer;&lt;br /&gt;import android.os.Handler;&lt;br /&gt;import android.os.Message;&lt;br /&gt;import android.os.SystemClock;&lt;br /&gt;public class SoundSystem extends Thread&lt;br /&gt;{&lt;br /&gt;   public SoundSystem(android.content.Context context)&lt;br /&gt;   {&lt;br /&gt;       action = SOUND_DO_NOTHING;&lt;br /&gt;       lastEventTime= SystemClock.uptimeMillis();&lt;br /&gt;       this.context = context;&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           musicPlayer = android.media.MediaPlayer.create(context, R.raw.intro);&lt;br /&gt;           soundPlayerRotateBlock = android.media.MediaPlayer.create(context, R.raw.rotate);&lt;br /&gt;           soundPlayerExplosion = android.media.MediaPlayer.create(context, R.raw.explosion2);&lt;br /&gt;           soundPlayerPlaceBlock = android.media.MediaPlayer.create(context, R.raw.place);&lt;br /&gt;           musicPlayer.prepare();&lt;br /&gt;           musicPlayer.setLooping(1);&lt;br /&gt;           musicPlayer.seekTo(0);&lt;br /&gt;           soundPlayerRotateBlock.prepare();&lt;br /&gt;           soundPlayerRotateBlock.seekTo(0);&lt;br /&gt;           soundPlayerExplosion.prepare();&lt;br /&gt;           soundPlayerExplosion.seekTo(0);&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   private void startMusic()&lt;br /&gt;   {&lt;br /&gt;       if(musicPlayer==null)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           if(musicPlayer.isPlaying())&lt;br /&gt;           {&lt;br /&gt;               return;&lt;br /&gt;           }&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;               musicPlayer.start();&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;       }      &lt;br /&gt;   }&lt;br /&gt;   private void stopMusic()&lt;br /&gt;   {&lt;br /&gt;       if(musicPlayer==null)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           musicPlayer.stop();&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   private void playRotateBlock()&lt;br /&gt;   {&lt;br /&gt;       int duration=0;&lt;br /&gt;       int currentPosition=0;&lt;br /&gt;       if(soundPlayerRotateBlock==null)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           duration=soundPlayerRotateBlock.getDuration();&lt;br /&gt;           currentPosition=soundPlayerRotateBlock.getCurrentPosition();&lt;br /&gt;           //if(currentPosition==duration-1)&lt;br /&gt;           {&lt;br /&gt;               soundPlayerRotateBlock.seekTo(0);&lt;br /&gt;               soundPlayerRotateBlock.start();&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   private void playExplosion()&lt;br /&gt;   {&lt;br /&gt;       int duration=0;&lt;br /&gt;       int currentPosition=0;&lt;br /&gt;       if(soundPlayerExplosion==null)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           duration=soundPlayerExplosion.getDuration();&lt;br /&gt;           currentPosition=soundPlayerExplosion.getCurrentPosition();&lt;br /&gt;           //if(currentPosition==duration-1)&lt;br /&gt;           {&lt;br /&gt;               soundPlayerExplosion.seekTo(0);&lt;br /&gt;               soundPlayerExplosion.start();&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   private void playPlaceBlock()&lt;br /&gt;   {&lt;br /&gt;       int duration=0;&lt;br /&gt;       int currentPosition=0;&lt;br /&gt;       if(soundPlayerPlaceBlock==null)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;       try&lt;br /&gt;       {&lt;br /&gt;           duration=soundPlayerPlaceBlock.getDuration();&lt;br /&gt;           currentPosition=soundPlayerPlaceBlock.getCurrentPosition();&lt;br /&gt;           //if(currentPosition==duration-1)&lt;br /&gt;           {&lt;br /&gt;               soundPlayerPlaceBlock.seekTo(0);&lt;br /&gt;               soundPlayerPlaceBlock.start();&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       catch(Exception e)&lt;br /&gt;       {&lt;br /&gt;             &lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   @Override&lt;br /&gt;   public void run()&lt;br /&gt;   {&lt;br /&gt;       while(!done)&lt;br /&gt;       {&lt;br /&gt;           switch(action)&lt;br /&gt;           {&lt;br /&gt;               case SOUND_START_MUSIC:&lt;br /&gt;               startMusic();&lt;br /&gt;               break;&lt;br /&gt;               case SOUND_STOP_MUSIC:&lt;br /&gt;               stopMusic();&lt;br /&gt;               break;&lt;br /&gt;               case SOUND_PLAY_ROTATE_BLOCK:&lt;br /&gt;               playRotateBlock();&lt;br /&gt;               break;&lt;br /&gt;               case SOUND_PLAY_EXPLOSION:&lt;br /&gt;               playExplosion();&lt;br /&gt;               break;&lt;br /&gt;               case SOUND_PLAY_PLACE_BLOCK:&lt;br /&gt;               playPlaceBlock();  &lt;br /&gt;               break;&lt;br /&gt;           }&lt;br /&gt;           action=SOUND_DO_NOTHING;&lt;br /&gt;           try&lt;br /&gt;           {&lt;br /&gt;               java.lang.Thread.currentThread().sleep(100);&lt;br /&gt;           }&lt;br /&gt;           catch(Exception e)&lt;br /&gt;           {&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   public boolean done;&lt;br /&gt;   public final Handler messageHandler = new Handler() {&lt;br /&gt;       @Override&lt;br /&gt;       public void handleMessage(Message msg)&lt;br /&gt;       {&lt;br /&gt;           try&lt;br /&gt;           {&lt;br /&gt;               action=msg.what;&lt;br /&gt;           }&lt;br /&gt;           catch(Exception e)&lt;br /&gt;           {&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;   };&lt;br /&gt;   private android.content.Context context;&lt;br /&gt;   public long lastEventTime;&lt;br /&gt;   public int action;&lt;br /&gt;   public static final int SOUND_DO_NOTHING=-1;&lt;br /&gt;   public static final int SOUND_START_MUSIC=0;&lt;br /&gt;   public static final int SOUND_STOP_MUSIC=1;&lt;br /&gt;   public static final int SOUND_PLAY_ROTATE_BLOCK=2;&lt;br /&gt;   public static final int SOUND_PLAY_EXPLOSION=3;&lt;br /&gt;   public static final int SOUND_PLAY_PLACE_BLOCK=4;&lt;br /&gt;   private android.media.MediaPlayer musicPlayer;&lt;br /&gt;   private android.media.MediaPlayer soundPlayerRotateBlock;&lt;br /&gt;   private android.media.MediaPlayer soundPlayerExplosion;&lt;br /&gt;   private android.media.MediaPlayer soundPlayerPlaceBlock;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;As you can see the run() method calls the appropriate method for playing each sound, depending on the message received. How do we send a message to the thread? By using the following code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;               android.os.Message message =  android.os.Message.obtain(soundSystem.messageHandler, SoundSystem.SOUND_START_MUSIC);&lt;br /&gt;               message.sendToTarget();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Notice that we use a MediaPlayer object for each sound. I don't know how heavyweight the MediaPlayer object is, and if it is suitable for use for playing 10's or even 100's of sounds. So that could be a problem if you use a lot of sounds for your game. Also, we use synchronous playback, and that could be a problem, too, if our sounds are long. But since it is only version 1.0, it will be improved&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-2134418536197221317?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/2134418536197221317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=2134418536197221317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2134418536197221317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2134418536197221317'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/05/simple-class-for-playing-music-and.html' title='A simple class for playing music and sound effects for android'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-2200022374584219743</id><published>2008-05-15T07:28:00.000-07:00</published><updated>2008-05-15T08:35:01.133-07:00</updated><title type='text'>Porting monolithandroid from m3 to m5</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Qfga8utotf4/SCxMe8R9KDI/AAAAAAAAAIA/CNFNmKsM7cA/s1600-h/monolithandroid_m5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Qfga8utotf4/SCxMe8R9KDI/AAAAAAAAAIA/CNFNmKsM7cA/s400/monolithandroid_m5.png" alt="" id="BLOGGER_PHOTO_ID_5200615764167305266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The application that I am developing, monolithandroid, currently does not run under m5 series SDK. Why? My app uses OpenGL/ES and there have been significant changes to the way OpenGL/ES works under android from m3 to m5. In a nutshell, in m3 you can use a plain view and intermix OpenGL and Canvas calls. In m5 this is not currently allowed. This was a major problem because the onPaint method of the View Object was used to draw text such as score and level information, as well as the application backdrop (a picture of the moon). There are ways to circumvent these problems and fix the application so that it works on m5. How? You can use a SurfaceView to draw the OpenGL objects, and you can use an overlay to draw text on top of the SurfaceView. And the backdrop? Actually you can use a textured image (an OpenGL object) to draw the backdrop, with the added bonus that you can easily rotate and scale the image.  To sum up, monolithandroid under m3 used a class named GLView to draw everything on screen. For m5, 4 new classes were introduced in place of GLView:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;GameOverlay (used for drawing status text and scores)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;GameSurfaceView (used for holding a surface for OpenGL drawing)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;GLThread (used for actually drawing OpenGL objects)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Square (used to load a textured square for the backdrop image of the moon)&lt;/li&gt;&lt;/ol&gt;In order to create an overlay, you can use the following code&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public void onCreate(Bundle icicle) {&lt;br /&gt;    super.onCreate(icicle);&lt;br /&gt;    overlay = new GameOverlay(this);&lt;br /&gt;    optionsView = new OptionsView(getApplication());&lt;br /&gt;    android.content.AssetManager mgr = getApplication().getAssets();&lt;br /&gt;    gsf = new GameSurfaceView(this,overlay);&lt;br /&gt;    gsf.setViewType(GLThread.VIEW_GAME);&lt;br /&gt;    gsf.setGameType(Monolith.GAME_MONOLITH);&lt;br /&gt;    setContentView(gsf);&lt;br /&gt;    gsf.setVisibility(View.VISIBLE);&lt;br /&gt;    this.addContentView(overlay,new android.view.ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT));&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;You can browse the full code at &lt;a href="http://code.google.com/p/monolithandroid/source/browse"&gt;http://code.google.com/p/monolithandroid/source/browse&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It is under svn-&gt;trunk-&gt;monolithandroid-&gt;src-&gt;org-&gt;teacake-&gt;monolith&lt;br /&gt;So after I made these changes, monolithandroid sort of works. However, there are some problems to be addressed, like the time it takes on startup to load the moon image and convert it into a texture.&lt;br /&gt;I would like to take the opportunity to thank Ed Burnette for sending me a preview PDF of his forthcoming android book, "HelloAndroid", and I must say that it looks very, very promising. Way to go, Ed! You can find out more about it at: &lt;a href="http://www.pragprog.com/categories/upcoming"&gt;http://www.pragprog.com/categories/upcoming&lt;/a&gt;&lt;br /&gt;I admit that I shamelessly copied some code (the code for loading textures) from it.&lt;br /&gt;Also I would like to thank plusminus and all the guys at &lt;a href="http://www.anddev.org/"&gt;http://www.anddev.org&lt;/a&gt; where you can find many interesting tutorials, like the following: &lt;a href="http://www.anddev.org/textured_cube_opengl_code_sample-t813.html"&gt;http://www.anddev.org/textured_cube_opengl_code_sample-t813.html&lt;/a&gt;&lt;br /&gt;Excellent work, guys.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-2200022374584219743?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/2200022374584219743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=2200022374584219743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2200022374584219743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2200022374584219743'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/05/porting-monolithandroid-from-m3-to-m5.html' title='Porting monolithandroid from m3 to m5'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_Qfga8utotf4/SCxMe8R9KDI/AAAAAAAAAIA/CNFNmKsM7cA/s72-c/monolithandroid_m5.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-7089000479837949007</id><published>2008-05-09T13:07:00.000-07:00</published><updated>2008-05-09T14:30:20.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='monolithandroid'/><category scheme='http://www.blogger.com/atom/ns#' term='ADC'/><title type='text'>I did not win Android Developer Challenge but it's OK</title><content type='html'>A couple of hours ago I received an email from google that informed me that I am not one of the winner of Android Developer Challenge. To tell you the truth I was not dissapointed. I did not put a lot of hours behind my application, it did not exploit a lot of the platform features and more importantly, it was unoriginal. I am sure that Google's intent behind Android Developer Challenge is to promote original applications, that showcase their platforms strengths. MonolithAndroid (my app) on the contrary only shows OpenGL/ES and touch screen functionality.&lt;br /&gt;To sum up (monolithandroid versus the winning apps):&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_Qfga8utotf4/SCTCNrmgs-I/AAAAAAAAAH4/_LFNX3yq8Gk/s1600-h/monolithandroid.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_Qfga8utotf4/SCTCNrmgs-I/AAAAAAAAAH4/_LFNX3yq8Gk/s400/monolithandroid.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5198493410190734306" /&gt;&lt;/a&gt;&lt;br /&gt;So from the above, it is easy to see why my poor tiny app did not win ADC, and why I am not whining about it. The question is, can this meek app be transformed into a winner? I don't know, but I will do my best to make it better. And since it is open source, you can take a shot at it!&lt;br /&gt;On Monday we will probably have more information about the winning applications, and  see how good they are. Until then, congratulations to the winners (for winning!) and the loosers (for trying). Cheers, guys.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-7089000479837949007?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/7089000479837949007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=7089000479837949007' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7089000479837949007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/7089000479837949007'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/05/i-did-not-win-android-developer.html' title='I did not win Android Developer Challenge but it&apos;s OK'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_Qfga8utotf4/SCTCNrmgs-I/AAAAAAAAAH4/_LFNX3yq8Gk/s72-c/monolithandroid.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-8523206518488588620</id><published>2008-04-14T07:27:00.000-07:00</published><updated>2008-04-14T13:04:56.273-07:00</updated><title type='text'>Android Developer Challenge Part One Ends Today</title><content type='html'>Today the first part of Android Developer Challenge (ADC) ends. Good luck to all the folks who submitted an application! So in a few days or weeks we should have a new version of the SDK released, because Google did not want to release another SDK release before ADC ended, not to further confuse developers. As a lone developer, I depend on a stable SDK and toolchain and I think that the next releases of the SDK will fix things without breaking existing stuff. As you may have noticed, I did not update MonolithAndroid for the m5 series SDK, because I got an error message that informed me that the functionality I intended to use is currently broken and will be fixed in a future version of the SDK. I decided to wait for the fix, because I didn't have the time to change my code. Also, out of laziness and being put down by the major SDK changes of m5 series, I did not add any of the originally planned functionality to MonolithAndroid. Now that ADC is over, I will take my time in developing this little baby project of mine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-8523206518488588620?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/8523206518488588620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=8523206518488588620' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8523206518488588620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/8523206518488588620'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/04/android-developer-challenge-part-one.html' title='Android Developer Challenge Part One Ends Today'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-5294177110312681171</id><published>2008-02-13T15:05:00.000-08:00</published><updated>2008-02-13T15:21:34.173-08:00</updated><title type='text'>The new SDK killed my app, well almost :-(</title><content type='html'>Finally the new Android SDK (named m5-rc14) is here! So I eagerly downloaded it. Well the good news is that now Android has a brand new UI, and some enhancements. The bad news is that monolithandroid refuses to work. Hmm... you might think, maybe with a little bit of tweaking here and there you are only a few lines of code away from your app working again. Well, that maybe the case for most android apps written with the previous SDK, but not with mine.&lt;br /&gt;Yes I have made the necessary changes to android.xml, and to various other xml files, and I even replaced a few method calls here and there, but the problem is that when I run my app in the emulator I get the following window.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Qfga8utotf4/R7N5_w2uzXI/AAAAAAAAAHo/EKp3r5n2zUs/s1600-h/sdk_hell_pt1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_Qfga8utotf4/R7N5_w2uzXI/AAAAAAAAAHo/EKp3r5n2zUs/s400/sdk_hell_pt1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5166607333877271922" /&gt;&lt;/a&gt;&lt;br /&gt;That means, my fellow androids, that without major code changes, my app is not going to work with the current version of the android SDK! For now, if you want to use OpenGL/ES you HAVE to use surface view! Ouch! So back to the drawing board! I hope that I will be able to update my code soon. But I shouldn't complain! That's the price that an early adopter has to pay...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-5294177110312681171?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/5294177110312681171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=5294177110312681171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5294177110312681171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/5294177110312681171'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/02/new-sdk-killed-my-app-well-almost.html' title='The new SDK killed my app, well almost :-('/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_Qfga8utotf4/R7N5_w2uzXI/AAAAAAAAAHo/EKp3r5n2zUs/s72-c/sdk_hell_pt1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-3812223663467601046</id><published>2008-02-13T09:29:00.000-08:00</published><updated>2008-02-13T09:41:42.504-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile world congress'/><category scheme='http://www.blogger.com/atom/ns#' term='sdk'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Waiting for the new android SDK</title><content type='html'>As some of you may have noticed I've put &lt;a href="http://code.google.com/p/monolithandroid/"&gt;monolithandroid&lt;/a&gt; development on hiatus. The reasons: Some personal mishaps (which include my broken elbow, my desktop computer dying of old age and increased workload in my dayjob). But the main reason is that I am waiting for the brand new release of the Android SDK. I hope that the new SDK will correct a few bugs and that an increased number of API's and documentation will become available (for example javax.sound.sampled and javax.sound midi). The new SDK will sport a new UI as I hear (designed by TAT?). In the meantime, in Barcelona, Mobile World Congress is taking place. I wish I was there because I hear that a few manufacturers are demoing android powered devices and the first reviews are really positive! But no sign of monolithandoid so far ;-). Hey guys, monolithandroid is free software, load it up to your devices, I want to see it running in real hardware!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-3812223663467601046?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/3812223663467601046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=3812223663467601046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3812223663467601046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/3812223663467601046'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/02/waiting-for-new-android-sdk.html' title='Waiting for the new android SDK'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1266163543407807150</id><published>2008-01-03T11:20:00.001-08:00</published><updated>2008-01-03T11:35:58.128-08:00</updated><title type='text'>Coding slows down when you have a fractured elbow.</title><content type='html'>Programming in the Android platform is very exciting. Unfortunately for me, it can be very slow, because from Saturday I have a fractured elbow. I went to the countryside to help my girl to handpick the olives from her olive trees. Where I live (that is Kalamata, Greece), everyone has at least one field planted with olive trees. And from November till February most folks are handpicking their olives. While I was at the field, I slipped and I unconsciously used my left arm (which is the one I use the most) to stop my fall. But in the process, I hit my elbow pretty hard. I went to the hospital and the X-Rays showed that I broke a bone near my elbow. So now my hand is tied and I can only move my fingers. The doctor said that my arm should remain tied for 15 days. So coding for MonolithAndroid will be slower. Arrgh!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1266163543407807150?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1266163543407807150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1266163543407807150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1266163543407807150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1266163543407807150'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/01/coding-slows-down-when-you-have.html' title='Coding slows down when you have a fractured elbow.'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-1221131332840194305</id><published>2008-01-02T11:11:00.000-08:00</published><updated>2008-01-16T11:11:41.396-08:00</updated><title type='text'>MonolithAndroid. Block game for the android platform.</title><content type='html'>It's been a while since I created this blog. The fact that I made no posts since October does not mean that I sat idle. On the contrary the end of 2007 has been very active programming-wise. I was experimenting with the SDL library, when I realized that it would be nice to build a game in order to learn a few things. Two weeks later, I had an SDL version of tetris, with the added bonus that the rendering was done using open GL. Some of the code for the tetris game came from a tetris version I created 4 years ago, during a hot Greek August for the Mobile Windows Platform (Written in Visual C++). Creating the SDL rewrite of the app was easy, and using openGL made possible the rotation of the playfield using the mouse. I added a crude explosion effect when the player completed lines, and I came up with a rough 3d font rendering routine. All in all a nice programming project (done with Visual Studio 2005).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_Qfga8utotf4/R3vkzcSRg7I/AAAAAAAAAG4/RBszmXxgZZs/s1600-h/sdlgltetris.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_Qfga8utotf4/R3vkzcSRg7I/AAAAAAAAAG4/RBszmXxgZZs/s400/sdlgltetris.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5150962171245593522" /&gt;&lt;/a&gt;&lt;br /&gt;In parallel, I was toying with the sony PSP (playstation portable). I was trying to install and learn the open source pspsdk. After several attempts, I had an almost working version on my laptop. The next step was: "Wouldn't be cool, if I ported the sdltetris game to the psp?" PSP supposedly has SDL support so that would be a breeze eh? Well no it wasn't because I couldn't make the pspSDK SDL library work properly. The OpenGL part was misconfigured, or I don't know what. So I decided to bite the bullet and rewrite the game using psp sdk calls. It was coded in c++ using the gcc compiler and notepad++ as the editor. That took almost two weeks and the result is monolithpsp found in here: &lt;a href="http://monolithpsp.googlecode.com"&gt;http://monolithpsp.googlecode.com&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;What's next? The launch of the Android platform, of course. Google launched the Android platform on November. When I read the first details, I decided to take a look at the Android SDK. After a few skimming on the API details, I saw that the platform supported OpenGL, so I decided to port my monolithpsp game to the Android Platform. I must confess that Android Developer Challenge gave me one additional reason to do so. So after a week of programming, the first version of the game became reality.(I am much more proficient in java than in C++ arghhh!). For more details, check this blog again. Oh and go check out&lt;br /&gt;&lt;a href="http://monolithandroid.googlecode.com"&gt;http://monolithandroid.googlecode.com&lt;/a&gt; for the monolith android game. See you soon!&lt;br /&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/lDlXcPT1JhA&amp;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/lDlXcPT1JhA&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-1221131332840194305?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/1221131332840194305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=1221131332840194305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1221131332840194305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/1221131332840194305'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2008/01/monolithandroid-block-game-for-android.html' title='MonolithAndroid. Block game for the android platform.'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_Qfga8utotf4/R3vkzcSRg7I/AAAAAAAAAG4/RBszmXxgZZs/s72-c/sdlgltetris.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6964266462542162002.post-2784044285560080583</id><published>2007-10-06T03:45:00.000-07:00</published><updated>2007-10-06T03:53:04.262-07:00</updated><title type='text'>About this blog</title><content type='html'>Hello world, or should I say&lt;br /&gt;&lt;code&gt;&lt;br /&gt;   printf("hello world!");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In this blog, I will be discussing past, present and future programming projects, I will be complaining about the state of IT in Greece and in general and hopefully I will present you some code for dissection and perusal. I warn you that this is not a C, C++ or java blog, or a Windows or Linux or whatever blog. I use whatever it takes to get the job done.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6964266462542162002-2784044285560080583?l=tkcodesharing.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tkcodesharing.blogspot.com/feeds/2784044285560080583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6964266462542162002&amp;postID=2784044285560080583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2784044285560080583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6964266462542162002/posts/default/2784044285560080583'/><link rel='alternate' type='text/html' href='http://tkcodesharing.blogspot.com/2007/10/about-this-blog.html' title='About this blog'/><author><name>Tasos Kleisas</name><uri>http://www.blogger.com/profile/09721654618703514774</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_Qfga8utotf4/SWju-YFTfRI/AAAAAAAAANA/_wIhDGBoBwc/S220/head.png'/></author><thr:total>0</thr:total></entry></feed>
