<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>soledad penadés &#187; eclipse</title>
	<atom:link href="http://soledadpenades.com/tag/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://soledadpenades.com</link>
	<description>repeat 4[fd 100 rt 90]</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:03:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Distro/desktop (s)hopping, part 3: Lubuntu</title>
		<link>http://soledadpenades.com/2011/11/02/distrodesktop-shopping-part-3-lubuntu/</link>
		<comments>http://soledadpenades.com/2011/11/02/distrodesktop-shopping-part-3-lubuntu/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 16:12:34 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[lubuntu]]></category>
		<category><![CDATA[lxde]]></category>
		<category><![CDATA[pcmanfm]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3795</guid>
		<description><![CDATA[As I&#8217;m now fully embarked on my experimental setup, today I tried to kill two birds with one stone and set up a virtualised Android development environment try out yet another distribution I did something similar a couple of days ago: I created a virtual machine, installed Arch Linux on it and assembled an &#8220;on [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m now fully embarked on my experimental setup, today I tried to kill two birds with one stone and</p>
<ol>
<li>set up a virtualised Android development environment</li>
<li>try out yet another distribution</li>
</ol>
<p>I did something similar a couple of days ago: I created a virtual machine, installed Arch Linux on it and assembled an &#8220;on demand&#8221; server with Nginx, Apache, MySQL and PHP. &#8220;On demand&#8221;, in this case, means &#8220;it&#8217;s started when I demand it to start&#8221;. It&#8217;s great because when I&#8217;m not using the computer for web development I don&#8217;t have any of these services running, plus they are completely isolated, so if I break something configuring them I don&#8217;t end up with an unusable system!<br />
<span id="more-3795"></span><br />
Encouraged by this success, I wanted to do the same with Android. The reason for using a virtual environment for Android development is that it wouldn&#8217;t &#8220;pollute&#8221; my main system with all the stuff that is needed for Android. Or in other words: the Android SDK, with the different platforms that can be used, plus the Java SDK/JRE (I don&#8217;t use Java for anything else), udev rules for mounting phones and other devices, Eclipse and/or IntelliJ IDEA, and environment variables for $JDK_PATH, etc.</p>
<p>Since the recommended distribution for Android is Ubuntu (i.e. it&#8217;s the one the official tools are tested with) I thought I would create a virtual instance of Lubuntu, which is based on LXDE, a very lightweight environment that looked like the perfect candidate to run in a virtual system.</p>
<p>However I found a huge blocker for my purposes, and several other glitches :-(</p>
<p>The <strong>huge blocker</strong> is that I have failed to configure my physical device for deploying directly to the phone from within VirtualBox. I installed the extra packages for VirtualBox in order to use USB2.0, added the filter for my phone, also added a &#8220;magic line&#8221; to /etc/fstab (in the host), and created udev rules both in the host and in the guest&#8230; but still keep getting the dreaded
<div class="syhi_block"><code>?????? Insuficient permissions</code></div>
<p> error message. Not to tell you about the number of times I attempted reloading udev rules, logging in and out, restarting in desperation&#8230; Meh!</p>
<p>On the distro test side: Lubuntu looks quite nice and lightweight, although it&#8217;s got a good share of visual oddities. For example, the installation system uses one of those mouse cursors in which the arrow points to the right instead of to the left as we&#8217;re used to.</p>
<p><img src="/imgs/2011/lubuntu.jpg" alt="Lubuntu" /></p>
<p>Once the installation finishes, a relatively familiar environment shows up. It looks like good old GNOME 2, but somehow leaner. For example, there&#8217;s only one panel, and they use Chromium instead of Firefox, and Abiword instead of LibreOffice&#8217;s Writer. Also, as with GNOME 2, odd things happen from time to time, such as when the icons decide to change themselves spontaneously to another theme, and that sort of stuff that leaves you wondering: <q>wasn&#8217;t that icon black a second ago? why is it red now?</q></p>
<p>Unfortunately it also lacks some polish that we take for granted in GNOME 2. For example, the menus have to be edited by manually creating and editing files in ~/.local/applications if I remember correctly, as there isn&#8217;t any menu editor GUI. Not a huge problem for me, but definitely not something you&#8217;ll be telling a non tech-savvy friend to do. Arranging items in the panels is also clunky: you have to edit the panel and move things around by selecting them first then clicking &#8220;up&#8221; and &#8220;down&#8221; buttons in order to rearrange them.</p>
<p>But the worst glitch I found was with the file manager, <a href="http://pcmanfm.sourceforge.net/">PCManFM</a>. I actually had experienced it before with another ArchLinux install, but I thought that had been due to a bad configuration on my side. Turns out that if you open a compressed file with file-roller (as happens when double clicking any compressed file), and then try to drag anything from the compressed file to a location in PCManFM, you get an error like follows:</p>
<p><img src="/imgs/2011/pcmanfm_error.png" alt="PCManFM error" /><br />
<small>Extraction not performed: You don&#8217;t have the right permissions to extract archives in the folder &#8220;&#8221;</small></p>
<p>And that&#8217;s it. You can&#8217;t close the dialog, as none of the buttons are responsive. You can&#8217;t close it with CTRL+W either. You can&#8217;t switch to another window. Maybe you could log in with ssh from another computer and try to kill the pcmanfm process, <em>if</em> you enabled ssh before. What you&#8217;ll probably do is reset the computer/instance, anyway. Not nice if you hadn&#8217;t saved your work.</p>
<p>Conclusion: I won&#8217;t be installing, or advising the installation of, Lubuntu on relatively underpowered computers, as the defaults seem &#8220;slightly&#8221; buggy :-P</p>
<p>Now I&#8217;ve got to install the Android SDK and company on Arch, but it shouldn&#8217;t be too hard anyway. Of course, if you know how to deploy to physical devices from a VirtualBox environment, please let me know before I completely nuke that virtual machine! :-D</p>
<p>~~~</p>
<p>Previously on this saga: <a href="http://soledadpenades.com/2011/10/23/distrodesktop-shopping-part-2-xfce/">XFCE</a>.</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3795&amp;md5=962026af8be474890dde7d830164f62c" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2011/11/02/distrodesktop-shopping-part-3-lubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android&#8217;s activity stack and pressing HOME</title>
		<link>http://soledadpenades.com/2011/06/14/androids-activity-stack-and-pressing-home/</link>
		<comments>http://soledadpenades.com/2011/06/14/androids-activity-stack-and-pressing-home/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 10:53:21 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[stack overflow]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=3545</guid>
		<description><![CDATA[I was having a huge issue with the application I&#8217;m working on. The idea is to have a MainActivity and a GameActivity; when you&#8217;re in MainActivity and click on a certain button, you get GameActivity. So far so good. The problem was that if I pressed HOME and then clicked again on the application launcher, [...]]]></description>
			<content:encoded><![CDATA[<p>I was having a huge issue with the application I&#8217;m working on. The idea is to have a <em>MainActivity</em> and a <em>GameActivity</em>; when you&#8217;re in <em>MainActivity</em> and click on a certain button, you get <em>GameActivity</em>. So far so good.</p>
<p>The problem was that if I pressed <em>HOME</em> and then clicked again on the application launcher, I was brought to the <em>MainActivity</em> instead of <em>GameActivity</em>. The expected behaviour by default in Android would be to return to <em>GameActivity</em>, which was the top activity in the application&#8217;s activity stack. So why wasn&#8217;t this working?</p>
<p>After looking for hours and reading in detail everything in the documentation regarding the <a href="http://developer.android.com/guide/topics/manifest/activity-element.html">activity</a> section in the AndroidManifest.xml and <a href="http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html">tasks stack</a>, I decided to dare ask my first ever Stack Overflow <a href="http://stackoverflow.com/questions/6337217/how-to-return-to-the-latest-launched-activity-when-re-launching-application-after">question</a>, and went to sleep.</p>
<p>This morning, I found that two people had answered the question already. Yay! Unfortunately their answers were <strong>only tangentially related</strong> to my question. It&#8217;s amazing how complicated human language is: you ask something, people answer what they understand&#8211;and it might be completely different to what you meant to answer. </p>
<p>But I had earned an <strong>student badge</strong> and five points thanks to asking a question! Yay! Awesome! My reputation had increased to SIX points! Woooo!</p>
<p>Encouraged by this marvelous self-achievement, I decided to further pursue my quest for a proper answer, and I began to examine the list of questions related to my question. Lucky as I was, there was a particular <a href="http://stackoverflow.com/questions/2280361/app-always-starts-fresh-from-root-activity-instead-of-resuming-background-state">one</a> that answered mine!</p>
<p>So I have ended up answering my first ever Stack Overflow question, but I can&#8217;t accept my own answer yet. Booh!</p>
<p>However since this is <em>my</em> blog I&#8217;ll write my answer here and you&#8217;ll have to believe it&#8217;s the right one. So there we go.</p>
<h3>And the Answer is&#8230;</h3>
<p>I was launching the app by using IntelliJ, and it seems it launches the application in a different way than a user, clicking a home screen widget, would launch. It&#8217;s explained in the answer to another Stack Overflow <a href="http://stackoverflow.com/questions/2280361/app-always-starts-fresh-from-root-activity-instead-of-resuming-background-state">question</a>:</p>
<blockquote><p>This is due to the intents being used to start the app being different. Eclipse starts an app using an intent with no action and no category. The Launcher starts an app using an intent with android.intent.action.MAIN action and android.intent.category.LAUNCHER category. The installer starts an app with the android.intent.action.MAIN action and no category.</p></blockquote>
<p>So I&#8217;ve manually killed the application in the phone, and relaunched it again from the home screen widget. Then opened the GameActivity, and pressed HOME. Now, when relaunching it the GameActivity is still visible and keeping its UI state as it was when I left it.</p>
<p>And I guess that the reason why a new instance of the activity was created when pressing the shortcut before was due to a different Intent being used for starting the activity.</p>
<blockquote><p>In other words: when things go awry with your activities, make sure you kill your application and start anew, launching it from the phone and not from your favourite development environment.</p></blockquote>
<p>Now, I&#8217;m back to the code! \o/</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=3545&amp;md5=161bd730660c58050be17a7fe767e9ea" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2011/06/14/androids-activity-stack-and-pressing-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2012 (Eclipse Helios remix)</title>
		<link>http://soledadpenades.com/2010/07/11/2012-eclipse-helios-remix/</link>
		<comments>http://soledadpenades.com/2010/07/11/2012-eclipse-helios-remix/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 21:56:37 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Silly stuff]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=2740</guid>
		<description><![CDATA[That said, it happened after a system crash, so Eclipse hadn&#8217;t been shut properly. And after killing Eclipse (because it wouldn&#8217;t stop popping up error windows) and reopening it again, it seems the evil goblin of mass destruction and agony had gone away. Thankfully an outline wasn&#8217;t available!]]></description>
			<content:encoded><![CDATA[<p><img src="/imgs/2010/catastrofe.png" alt="2012 (Eclipse Helios remix)" /></p>
<p>That said, it happened after a system crash, so Eclipse hadn&#8217;t been shut <em>properly</em>. And after killing Eclipse (because it wouldn&#8217;t stop popping up error windows) and reopening it again, it seems the evil goblin of mass destruction and agony had gone away.</p>
<p>Thankfully an outline wasn&#8217;t available!</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=2740&amp;md5=b678428fd2f51581702c224b954a42e2" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2010/07/11/2012-eclipse-helios-remix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diff&#8217;ing with RapidSVN</title>
		<link>http://soledadpenades.com/2010/06/29/diffing-with-rapidsvn/</link>
		<comments>http://soledadpenades.com/2010/06/29/diffing-with-rapidsvn/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 11:29:38 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[meld]]></category>
		<category><![CDATA[rapidsvn]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=2695</guid>
		<description><![CDATA[I thought I had to enter &#8220;diff&#8221; in the diff tool field, but I was wrong: it didn&#8217;t work. Apparently RapidSVN expects a graphical application instead of a text-mode application that runs on a terminal. But fear not! There&#8217;s an application for this. It&#8217;s called meld. So&#8230; sudo apt-get install meld And in RapidSVN &#8594; [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I had to enter &#8220;diff&#8221; in the diff tool field, but I was wrong: it didn&#8217;t work. Apparently <a href="http://www.rapidsvn.org/">RapidSVN</a> expects a graphical application instead of a text-mode application that runs on a terminal.</p>
<p>But fear not! There&#8217;s an application for this. It&#8217;s called <a href="http://meld.sourceforge.net/">meld</a>.</p>
<p>So&#8230;</p>
<div class="syhi_block"><code><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> meld</code></div>
<p>And in <em>RapidSVN &rarr; Preferences &rarr; Programs &rarr; Diff Tool</em> simply enter <strong>meld</strong>. Now you should be able to right click a file and select the <em>Diff&#8230;</em> flavour you prefer (to Base, to HEAD or to something else), and get the diff between the versions!</p>
<p>You might remember I always say I tend to use the command line for dealing with SVN, but sometimes I feel lazy (specially when dealing with many files at the same time), and RapidSVN is very handy to get a quick overview of what&#8217;s changed. Besides, it doesn&#8217;t break randomly like Subclipse/Subversive whenever Eclipse is updated, and can be used outside Eclipse, for non-Eclipse projects. Thanks to <a href="http://mrdoob.com">mrdoob</a> for the cool app recommendation :)</p>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=2695&amp;md5=f59b88ab6d138ef092dccd5ceabd719b" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2010/06/29/diffing-with-rapidsvn/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>&#8220;is the CPU pegged?&#8221;, and friends</title>
		<link>http://soledadpenades.com/2009/08/25/is-the-cpu-pegged-and-friends/</link>
		<comments>http://soledadpenades.com/2009/08/25/is-the-cpu-pegged-and-friends/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 22:35:46 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[audiotrack]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[logcat]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=1296</guid>
		<description><![CDATA[Lessons I learnt today is the CPU pegged? When is the CPU pegged? message shows up in the LogCat console tab, it means you are not filling in quickly enough the audio buffer for an AudioTrack. Or that it seems so. I happened to locate where the message is in Android&#8217;s source code, but since [...]]]></description>
			<content:encoded><![CDATA[<h3>Lessons I learnt today</h3>
<h4>is the CPU pegged?</h4>
<p>When <q>is the CPU pegged?</q> message shows up in the LogCat console tab, it means you are not filling in quickly enough the audio buffer for an AudioTrack. Or that it seems so. I happened to locate where the message is in <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/libmedia/AudioTrack.cpp;h=b2c067b1290fc19a4c1719a4ce7cfe49cdbdcf8f;hb=HEAD#l616">Android&#8217;s source code</a>, but since I am not familiar at all with it, I am just doing a quick guess which was pseudo-confirmed when the messages stopped as soon as I began refilling quicker the audio buffer.</p>
<h4>Thread.stop is deprecated &#8211; and it will be ignored!</h4>
<p>Docs say:</p>
<blockquote><p>This method is deprecated. because stopping a thread in this manner is unsafe and can leave your application and the VM in an unpredictable state.</p></blockquote>
<p>As to why is that deprecated on the basis that using it can cause stability issues, I am afraid I can&#8217;t elucidate the answer yet.</p>
<p>I am using an strange solution where I add a method called doStop to the class that extends Thread, with the intention that it sets an internal boolean bar (mIsRunning) to false in that case, and returns from its <strong>run</strong> method as soon as mIsRunning is false. The reason why I am using this is because I saw that in an SDK tutorial, but still feels a bit strange.</p>
<p>Incidentally I also took the opportunity to refresh my mind regarding <a href="http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html">Java threads</a>, which had been much forgotten.</p>
<h4>Sometimes LogCat stops reporting messages</h4>
<p>Close and reopen the emulator and Eclipse and it will be sorted out.</p>
<h3>Things I still need to investigate</h3>
<ul>
<li><strong>Need to find out a better way to determine if a buffer needs audio data</strong>. I am missing some kind of callback, SDL style. Currently I am just pushing audio data using a thread which sleeps for a certain amount of time, but I sometimes get <q>AudioFlinger &#8211; write blocked for xxx ms</q> messages if the buffer is not sufficiently empty</li>
<li><strong>What&#8217;s more efficient and in which cases</strong>, regarding the use of integers, shorts, floats&#8230; I am using a LookUpTable for storing precalculated Math.sin values but I am unsure if I am optimizing too early&#8230;</li>
<li><strong>Would love to find more AudioTrack examples and documentation</strong>. There&#8217;s an impressive scarcity of resources about AudioTrack while there&#8217;s a <em>cornucopia</em> of samples for MediaPlayer, JetPlayer and etc. AudioTrack must be feeling discriminated: there is not even an AudioTrack sample program in the official SDK samples!</li>
</ul>
<p><em>Edit: added the link to Java Threads tutorial which I forgot to add.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2009/08/25/is-the-cpu-pegged-and-friends/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

