<?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>Abdulrahman Alotaiba&#039;s Blog &#187; android</title>
	<atom:link href="http://blog.mawqey.com/tag/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mawqey.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Mon, 06 Feb 2012 11:16:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Experimenting with Android and Arduino</title>
		<link>http://blog.mawqey.com/2011/01/24/experimenting-with-android-and-arduino/</link>
		<comments>http://blog.mawqey.com/2011/01/24/experimenting-with-android-and-arduino/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 16:37:18 +0000</pubDate>
		<dc:creator>Abdulrahman Alotaiba</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://blog.mawqey.com/?p=42</guid>
		<description><![CDATA[This is an experiment showing how an Nexus S mobile phone, controlling LED Graph Bar based on the orientation using the accelerometer sensor. <a href="http://blog.mawqey.com/2011/01/24/experimenting-with-android-and-arduino/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever since I got into the world of mobile development, I always wanted to do more than just writing apps. I always wanted to interact with the physical world with my mobile. So lately, I have discovered an awesome open source electronics i/o board called <a href="http://www.arduino.cc/">Arduino</a>. I ordered one from <a href="http://www.sparkfun.com/">Sparkfun</a>, and it took around 20 days to get to me, it would&#8217;ve gotten to me a little earlier, if the carrier company didn&#8217;t think it was an explosive unit.</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/3CaI088SiIQ" frameborder="0" allowFullScreen></iframe></p>
<p><span id="more-42"></span><br />
As I got my Arduino, I had to dust out my electronics knowledge that I got back when I was at college. Arduino really makes it easy, even for the non electronics geek, to get into electronics really quickly.</p>
<h3 id="My_First_Real_Arduino_Experiment">My First Real Arduino Experiment</h3>
<p>After a quick refresh into the world of electronics, I wanted to do a little experiment that would allow me to interface my newly bought Nexus S phone with Arduino. Since I didn&#8217;t connect my bluesmirf bluetooth module yet, I had to interface with Arduino using <a href="http://en.wikipedia.org/wiki/Serial_communication">serial connection</a>. There&#8217;s one problem though, I didn&#8217;t want to connect a &#8220;<strong>mobile device</strong>&#8221; with wires to a board.</p>
<p>The solution was simple:</p>
<ol>
<li>Connect the Arduino board to a host computer</li>
<li>Run a TCP server on the host computer, that waits for commands from a client</li>
<li>The TCP server translates those commands, and sends them to the Arduino&#8217;s serial port</li>
</ol>
<h3 id="Circuit_Design">Circuit Design</h3>
<p>The components setup is easy, you would control the 10 LED graph bar, as individual LEDs with current limiting resistors. Looking at the <a href="http://www.sparkfun.com/datasheets/Components/LED/YSLB-102510R3-10.pdf">datasheet</a> for the LED graph bar, it says that I would need 20mA of current to operate the LEDs. Unfortunately, I don&#8217;t have lower resistors than my 330Ω, so I used 10 330Ω resistors to provide around 15mA to each LED, which was enough.</p>
<h3 id="LED_Graph_Bar_Arduino_Sketch">LED Graph Bar Arduino Sketch</h3>
<p>Arduino comes with a powerful language called the <a href="http://arduino.cc/en/Reference/HomePage">Arduino programming language</a>, which is based on C/C++. So I had no problem understanding the language quickly, and start interacting with the board.</p>
<p><script src="https://gist.github.com/793461.js"> </script></p>
<p>I connected the LEDs to ports 2 to 11 on the Arduino board, and sat them to output either HIGH (5v) to light on, or LOW (0v) to light off. Also in the setup function, I initiate the serial communication with baud rate = 9600.</p>
<p>As the loop function starts, I wait for serial bytes to arrive, as the bytes arrive, they arrive in ASCII encoded stream. I had to do a little conversion from ASCII to integer, and if the integer is between 0 and 9, I light the LEDs that correspond to that number plus 1, So if I receive 3, I would light 4 LEDs. I count from 0, because I wanted to keep my communication under 1 byte, plus that&#8217;s how machines count.</p>
<h3 id="TCP_To_Serial_Communication_Server">TCP To Serial Communication Server</h3>
<p>To let the Nexus S communicate wirelessly with Arduino, I had to write something that would allow me to send serial commands from the mobile phone to Arduino. So I wrote a simple TCP server in Python. The Python server would receive the desired commands over WiFi, and translates those commands to Arduino using the serial port. I wouldn&#8217;t have used this server, if I connected the bluetooth module, since I can send those commands directly from Android phone to Arduino.</p>
<p><script src="https://gist.github.com/793446.js"> </script></p>
<p>The TCP server is simple, I use the awesome library <a href="http://pyserial.sourceforge.net/">pySerial</a> to open the serial port on my Arduino, with the same baud rate as defined on the sketch. If the connection has been established, I loop indefinitely waiting for commands, which in our case would be digits from 0 to 9. As I receive the digits, I convert them to ASCII, and send them to Arduino. If the letter &#8216;Q&#8217; was received, the communication ends.</p>
<h3 id="The_Android_App">The Android App</h3>
<p>The TCP server waits for commands to be sent from any device that it connects to, I had the server running on port 50000 of the same machine that is connected to the Arduino. and all I had to do is send the numbers of LEDs that I want to light. Using the accelerometer sensor on the Nexus S, it was really easy. I just had to filter out the jitter, as the accelerometer sensor is very sensitive, so I could send normal integers over the air to light how many LEDs I want.</p>
<p>The full <a href="https://github.com/alotaiba/Android-Arduino-Test-App">source code of the app</a> is available under GNU GPLv3 license on my github repository, please feel free to use it.</p>
<h3 id="Resources">Resources</h3>
<ul>
<li><a href="http://www.arduino.cc/">Arduino website</a></li>
<li><a href="http://www.sparkfun.com/">Sparkfun</a></li>
<li><a href="http://www.arduino.cc/playground/Projects/ArduinoUsers">Arduino Playground</a></li>
<li><a href="http://principialabs.com/arduino-python-4-axis-servo-control/">Arduino-Python 4-Axis Servo Control</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mawqey.com/2011/01/24/experimenting-with-android-and-arduino/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Qontacts Official Public Release</title>
		<link>http://blog.mawqey.com/2010/07/22/qontacts-official-public-release/</link>
		<comments>http://blog.mawqey.com/2010/07/22/qontacts-official-public-release/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 16:04:38 +0000</pubDate>
		<dc:creator>Abdulrahman Alotaiba</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[java-me]]></category>
		<category><![CDATA[qontacts]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.mawqey.com/?p=22</guid>
		<description><![CDATA[Today I&#8217;m really happy to announce the official public release of the free, open source, cross platform mobile application Qontacts v1.0. Qontacts is a mobile application, that can update your address book contacts, stored on your handset, to the new &#8230; <a href="http://blog.mawqey.com/2010/07/22/qontacts-official-public-release/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m really happy to announce the official public release of the free, open source, cross platform mobile application <a href="http://www.qontactsapp.com/en">Qontacts</a> v1.0.</p>
<p>Qontacts is a mobile application, that can update your address book contacts, stored on your handset, to the new Qatari numbering plan, in a fast and easy way. I&#8217;ve already <a href="http://blog.mawqey.com/2010/07/14/qontacts-mobile-app-that-updates-qatari-contacts-pre-release/">introduced the pre-release version</a> last week, and it was very well received by the public, and I was very happy that it did. Here are some of what the media was writing about it:</p>
<ol>
<li><a href="http://www.thepeninsulaqatar.com/qatar/120776-qatari-developers-number-updating-software-a-major-hit.html">Qatari developer’s number updating software, a major hit</a></li>
<li><a href="http://www.al-sharq.com/articles/more.php?id=202717&amp;date=2010-07-19">شاب قطري يصمم برنامجاً لتعديل الأرقام المحفوظة على الهاتف الجوال</a></li>
</ol>
<p><span id="more-22"></span></p>
<h3 id="Qontacts_Behind_the_Scenes">Qontacts Behind the Scenes</h3>
<p>This project has been in the making for 4 months, ever since <a href="http://www.ict.gov.qa/output/page1811.asp">ictQATAR&#8217;s announcement</a>. I&#8217;m really proud that it is going public for free, that is free as in &#8220;free speech&#8221;, and free as in &#8220;free water&#8221;.</p>
<p>I&#8217;ve spent so much time, and money, developing it, from buying all sorts of mobile handsets to test on, to getting certified from RIM, and Apple, in order to develop and publish apps on their platforms. However, I was very glad to do it, because I knew that this kind of application will be very important to the Qatari community, and I wanted to help my country, even if that meant to sacrifice, at least I knew the community will find it useful.</p>
<p>I wanted Qontacts to be free for everybody, not just for people who belong to one mobile operator, and not the rest. That made me lose offers, and probably my current job, but I think I&#8217;ve made the right choice.</p>
<h3 id="Acknowledgment">Acknowledgment</h3>
<p>I would like to thank everybody who participated in Qontacts development, either by testing it, and giving me comments and suggestions, or by giving me the moral support I really needed. These people are:</p>
<ol>
<li>Tariq Alsada</li>
<li>Hassan Albader</li>
<li>Ahmad Mustafa Noor</li>
<li>Ammar Fakhoury</li>
<li>Josh Weiner</li>
</ol>
<p>Finally, I hope that you will find Qontacts useful, and if you did, you can consider <a href="http://www.qontactsapp.com/en/donate">donating</a> to help me continue developing such useful applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mawqey.com/2010/07/22/qontacts-official-public-release/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Qontacts: Mobile App that Updates Qatari Contacts Pre-Release</title>
		<link>http://blog.mawqey.com/2010/07/14/qontacts-mobile-app-that-updates-qatari-contacts-pre-release/</link>
		<comments>http://blog.mawqey.com/2010/07/14/qontacts-mobile-app-that-updates-qatari-contacts-pre-release/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 20:00:56 +0000</pubDate>
		<dc:creator>Abdulrahman Alotaiba</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[java-me]]></category>
		<category><![CDATA[prerelease]]></category>
		<category><![CDATA[qontacts]]></category>

		<guid isPermaLink="false">http://blog.mawqey.com/?p=8</guid>
		<description><![CDATA[I am about to officially release Qontacts, the open source cross platform mobile app, that updates all of the Qatari contacts stored on the mobile handset&#8217;s address book. Starting from July 28, 2010, phone numbers in Qatar will be expanded &#8230; <a href="http://blog.mawqey.com/2010/07/14/qontacts-mobile-app-that-updates-qatari-contacts-pre-release/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am about to officially release <a href="http://www.qontactsapp.com/">Qontacts</a>, the open source cross platform mobile app, that updates all of the Qatari contacts stored on the mobile handset&#8217;s address book.</p>
<p>Starting from July 28, 2010, phone numbers in Qatar will be expanded from seven to eight digits. Qontacts works by analyzing your contacts, that are stored on your device, then displays contacts which need to be updated to the new Qatari numbering plan.</p>
<p>I have been working very hard on it for the past 4 months, and so excited that it will get out soon. The iPhone version is <a href="http://itunes.apple.com/us/app/qontacts/id379811066?mt=8">already out</a>, and you can get it from the AppStore right now. As for the rest, there will be a BlackBerry, Android, and Java ME versions coming out soon.</p>
<p><span id="more-8"></span></p>
<h3 id="Key_Features">Key Features</h3>
<ol>
<li>Analyze and display contacts that need to be updated, with how many phone numbers to update.*</li>
<li>Preview the updated numbers of your contacts, before you update.</li>
<li>Select some, or all of your contacts, to do batch update.</li>
<li>Fully localized to Arabic, and English languages.**</li>
</ol>
<p><small>* Qontacts smart analysis detects only the Qatari numbers, that are 7 digits in length, or starting with 00974, or starting with +974. It won’t update any updated numbers, i.e. with 8 digits, or numbers that don&#8217;t conform to the rules of the new numbering plan, <a href="http://www.ictqatar.qa/output/page39.asp">defined by ictQATAR</a>.</small></p>
<p><small>** The display language is based on your handset&#8217;s settings, for example, if your handset is set to Arabic, it&#8217;ll display Arabic interface.</small></p>
<h3 id="Supported_Handsets">Supported Handsets</h3>
<ol>
<li>iOS 3.0 or later (Tested on iOS 4)</li>
<li>BlackBerry 4.5 or later</li>
<li>Android 1.5 or later</li>
<li>Any device capable of running Java ME apps (Nokia, Sony Ericsson, etc)</li>
</ol>
<h3 id="Screenshots">Screenshots</h3>
<p>Here are screenshots of Qontacts, running on the above mentioned platforms.</p>
<h4 id="iPhone">iPhone</h4>
<p class="post_image"><img class="alignnone size-full wp-image-14" title="qontacts-ios-01" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-ios-01.png" alt="" width="600" height="277" /></p>
<p class="post_image"><img class="alignnone size-full wp-image-15" title="qontacts-ios-02" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-ios-02.png" alt="" width="600" height="277" /></p>
<h4 id="BlackBerry">BlackBerry</h4>
<p class="post_image"><img class="alignnone size-full wp-image-11" title="qontacts-bb-01" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-bb-01.png" alt="" width="600" height="193" /></p>
<p class="post_image"><img class="alignnone size-full wp-image-12" title="qontacts-bb-02" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-bb-02.png" alt="" width="600" height="193" /></p>
<p class="post_image"><img class="alignnone size-full wp-image-13" title="qontacts-bb-03" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-bb-03.png" alt="" width="600" height="193" /></p>
<h4 id="Android">Android</h4>
<p class="post_image"><img class="alignnone size-full wp-image-10" title="qontacts-android-01" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-android-01.png" alt="" width="600" height="290" /></p>
<h4 id="Nokia">Nokia</h4>
<p class="post_image"><img class="alignnone size-full wp-image-16" title="qontacts-nokia-01" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-nokia-01.png" alt="" width="600" height="257" /></p>
<p class="post_image"><img class="alignnone size-full wp-image-17" title="qontacts-nokia-02" src="http://blog.mawqey.com/wp-content/uploads/2010/07/qontacts-nokia-02.png" alt="" width="600" height="257" /></p>
<h3 id="Download_the_Pre-Release_version">Download the Pre-Release version</h3>
<p>A pre-release version is now available. You can download the pre-release version by going to the following URL, from your <strong>supported handset device</strong>, and it will auto detect your handset, and push the right version of Qontacts to your device.<br />
<a href="http://www.qontactsapp.com/download/">http://www.qontactsapp.com/download/</a></p>
<p>The full source code of these apps will be released in the upcoming days on my page at <a href="http://github.com/alotaiba">Github</a>.</p>
<p>I will really appreciate the feedback, and please don&#8217;t forget to rate the iPhone version.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mawqey.com/2010/07/14/qontacts-mobile-app-that-updates-qatari-contacts-pre-release/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

