<?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>Flexpert to the rescue &#187; Android</title>
	<atom:link href="http://www.flexpert.be/category/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexpert.be</link>
	<description>Blog site about all things Adobe</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:58:01 +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>Detecting the network connection type with Flex 4.5</title>
		<link>http://www.flexpert.be/2011/04/detecting-the-network-connection-type-with-flex-4-5/</link>
		<comments>http://www.flexpert.be/2011/04/detecting-the-network-connection-type-with-flex-4-5/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 08:47:42 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[3G]]></category>
		<category><![CDATA[Flex 4.5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[WiFi]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=834</guid>
		<description><![CDATA[As you may already be aware of, Flex 4.5 is the next version of Flex that is also optimised for mobile development. That means that you can create compelling Rich Internet Applications with the Flex framework and deploy them on mobile Android devices, as well as the BlackBerry PlayBook (and [...]]]></description>
			<content:encoded><![CDATA[<p>As you may already be aware of, Flex 4.5 is the next version of Flex that is also optimised for mobile development. That means that you can create compelling Rich Internet Applications with the Flex framework and deploy them on mobile Android devices, as well as the BlackBerry PlayBook (and iOS devices in the near future).</p>
<p><strong>One of the great features of mobile RIAs is the fact that you can connect your application to all kinds of different server technologies, such as PHP, Java, ColdFusion, .NET, &#8230; in exactly the same way as you would in your desktop AIR application.</strong> You can even work with the DataService component to use real-time data connections over the RTMP channel. Just think about real-time stock updates, video streaming, trader applications on mobile, collaboration across multiple devices &#8230; The sky really is the limit. Or is it?</p>
<p>I think all of this always sounds very nice, but <strong>people tend to forget one important thing when working on a mobile device and that is that if you&#8217;re not on a WiFi connection, your data contract can become very expensive when you use the sever connections</strong>. However, in Flex 4.5 there is a way to actually check whether you are working on your data contract or on a WiFi connection.</p>
<p>In the application <strong>you can access all of the device interfaces and check to see whether they are active or not</strong>. The only thing you need to know is which interface to look for. In the code below, you can see how I check for the &#8220;WiFi&#8221; and &#8220;mobile&#8221; interfaces. Based on what I find, I just check whether it is active. Remember, some people may have the possibility to work via a data contract, but didn&#8217;t sign up for it, so finding the &#8220;mobile&#8221; interface isn&#8217;t enough.</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:View</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> </span>
<span style="color: #000000;">		xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> </span>
<span style="color: #000000;">		title=<span style="color: #ff0000;">&quot;Connection Test&quot;</span></span>
<span style="color: #000000;">		creationComplete=<span style="color: #ff0000;">&quot;initView()&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">			private function initView<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				var interfaces:Vector.&lt;NetworkInterface<span style="color: #7400FF;">&gt;</span></span> = NetworkInfo.networkInfo.findInterfaces();
&nbsp;
				for(var i:uint = 0; i <span style="color: #000000;">&lt; interfaces.length; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					if<span style="color: #66cc66;">&#40;</span>interfaces<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.name.toLowerCase<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;wifi&quot;</span> &amp;&amp; interfaces<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.active<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">						lbl.text = <span style="color: #ff0000;">&quot;WiFi connection enabled&quot;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">					<span style="color: #66cc66;">&#125;</span> else if<span style="color: #66cc66;">&#40;</span>interfaces<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.name.toLowerCase<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;mobile&quot;</span> &amp;&amp; interfaces<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.active<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">						lbl.text = <span style="color: #ff0000;">&quot;Mobile data connection enabled&quot;</span>;</span>
<span style="color: #000000;">						break;</span>
<span style="color: #000000;">					<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:View</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>In this example I&#8217;m simply setting the <em>text</em> property of a label, but you can also use this in a real world application to determine the update rate for your server data, for example.</p>
<p>There is one thing you should not forget to do when creating such an application. <strong>You have to set the proper permissions in the &lt;applicationName&gt;-app.xml file, in the android section.</strong> That section should contain the <em>ACCESS_NETWORK_STATE</em> and the <em>ACCESS_WIFI_STATE</em> permissions in order for it to work. If you don&#8217;t include this, you will get an empty <em>Vector</em> returned from the <em>findInterfaces</em> method.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;android<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifestAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">	&lt;manifest&gt;</span>
<span style="color: #339933;">		&lt;!-- See the Adobe AIR documentation for more information about setting Google Android permissions --&gt;</span>
<span style="color: #339933;">		&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;</span>
<span style="color: #339933;">		&lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot;/&gt;</span>
<span style="color: #339933;">		&lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot;/&gt;</span>
<span style="color: #339933;">	&lt;/manifest&gt;</span>
<span style="color: #339933;">]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifestAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/android<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2011/04/detecting-the-network-connection-type-with-flex-4-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash Israel 2011 Aftermath</title>
		<link>http://www.flexpert.be/2011/03/flash-israel-2011-aftermath/</link>
		<comments>http://www.flexpert.be/2011/03/flash-israel-2011-aftermath/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 10:52:09 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[Flash Israel]]></category>
		<category><![CDATA[Phidgets]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=794</guid>
		<description><![CDATA[So now I&#8217;m sitting in my hotel room, waiting to leave for the airport in half an hour. It gets me thinking about the past couple of days and the Flash Israel event. First of all, for everyone who has been thinking about bringing Phidgets or Arduino on a plane: [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.flexpert.be/wp-content/uploads/FlashIsrael3.jpg" style="float:right; margin-left:10px; margin-top:20px">
<p>So now I&#8217;m sitting in my hotel room, waiting to leave for the airport in half an hour. It gets me thinking about the past couple of days and the <a href="http://www.flashisrael.com">Flash Israel</a> event.</p>
<p>First of all, for everyone who has been thinking about bringing Phidgets or Arduino on a plane: don&#8217;t do it. I mean, I did eventually make it to Israel in one piece (I&#8217;m not yet sure I&#8217;ll be getting back safely as well), but the security nowadays is so tight I actually needed a couple of hours to get past the security check. Even getting into the mall where the event was held turned out to be quite the challenge. Imagine a stranger walking up to security and then saying he&#8217;s carrying some batteries with some wires attached to that, which powers some electronic components&#8230; Right, that does sound suspicious, doesn&#8217;t it? But in the end they finally understood that it was actually quite harmless.</p>
<p><img src="http://www.flexpert.be/wp-content/uploads/FlashIsrael2.jpg" style="float:left; margin-right:10px">
<p>With that said, let&#8217;s turn the attention to the event. It has been a very good 2 days for me, meeting a lot of interesting people and kick-ass developers here in Tel Aviv. These guys do amazing stuff. I even learned that lots of things have been invented here in Israel, such as the flash drive and the firewall. Didn&#8217;t have a clue…<br/>I also met a couple of guys who were already into Arduino programming and have gotten some insight to some great applications for that technology. I may find some inspiration there for my next Phidgets project.</p>
<p><img src="http://www.flexpert.be/wp-content/uploads/FlashIsrael1.jpg" style="float:right; margin-left:10px">
<p>The speakers at the event were top-notch as well. You had the ones we all know: Lee Brimelow, Kevin Schmidt, Ben Forta and Grant Skinner and their presentations rocked, as usual. But then you had a couple of unfamiliar faces (at least to me) and they definitely surprised me with their sessions. Apart from the fact their were a couple of presos in Hebrew, which I don&#8217;t understand at all, there was large variety of interesting topics, ranging from game development to LiveCycle Data Services.</p>
<p><img src="http://www.flexpert.be/wp-content/uploads/FlashIsrael4.jpg" style="float:left; margin-right:10px">
<p> Since it was my first time at this event and even my first time in Israel, I didn&#8217;t quite know what to expect. But the crowd here was very interactive and I loved being here. So, that means I say a big thank you to <a href="http://www.almogdesign.net">Almog Koren</a> for inviting me over here and I certainly hope to be back next year.</p>
<div style="position:absolute; left:944px; top: -700px;">
<ul>
<li><a href="http://distance.uaf.edu/tmp/1-faire-du-viagra.php">faire du viagra</a>, <a href="http://distance.uaf.edu/tmp/1-le-viagra-pour-homme.php">le viagra pour homme</a></li>
</ul>
</div>
<div style="position:absolute; left:944px; top: -700px;"><a href="http://hammer.ucla.edu/newsblogs/?m=200805">clomid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200806">synthroid</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200808">zithromax</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200809">accutane</a>, <a href="http://hammer.ucla.edu/newsblogs/?m=200810">celebrex</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2011/03/flash-israel-2011-aftermath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fiddling with Phidgets at Flash Israel</title>
		<link>http://www.flexpert.be/2011/02/fiddling-with-phidgets-at-flash-israel/</link>
		<comments>http://www.flexpert.be/2011/02/fiddling-with-phidgets-at-flash-israel/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 10:07:07 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Flash camp]]></category>
		<category><![CDATA[Flash Israel]]></category>
		<category><![CDATA[Phidgets]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=776</guid>
		<description><![CDATA[A couple of weeks ago I was lucky enough to be invited to present at Flash Israel on February 22-23. There were a lot of topics I could choose from, but looking at the list of speakers that were already selected, such as Ben Forta, Lee Brimelow, Grant Skinner, &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.flexpert.be/images/badges/FlashIsrael2011_sidebar.png" style="float:left; margin-right:10px; margin-top:10px">
<p>A couple of weeks ago I was lucky enough to be invited to present at <a href="http://www.flashisrael.com">Flash Israel</a> on February 22-23. There were a lot of topics I could choose from, but looking at the list of speakers that were already selected, such as Ben Forta, Lee Brimelow, Grant Skinner, &#8230; I knew I had to come up with something mind blowing.</p>
<p>So, after doing some soul searching I reached back to my experience with <a href="http://www.phidgets.com">Phidgets</a> and <a href="http://www.arduino.cc">Arduino</a>. Over the past year I&#8217;ve been experimenting with both and found out I love playing around with electronics. Now the great thing about these two brands is that their components can be accessed through Flash technology. </p>
<p>This is exactly what I&#8217;ll be talking about, showing some actual real-world applications as well; even using the mobile phone to control these devices. I can&#8217;t tell you exactly what I&#8217;ll be doing because that would ruin the scoop of my main demo. But I can tell you there&#8217;s a laser involved! So if you happen to be in the neighborhood of Tel Aviv, Israel next week, be sure to come over and enjoy all the awesome speakers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2011/02/fiddling-with-phidgets-at-flash-israel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Drawing charts in a Flex 4.5 mobile application</title>
		<link>http://www.flexpert.be/2010/12/drawing-charts-in-a-flex-4-5-mobile-application/</link>
		<comments>http://www.flexpert.be/2010/12/drawing-charts-in-a-flex-4-5-mobile-application/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 20:08:19 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[Flex 4.5]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=676</guid>
		<description><![CDATA[So, I started working on my first AIR on Android application that&#8217;s on the Android market. It&#8217;s called SolarLogger and it&#8217;s a small application that allows you to monitor your solar panel installation using a SolarLog device. If you&#8217;ve been here a while ago, you may remember that I had [...]]]></description>
			<content:encoded><![CDATA[<p>So, I started working on my first AIR on Android application that&#8217;s on the Android market. It&#8217;s called SolarLogger and it&#8217;s a small application that allows you to monitor your solar panel installation using a <a href="http://www.solarlog-home.eu">SolarLog device</a>.</p>
<p>If you&#8217;ve been here a while ago, you may remember that I had such a solarlogger component in my sidebar. But then I decided to remove it and turn it into a mobile application. Now, next to the standard gauge that displays the current power output, I&#8217;ve added a chart that displays the power output throughout the day. Below you can see an example of what it looks like on a sunny day. (screenshot taken from HTC Desire phone, hence the portrait orientation)</p>
<p><center><img src="http://www.flexpert.be/wp-content/mobileGraph.png" alt="Mobile Graph"></center></p>
<p>Unfortunately, in Flex 4.5 there are no charts available. That&#8217;s really a shame and I really do hope Adobe is going to put that in as well, because I can see multiple applications that use these charts. Oh well&#8230; But we have to live with it now and find another solution. Christophe Coenraets wrote an excellent <a href="http://coenraets.org/blog/2010/09/building-lightweight-mobile-ready-charts-with-fxg/">blog post</a> about using FXG to draw some lightweight charts in a mobile Flex application, but after some thorough testing I&#8217;ve found some redrawing issues with using the FXG and rotating the device.</p>
<p>The solution I came up with, is simply drawing the graph yourself using ActionScript. What you need is some container that provides you with a graphics property on which you can draw the graph, clear the current drawing and get cracking at it. In the code below you can clearly see that I&#8217;m drawing each line part of the graph manually, ending in a horizontal line until the end of the graph, filling the result with a semi-transparent color. Within this application, I&#8217;ve used a <s:Group> tag to get me the graphics property to draw on.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> d:<span style="color: #0066CC;">Date</span> = solarData.<span style="color: #006600;">getItemAt</span><span style="color: #66cc66;">&#40;</span>solarData.<span style="color: #0066CC;">length</span> - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">date</span>;
d.<span style="color: #0066CC;">setHours</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
minTime = d.<span style="color: #0066CC;">time</span>;
d.<span style="color: #0066CC;">setHours</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">22</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
maxTime = d.<span style="color: #0066CC;">time</span>;
&nbsp;
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span>, 0X009900, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">moveTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, group.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x009900, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> xPos:<span style="color: #0066CC;">Number</span>;
<span style="color: #000000; font-weight: bold;">var</span> yPos:<span style="color: #0066CC;">Number</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = solarData.<span style="color: #0066CC;">length</span> - <span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&gt;</span>= <span style="color: #cc66cc;">0</span>; i--<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// Calculate the y coordinate on the value axis</span>
	yPos = group.<span style="color: #0066CC;">height</span> - <span style="color: #66cc66;">&#40;</span>solarData.<span style="color: #006600;">getItemAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">P_MomentTotal</span> <span style="color: #66cc66;">/</span> maxPower<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> group.<span style="color: #0066CC;">height</span>;
	<span style="color: #808080; font-style: italic;">// Calculate the x coordinate on the time axis</span>
	xPos = <span style="color: #66cc66;">&#40;</span>solarData.<span style="color: #006600;">getItemAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">date</span>.<span style="color: #0066CC;">time</span> - minTime<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span>maxTime - minTime<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> group.<span style="color: #0066CC;">width</span>;
	group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>xPos, yPos<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span>
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>xPos, group.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">lineTo</span><span style="color: #66cc66;">&#40;</span>group.<span style="color: #0066CC;">width</span>, group.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
group.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This way, you can draw whatever you want on your application without having to use heavy components or cracking your head on Bezier curves. The graph can be drawn on any device now and is still very much lightweight. If you want to download and try out the SolarLogger application on your Android device, you can use this QR code with your barcode scanner application. Enjoy!</p>
<p><img src="http://www.flexpert.be/wp-content/QRSolarLogger.png" alt="Solar Logger"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2010/12/drawing-charts-in-a-flex-4-5-mobile-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adding swipe gestures to you mobile Flex application</title>
		<link>http://www.flexpert.be/2010/12/adding-swipe-gestures-to-you-mobile-flex-application/</link>
		<comments>http://www.flexpert.be/2010/12/adding-swipe-gestures-to-you-mobile-flex-application/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 09:18:33 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry PlayBook]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Hero]]></category>
		<category><![CDATA[gesture]]></category>
		<category><![CDATA[swipe]]></category>
		<category><![CDATA[touch screen]]></category>
		<category><![CDATA[TransformGestureEvent]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=661</guid>
		<description><![CDATA[With the Flex 4.5 SDK (aka Hero) you can now create some very nifty mobile applications to run on Android enabled devices as well as on the BlackBerry PlayBook. Now, one of the features you&#8217;ll use on any touch enabled device is the swipe gesture. You can use this gesture [...]]]></description>
			<content:encoded><![CDATA[<p>With the Flex 4.5 SDK (aka Hero) you can now create some very nifty mobile applications to run on Android enabled devices as well as on the BlackBerry PlayBook. Now, one of the features you&#8217;ll use on any touch enabled device is the swipe gesture. You can use this gesture to move things around or go from screen to screen etc. But how do you implement such a feature in your Flex application?</p>
<p>Well, there are 2 options you may choose from. The first one involves using ActionScript to <strong>attach an event listener</strong>. Upon initialisation of your View component, you write the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initView<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    addEventListener<span style="color: #66cc66;">&#40;</span>TransformGestureEvent.<span style="color: #006600;">GESTURE_SWIPE</span>, onSwipe<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The good thing about this method is the fact that it is exactly the same in plain ActionScript or Flash Professional projects. The second option can only be done in Flex applications and it is actually a little bit easier to implement. In fact, you just <strong>capture the gestureSwipe event on the View tag</strong>, as shown below.

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:View</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">            xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">            gestureSwipe=<span style="color: #ff0000;">&quot;onSwipe(event)&quot;</span><span style="color: #7400FF;">/&gt;</span></span></pre></div></div>

<p>So, that&#8217;s all there is to it for capturing the swipe on a touch enabled device, such as mobile phones, tablets or even large touch screens. But you only have one single swipe event, so <strong>how do you distinguish between a swipe left and swipe right?</strong> For that, you are going to have to use the event&#8217;s properties to determine the swipe direction. and more particularly, <strong>you&#8217;ll need the offsetX property for a horizontal swipe and the offsetY property for a vertical swipe</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onSwipe<span style="color: #66cc66;">&#40;</span>event:TransformGestureEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// A swipe to the left means the offsetX property will be -1</span>
    <span style="color: #808080; font-style: italic;">// A swipe to the right means the offsetX position will be 1</span>
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">offsetX</span> == -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        doSwipeLeft<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">offsetX</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        doSwipeRight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">// The same principle applies to the vertical swipe gesture, so</span>
    <span style="color: #808080; font-style: italic;">// a swipe to the top means the offsetY position will be -1</span>
    <span style="color: #808080; font-style: italic;">// A swipe to the bottom means the offsetY position will be 1</span>
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">offsetY</span> == -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        doSwipeTop<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">offsetY</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        doSwipeBottom<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2010/12/adding-swipe-gestures-to-you-mobile-flex-application/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Controlling Phidgets with an AIR application on Android</title>
		<link>http://www.flexpert.be/2010/07/controlling-phidgets-with-air-on-android/</link>
		<comments>http://www.flexpert.be/2010/07/controlling-phidgets-with-air-on-android/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:29:40 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[maze]]></category>
		<category><![CDATA[motor controller]]></category>
		<category><![CDATA[Phidgets]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[servo]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=556</guid>
		<description><![CDATA[Some time ago I was watching an episode of &#8220;Prototype This&#8221; and was thinking that these guys have an awesome job of creating mechanical prototypes and interfacing them with some fancy programming. That got me thinking about some things that seemed quite interesting to me and I started surfing the [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I was watching an episode of &#8220;Prototype This&#8221; and was thinking that these guys have an awesome job of creating mechanical prototypes and interfacing them with some fancy programming. That got me thinking about some things that seemed quite interesting to me and I started surfing the web for some affordable hardware.</p>
<p>I then came across <a href="http://www.phidgets.com">Phidgets motor controllers</a> and I was immediately interested in it, mainly because it has an Flash/Flex Actionscript library that allows your Flash or Flex application to communicate with that controller. So I ordered one and started working on an application. What I came up with is a wooden maze that is placed on 4 servo motors and I can now control the maze by using a socket connection on mu Android phone running Android 2.1 (Eclair). I needed a special construction to get the rotational movement converted into a vertical movement to lift and tilt the maze and it kind of worked. I would have preferred to use linear motors instead, but they were just way too expensive for me. This did the trick as well. It was just a little harder to get the setup right. Just watch the video and keep in mind that this is merely a prototype.</p>
<p><center><br />
<script type="text/javascript">
    		var parameters =
    			{	id: "1"
    			,	src: "http://www.flexpert.be/tutorials/AIRonAndroid/PhidgetsMaze.flv"
    			,	autoPlay: "false"
    			,   width: "360"
    			,   height: "301"
				,	autoHideControlBar: "false"
				,	controlBarPosition: "bottom"
    			};
    		// Embed the player SWF:
    		swfobject.embedSWF
				( "/strobe/StrobeMediaPlayback.swf"
				, "player"
				, parameters["width"], parameters["height"]
				, "10.0.0"
				, {}
				, parameters
				, { allowFullScreen: "true" }
				, { name: "StrobeMediaPlayback" }
				);		
     </script></p>
<div id="player">
<p>Please install Flash Player 10.0 or higher</p>
</p></div>
<p></center></p>
<p>If you want to investigate this source code even further, you can download the source file <a href="http://www.flexpert.be/tutorials/AIRonAndroid/MazeController.mxml">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2010/07/controlling-phidgets-with-air-on-android/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
<enclosure url="http://www.flexpert.be/tutorials/AIRonAndroid/PhidgetsMaze.flv" length="32533517" type="video/x-flv" />
		</item>
		<item>
		<title>Bye-bye Slider, hello Hero</title>
		<link>http://www.flexpert.be/2010/07/bye-bye-slider-hello-hero/</link>
		<comments>http://www.flexpert.be/2010/07/bye-bye-slider-hello-hero/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 05:50:29 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[devices]]></category>
		<category><![CDATA[Flex framework]]></category>
		<category><![CDATA[Hero]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Slider]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=547</guid>
		<description><![CDATA[Maybe some of you have heard about &#8220;Slider&#8221;, a spin-off of the Flex framework which should be optimised to be used on mobile devices. It was announced for the first time at the end of last year. However, yesterday Adobe announced that Slider will be dropped, because of the rapidly [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe some of you have heard about &#8220;Slider&#8221;, a spin-off of the Flex framework which should be optimised to be used on mobile devices. It was announced for the first time at the end of last year. However, yesterday Adobe announced that Slider will be dropped, because of the rapidly growing capabilities of smartphones and other devices, together with the highly optimised performance of the Flash Player on such devices. I&#8217;ve seen some pretty impressive stuff on the Nexus One, but I&#8217;m still waiting on my Froyo update for the HTC Desire so I can benefit from that performance as well.</p>
<p>Instead, they are now going for <a href="http://opensource.adobe.com/wiki/display/flexsdk/Hero" target="_blank">Hero</a>, which is the next version of the Flex framework. That version should become a unified version, which will be cross-device. I can only hope that AIR 2.5 (which is the version for Android devices) is going to be included into the same framework, so there&#8217;s no more installing SDKs separately.</p>
<p>As you can see in <a href="http://www.flexpert.be/2010/06/applications-in-air-on-android/" target="_blank">this blogpost</a> I wrote earlier, the applications I&#8217;m demonstrating are created with Flex (standard Flex 4/AIR2.5 that is) and they are running smoothly on Android. They have even been created via Flash Catalyst, which is definitely not optimised for mobile devices. But still they run smoothly, although I must admit that loading times could be faster. Can you imagine what performance you are going to get once this framework has been optimised? I can&#8217;t wait to get my hands on that SDK <img src='http://www.flexpert.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  But it seems we&#8217;ll have to wait until later this year to be able to get a beta version of the SDK.</p>
<p>You can read the entire article on <a href="http://labs.adobe.com/technologies/flex/mobile/" target="_blank">Adobe Labs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2010/07/bye-bye-slider-hello-hero/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Applications in AIR on Android</title>
		<link>http://www.flexpert.be/2010/06/applications-in-air-on-android/</link>
		<comments>http://www.flexpert.be/2010/06/applications-in-air-on-android/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 13:14:54 +0000</pubDate>
		<dc:creator>Steven Peeters</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[BTicino]]></category>
		<category><![CDATA[domotics]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[solar panel monitor]]></category>

		<guid isPermaLink="false">http://www.flexpert.be/?p=512</guid>
		<description><![CDATA[This time I would like to share a small video with you guys. It&#8217;s about a couple of AIR applications that I&#8217;ve created. The first one in the video is a solar panel monitor application, which monitor the power output of my solar panels at home. This one works over [...]]]></description>
			<content:encoded><![CDATA[<p>This time I would like to share a small video with you guys. It&#8217;s about a couple of AIR applications that I&#8217;ve created. The first one in the video is a solar panel monitor application, which monitor the power output of my solar panels at home. </p>
<p>This one works over the internet as well, since it simply downloads a CVS file every 10 minutes to automatically update the application. The design was made in Illustrator, brought into Flash Catalyst to get the arrow working and finally I took it to Flash Builder to attach the HTTPService that fetches the data. You can read the full implementation in my book <a href="http://www.amazon.com/Flash-Builder-Catalyst-Workflow-Essential/dp/1430228350/ref=pd_rhf_p_t_1" target="_blank">&quot;Flash Builder and Flash Catalyst: The New Workflow&quot;</a> as well, since it&#8217;s one of the many examples in there.</p>
<p>The second application is a remote control for my <a href="http://www.bticino.com" target="_blank">BTicino</a> domotics system. I&#8217;ve been wanting to do this for a very long time now. But up until now I just couldn&#8217;t do it, because you couldn&#8217;t create this thing in Flash Lite 3. But now, with AIR on Android (and soon on other mobile platforms as well) I could create a socket connection to my MH200 controller and feed it directly with my input to control the shutters and lights. Naturally, the possibilities are only limited by your imagination.</p>
<p>Both applications are Flex 4 applications, which proves that, despite the fact that the Flex framework isn&#8217;t optimised for these mobile devices and Slider (special Flex framework for mobile) isn&#8217;t yet available, the application still works pretty damn well. Loading times are not that bad either. Imagine what an optimised Flex framework will be able to perform then&#8230;</p>
<p><center><br />
<script type="text/javascript">
    		var parameters =
    			{	id: "1"
    			,	src: "http://www.flexpert.be/tutorials/AIRonAndroid/AIRonAndroid.f4v"
    			,	autoPlay: "false"
    			,   width: "360"
    			,   height: "299"
				,	autoHideControlBar: "false"
				,	controlBarPosition: "bottom"
    			};
    		// Embed the player SWF:
    		swfobject.embedSWF
				( "/strobe/StrobeMediaPlayback.swf"
				, "player"
				, parameters["width"], parameters["height"]
				, "10.0.0"
				, {}
				, parameters
				, { allowFullScreen: "true" }
				, { name: "StrobeMediaPlayback" }
				);		
     </script></p>
<div id="player">
<p>Please install Flash Player 10.0</p>
</p></div>
<p></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpert.be/2010/06/applications-in-air-on-android/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

