<?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:blogger='http://schemas.google.com/blogger/2008' 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-2438403114690088300</id><updated>2024-09-25T21:58:05.554-07:00</updated><category term="Think-Android"/><category term="Think-Video Processing"/><category term="Think-Internet"/><title type='text'>Think</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-4123945491690295789</id><published>2011-09-22T08:19:00.000-07:00</published><updated>2011-09-22T08:19:07.184-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>UPnP with Java</title><content type='html'>&lt;br /&gt;
&lt;h1 class=&quot;firstHeading&quot; id=&quot;firstHeading&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; color: black; font-family: sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.2em; margin-bottom: 0.1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-top: 0px; width: auto;&quot;&gt;
UPnP: Universal Plug and Play&lt;/h1&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;&quot;&gt;
&lt;b&gt;Universal Plug and Play&lt;/b&gt;&amp;nbsp;(&lt;b&gt;UPnP&lt;/b&gt;) is a set of&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Networking_protocol&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Networking protocol&quot;&gt;networking protocols&lt;/a&gt;&amp;nbsp;for primarily residential networks without enterprise class devices that permits networked&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Peripheral_device&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Peripheral device&quot;&gt;devices&lt;/a&gt;, such as personal computers, printers, Internet gateways,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Wi-Fi&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Wi-Fi&quot;&gt;Wi-Fi&lt;/a&gt;&amp;nbsp;access points and mobile devices to seamlessly discover each other&#39;s presence on the network and establish functional&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Network_service&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Network service&quot;&gt;network services&lt;/a&gt;&amp;nbsp;for data sharing, communications, and entertainment. The UPnP technology is promoted by the&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/UPnP_Forum&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;UPnP Forum&quot;&gt;UPnP Forum&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;&quot;&gt;
The concept of UPnP is an extension of&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Plug-and-play&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #0645ad; text-decoration: none;&quot; title=&quot;Plug-and-play&quot;&gt;plug-and-play&lt;/a&gt;, a technology for dynamically attaching devices directly to a computer, although UPnP is not directly related to the earlier plug-and-play technology. UPnP devices are &quot;plug-and-play&quot; in that when connected to a network they automatically establish working configurations with other devices.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: sans-serif; font-size: 13px; line-height: 1.5em; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #3f4447; font-family: Tahoma, &#39;Lucida Sans&#39;, Arial, Helvetica, sans-serif; font-size: medium; line-height: normal;&quot;&gt;
&lt;h1 style=&quot;font-size: 1.5em; font-weight: normal; line-height: 1.2em; margin-bottom: 0.4em; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Cling - Java/Android UPnP library and tools&lt;/h1&gt;
&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Cling is an effort to create a UPnP-compatible software stack in Java. The project&#39;s goals are strict specification compliance, complete, clean and extensive APIs, as well as rich SPIs for easy customization.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
The current release of Cling is&amp;nbsp;&lt;i&gt;1.0.5 (2011-09-22)&lt;/i&gt;, see the&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/changelog.txt&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Changelog&lt;/a&gt;&amp;nbsp;for a summary of improvements and the&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/roadmap.html&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Road Map&lt;/a&gt;for future plans. You can also find snapshot builds of the current development trunk&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/download/snapshots/cling/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;here&lt;/a&gt;&amp;nbsp;or include version&amp;nbsp;&lt;tt style=&quot;font-family: &#39;Andale Mono&#39;, Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: smaller;&quot;&gt;1.1-SNAPSHOT&lt;/tt&gt;as a dependency in your Maven&amp;nbsp;&lt;tt style=&quot;font-family: &#39;Andale Mono&#39;, Monaco, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: smaller;&quot;&gt;pom.xml&lt;/tt&gt;.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Read&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/core/manual/cling-core-manual.html#chapter.GettingStarted&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;this chapter of the manual&lt;/a&gt;&amp;nbsp;for a simple Cling usage example.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Main modules of Cling are:&lt;/div&gt;
&lt;dl class=&quot;freshlinks&quot;&gt;
&lt;dt style=&quot;font-style: italic; margin-top: 0.8em;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://teleal.org/projects/cling/core/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Cling Core&lt;/a&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
An embeddable Java library that implements the&amp;nbsp;&lt;a class=&quot;externalLink&quot; href=&quot;http://www.upnp.org/resources/documents.asp&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;UPnP Device Architecture 1.0&lt;/a&gt;. Use Cling Core to expose services with a UPnP remoting interface, or to write control point applications that discover UPnP devices and utilize their services. You can also integrate&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/core/manual/cling-core-manual.html#chapter.Android&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Cling Core as an Android UPnP/DLNA library in your applications&lt;/a&gt;&amp;nbsp;(platform level 7/2.1 required). The full source code of the&amp;nbsp;&lt;i&gt;Android UPnPBrowser&lt;/i&gt;&amp;nbsp;example of the manual can be found&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/download/misc/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;here&lt;/a&gt;. You can see the application in action in&amp;nbsp;&lt;a href=&quot;http://teleal.org/weblog/software/New%20Cling%20beta3%20runs%20on%20Android%2021.html&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;this video&lt;/a&gt;.&lt;/div&gt;
&lt;/dd&gt;
&lt;dt style=&quot;font-style: italic; margin-top: 0.8em;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://teleal.org/projects/cling/support/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Cling Support&lt;/a&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Optional classes and useful infrastructure for developing and controlling UPnP services with Cling Core; extensions that simplify working with UPnP media servers and renderers,&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/support/manual/cling-support-manual.html#section.PortMapping&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;NAT port mapping on routers&lt;/a&gt;, etc.&lt;/div&gt;
&lt;/dd&gt;
&lt;dt style=&quot;font-style: italic; margin-top: 0.8em;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://teleal.org/projects/cling/workbench/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Cling Workbench&lt;/a&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
A desktop application for browsing UPnP devices and interacting with their services, including an&amp;nbsp;&lt;a href=&quot;http://teleal.org/projects/cling/workbench/wanbridge.html&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;HTTP gateway and WAN/LAN bridge&lt;/a&gt;.&lt;/div&gt;
&lt;/dd&gt;
&lt;dt style=&quot;font-style: italic; margin-top: 0.8em;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://teleal.org/projects/cling/mediarenderer/&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;Cling MediaRenderer&lt;/a&gt;&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Standalone&amp;nbsp;&lt;a class=&quot;externalLink&quot; href=&quot;http://www.upnp.org/resources/documents.asp&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;UPnP MediaRenderer&lt;/a&gt;, based on gstreamer.&lt;/div&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;div style=&quot;line-height: 1.4em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0.8em; text-align: justify;&quot;&gt;
Cling is Free Software, distributed under the terms of the&amp;nbsp;&lt;a class=&quot;externalLink&quot; href=&quot;http://www.gnu.org/licenses/lgpl.html&quot; style=&quot;color: #78a31c; text-decoration: none;&quot;&gt;GNU Lesser General Public License&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/4123945491690295789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/upnp-with-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/4123945491690295789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/4123945491690295789'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/upnp-with-java.html' title='UPnP with Java'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-2277565766510565677</id><published>2011-09-21T08:46:00.000-07:00</published><updated>2011-09-21T08:46:55.306-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>Android: Services</title><content type='html'>&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Declaring a service in the manifest&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Add a &amp;lt;service&amp;gt; element as a child of the &amp;lt;application&amp;gt; element.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;manifest&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; ...
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; ... &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;service&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;.ExampleService&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/application&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;android:name&lt;/span&gt; attribute is the only required attribute, that specifies the class name of the service. Once you publish your application, you should not change this name.&lt;br /&gt;
Just like an activity, a service can define intent filters that allow other components to invoke the service using implicit intents. If you plan on using your service only locally, then you you don&#39;t need to supply any intent filters.&lt;br /&gt;
Additionally, you can ensure that your service is private to your application only if you include the &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;android:exported&lt;/span&gt; attribute and set it to &quot;false&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Creating a Started Service&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
When a service is started, it has a lifecycle that&#39;s independent of the component that started it and the service can run in the background indefinitely, even if the component that started it is destroyed. As such, the service should stop itself when its job is done by calling&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#stopSelf()&quot; style=&quot;color: #006699;&quot;&gt;stopSelf()&lt;/a&gt;&lt;/code&gt;, or another component can stop it by calling&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/content/Context.html#stopService(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;stopService()&lt;/a&gt;&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
An application component such as an activity can start the service by calling&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;startService()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;and passing an&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/content/Intent.html&quot; style=&quot;color: #006699;&quot;&gt;Intent&lt;/a&gt;&lt;/code&gt;&amp;nbsp;that specifies the service and includes any data for the service to use. The service receives this&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/content/Intent.html&quot; style=&quot;color: #006699;&quot;&gt;Intent&lt;/a&gt;&lt;/code&gt;&amp;nbsp;in the&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent, int, int)&quot; style=&quot;color: #006699;&quot;&gt;onStartCommand()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;method.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Traditionally, there are two classes you can extend to create a started service:&lt;/div&gt;
&lt;dl style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;dt style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html&quot; style=&quot;color: #006699;&quot;&gt;Service&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 2em; padding-right: 0px; padding-top: 0px;&quot;&gt;This is the base class for all services. When you extend this class, it&#39;s important that you create a new thread in which to do all the service&#39;s work, because the service uses your application&#39;s main thread, by default, which could slow the performance of any activity your application is running.&lt;/dd&gt;
&lt;dt style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html&quot; style=&quot;color: #006699;&quot;&gt;IntentService&lt;/a&gt;&lt;/code&gt;&lt;/dt&gt;
&lt;dd style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 2em; padding-right: 0px; padding-top: 0px;&quot;&gt;This is a subclass of&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html&quot; style=&quot;color: #006699;&quot;&gt;Service&lt;/a&gt;&lt;/code&gt;&amp;nbsp;that uses a worker thread to handle all start requests, one at a time. This is the best option if you don&#39;t require that your service handle multiple requests simultaneously. All you need to do is implement&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#onHandleIntent(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;onHandleIntent()&lt;/a&gt;&lt;/code&gt;, which receives the intent for each start request so you can do the background work.&lt;/dd&gt;&lt;div&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
The&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html&quot; style=&quot;color: #006699;&quot;&gt;IntentService&lt;/a&gt;&lt;/code&gt;&amp;nbsp;does the following:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0.8em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 2em; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Creates a default worker thread that executes all intents delivered to&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent, int, int)&quot; style=&quot;color: #006699;&quot;&gt;onStartCommand()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;separate from your application&#39;s main thread.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Creates a work queue that passes one intent at a time to your&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#onHandleIntent(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;onHandleIntent()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;implementation, so you never have to worry about multi-threading.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Stops the service after all start requests have been handled, so you never have to call&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#stopSelf()&quot; style=&quot;color: #006699;&quot;&gt;stopSelf()&lt;/a&gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Provides default implementation of&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#onBind(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;onBind()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;that returns null.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Provides a default implementation of&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#onStartCommand(android.content.Intent, int, int)&quot; style=&quot;color: #006699;&quot;&gt;onStartCommand()&lt;/a&gt;&lt;/code&gt;&amp;nbsp;that sends the intent to the work queue and then to your&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#onHandleIntent(android.content.Intent)&quot; style=&quot;color: #006699;&quot;&gt;onHandleIntent()&lt;/a&gt;&lt;/code&gt;implementation.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Example of IntentService implementation...&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HelloIntentService&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;IntentService&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/** 
&amp;nbsp; &amp;nbsp;* A constructor is required, and must call the super &lt;/span&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html#IntentService(java.lang.String)&quot; style=&quot;color: #006699;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;IntentService(String)&lt;/span&gt;&lt;/a&gt;&lt;/code&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;
&amp;nbsp; &amp;nbsp;* constructor with a name for the worker thread.
&amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HelloIntentService&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;HelloIntentService&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/**
&amp;nbsp; &amp;nbsp;* The IntentService calls this method from the default worker thread with
&amp;nbsp; &amp;nbsp;* the intent that started the service. When this method returns, IntentService
&amp;nbsp; &amp;nbsp;* stops the service, as appropriate.
&amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onHandleIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// Normally we would do some work here, like download a file.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// For our sample, we just sleep for 5 seconds.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; endTime &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; endTime&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;synchronized&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wait&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;endTime &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/dl&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 id=&quot;StartingAService&quot; style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #3a3a3a; font-family: arial, sans-serif; font-size: 1.3em; margin-bottom: 0.65em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Starting a Service&lt;/h3&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; intent &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HelloService&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
startService&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 id=&quot;StartingAService&quot; style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #3a3a3a; font-family: arial, sans-serif; font-size: 1.3em; margin-bottom: 0.65em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Running a Service in the Foreground&lt;/h3&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
A foreground service is a service that&#39;s considered to be something the user is actively aware of and thus not a candidate for the system to kill when low on memory. A foreground service must provide a notification for the status bar, which is placed under the &quot;Ongoing&quot; heading, which means that the notification cannot be dismissed unless the service is either stopped or removed from the foreground.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
To request that your service run in the foreground, call&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification)&quot; style=&quot;color: #006699;&quot;&gt;startForeground()&lt;/a&gt;&lt;/code&gt;. This method takes two parameters: an integer that uniquely identifies the notification and the&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Notification.html&quot; style=&quot;color: #006699;&quot;&gt;Notification&lt;/a&gt;&lt;/code&gt;&amp;nbsp;for the status bar. For example:&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Notification&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; notification &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Notification&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; getText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ticker_text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; notificationIntent &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ExampleActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;PendingIntent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pendingIntent &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;PendingIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; notificationIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
notification&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;setLatestEventInfo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; getText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;notification_title&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;notification_message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pendingIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
startForeground&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ONGOING_NOTIFICATION&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; notification&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
To remove the service from the foreground, call&amp;nbsp;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;a href=&quot;http://developer.android.com/reference/android/app/Service.html#stopForeground(boolean)&quot; style=&quot;color: #006699;&quot;&gt;stopForeground()&lt;/a&gt;&lt;/code&gt;. This method takes a boolean, indicating whether to remove the status bar notification as well. This method does&amp;nbsp;&lt;em&gt;not&lt;/em&gt;&amp;nbsp;stop the service. However, if you stop the service while it&#39;s still running in the foreground, then the notification is also removed.&lt;/div&gt;
&lt;h3 id=&quot;StartingAService&quot; style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #3a3a3a; font-family: arial, sans-serif; font-size: 1.3em; margin-bottom: 0.65em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Lifecycle of Services&lt;/h3&gt;
&lt;div style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://developer.android.com/images/service_lifecycle.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/guide/topics/fundamentals/services.html&quot;&gt;http://developer.android.com/guide/topics/fundamentals/services.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/2277565766510565677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/android-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2277565766510565677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2277565766510565677'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/android-services.html' title='Android: Services'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-241845420289457859</id><published>2011-09-12T12:24:00.001-07:00</published><updated>2011-09-12T12:24:32.799-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>How to detect if internet connection is available on Android</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: inline !important; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; isNetworkAvailable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ConnectivityManager&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; connectivityManager 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ConnectivityManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; getSystemService&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;CONNECTIVITY_SERVICE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;NetworkInfo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; activeNetworkInfo &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; connectivityManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;getActiveNetworkInfo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; activeNetworkInfo &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: red; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: blue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&quot;android.permission.ACCESS_NETWORK_STATE&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/241845420289457859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-detect-if-internet-connection-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/241845420289457859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/241845420289457859'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-detect-if-internet-connection-is.html' title='How to detect if internet connection is available on Android'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-3802205149478005989</id><published>2011-09-08T08:39:00.000-07:00</published><updated>2011-09-08T08:39:36.325-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>Logging for Android Debugging</title><content type='html'>Methods of logging&lt;br /&gt;
- ERROR: Log.e()&lt;br /&gt;
- WARN: Log.w()&lt;br /&gt;
- Info: Log.i()&lt;br /&gt;
- DEBUG: Log.d()&lt;br /&gt;
- VERBOSE: Log.v()&lt;br /&gt;
&lt;br /&gt;
How to:&lt;br /&gt;
1. Add a TAG as a class member like this.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;private static final String TAG = &quot;MyClass&quot;;&lt;/span&gt;&lt;br /&gt;
2. Where you want to log, put line like this.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; Log.e(TAG, &quot;value=&quot; + i);&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/3802205149478005989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/logging-for-android-debugging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/3802205149478005989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/3802205149478005989'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/logging-for-android-debugging.html' title='Logging for Android Debugging'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-2095162767485399051</id><published>2011-09-06T12:37:00.000-07:00</published><updated>2011-09-06T12:38:28.691-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Video Processing"/><title type='text'>FFserver configuration for FLV streaming</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;This is for FLV streaming from FFserver.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: &#39;Courier New&#39;, Courier, monospace; line-height: 18px;&quot;&gt;Port &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8090&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;BindAddress &amp;nbsp; &amp;nbsp; 0.0.0.0&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MaxClients &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MaxBandWidth &amp;nbsp; &amp;nbsp;50000&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CustomLog &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;NoDaemon&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;Feed office.ffm&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;File &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/tmp/office.ffm&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;FileMaxSize &amp;nbsp; &amp;nbsp; 20M&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/Feed&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;Stream office.flv&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Feed etioffice.ffm&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Format flv&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoCodec flv&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoFrameRate 10&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#VideoBitRate 2048&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#VideoBufferSize 4096&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoSize 640x480&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoQMin 3&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoQMax 31&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;AVOptionVideo flags +global_header&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#VideoGopSize 10&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoIntraOnly&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;PreRoll 0&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;NoAudio&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/Stream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/2095162767485399051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/ffserver-configuration-for-flv.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2095162767485399051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2095162767485399051'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/ffserver-configuration-for-flv.html' title='FFserver configuration for FLV streaming'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-7552334790374105464</id><published>2011-09-06T12:34:00.000-07:00</published><updated>2011-09-06T12:34:30.530-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Video Processing"/><title type='text'>FFserver configuration for MJPEG streaming</title><content type='html'>&lt;br /&gt;
This is the configuration for MJPEG streaming. My test case is getting MJPEG streaming from IP Camera and transcode to another MJPEG video stream. This was needed as my IP cam limits the available connection to 10. It works well but sometimes it reports error like &quot;invalid stream index xxx&quot;, which needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
The configuration is like this.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Port &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8090&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;BindAddress &amp;nbsp; &amp;nbsp; 0.0.0.0&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MaxClients &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MaxBandWidth &amp;nbsp; &amp;nbsp;50000&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CustomLog &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;NoDaemon&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;Feed office.ffm&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;File &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/tmp/office.ffm&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;FileMaxSize &amp;nbsp; &amp;nbsp; 20M&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/Feed&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;Stream office.mjpeg&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Feed office.ffm&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Format mpjpeg&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoFrameRate 10&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#VideoBitRate 2048&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#VideoBufferSize 4096&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoSize 640x480&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoQMin 3&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VideoQMax 31&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;NoAudio&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Strict -1&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;/Stream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/7552334790374105464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/ffserver-configuration-for-mjpeg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/7552334790374105464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/7552334790374105464'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/ffserver-configuration-for-mjpeg.html' title='FFserver configuration for MJPEG streaming'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-2086022627379849832</id><published>2011-09-05T17:17:00.002-07:00</published><updated>2011-09-05T17:18:36.363-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>Rotate bitmap to display on ImageView</title><content type='html'>&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;SetImage function doesn&#39;t detect photo orientation. This code is to fix the problem.&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;At first, detect the orientation then apply this code to draw properly.&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;int iImageWidth = 320; // original image width&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;int iImageHeight = 240; // original image height&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Bitmap bmOrg =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;null&lt;/span&gt;;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;BufferedInputStream bis;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;try&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; bis =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt;&amp;nbsp;BufferedInputStream(&lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt;&amp;nbsp;FileInputStream(&lt;span class=&quot;s2&quot;&gt;mPathImage&lt;/span&gt;));&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; bmOrg = BitmapFactory.decodeStream(bis);&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; try&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bis.close();&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;catch&lt;/span&gt;&amp;nbsp;(IOException e) {&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;}&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;Matrix matrix =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt;&amp;nbsp;Matrix();&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;matrix.postRotate(iToRotate);&lt;/div&gt;&lt;div class=&quot;p3&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;Bitmap resizedBitmap = Bitmap.createBitmap(bmOrg, 0, 0, iImageWidth, iImageHeight, matrix,&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;);&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;BitmapDrawable bmd =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt;&amp;nbsp;BitmapDrawable(resizedBitmap);&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mImageView&lt;/span&gt;.setImageDrawable(bmd);&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mImageView&lt;/span&gt;.setScaleType(ScaleType.&lt;span class=&quot;s2&quot;&gt;CENTER_INSIDE&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/2086022627379849832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/rotate-bitmap-to-display-on-imageview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2086022627379849832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/2086022627379849832'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/rotate-bitmap-to-display-on-imageview.html' title='Rotate bitmap to display on ImageView'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-7475101463381721825</id><published>2011-09-05T17:17:00.000-07:00</published><updated>2011-09-05T17:19:19.648-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Internet"/><title type='text'>Public DNS</title><content type='html'>&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 16px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Google Public DNS is a free, global&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain_name_system&quot; style=&quot;color: #0000cc; text-decoration: none;&quot;&gt;Domain Name System&lt;/a&gt;&amp;nbsp;(DNS) resolution service, that you can use as an alternative to your current DNS provider.&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: xx-small; line-height: 16px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: xx-small; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: xx-small; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Configure your network settings to use the IP addresses 8.8.8.8 and&amp;nbsp;8.8.4.4 as your DNS servers.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Sometimes DNS server of Internet service provider is down and causes internet service unavailable even though connection is valid. Setting this addresses could be one of the solutions.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/7475101463381721825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/public-dns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/7475101463381721825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/7475101463381721825'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/public-dns.html' title='Public DNS'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-6821673310404464248</id><published>2011-09-05T17:16:00.001-07:00</published><updated>2011-09-05T17:19:58.273-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Video Processing"/><title type='text'>How to rotate video with FFmpeg</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Use &amp;nbsp;video fileter graph option with&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; white-space: pre;&quot;&gt;-vf &quot;transpose=X&quot;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Transpose rows with columns in the input video and optionally flip it.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;It accepts a parameter representing an integer, which can assume the values:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;0:&amp;nbsp;Rotate by 90 degrees counterclockwise and vertically flip (default)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;1:&amp;nbsp;Rotate by 90 degrees clockwise&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;2:&amp;nbsp;Rotate by 90 degrees counterclockwise&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;3.&amp;nbsp;Rotate by 90 degrees clockwise and vertically flip&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Example:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ffmpeg -vf &quot;transpose=1&quot; -i input.mp4 output.mp4&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/6821673310404464248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-rotate-video-with-ffmpeg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/6821673310404464248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/6821673310404464248'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-rotate-video-with-ffmpeg.html' title='How to rotate video with FFmpeg'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2438403114690088300.post-4955845672677070293</id><published>2011-09-05T17:15:00.001-07:00</published><updated>2011-09-05T17:20:19.107-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Think-Android"/><title type='text'>How to treat Photo Orientation using ExifInterface</title><content type='html'>&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;ExifInterface exif = null;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;int&lt;/span&gt;&amp;nbsp;iOrientation = ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_NORMAL&lt;/span&gt;;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;try&lt;/span&gt;&amp;nbsp;{&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; exif =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;new&lt;/span&gt;&amp;nbsp;ExifInterface(&lt;span class=&quot;s2&quot;&gt;image_path&lt;/span&gt;);&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;iOrientation = exif.getAttributeInt(ExifInterface.&lt;span class=&quot;s2&quot;&gt;TAG_ORIENTATION&lt;/span&gt;, ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_NORMAL&lt;/span&gt;);&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;}&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;catch&lt;/span&gt;&amp;nbsp;(IOException e) {&lt;/div&gt;&lt;div class=&quot;p2&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; //&amp;nbsp;&lt;span class=&quot;s4&quot;&gt;TODO&lt;/span&gt;&amp;nbsp;Auto-generated catch block&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;}&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;switch&lt;/span&gt;(iOrientation) {&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&amp;nbsp;ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_NORMAL&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&amp;nbsp;ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_ROTATE_90&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&amp;nbsp;ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_ROTATE_180&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&amp;nbsp;ExifInterface.&lt;span class=&quot;s2&quot;&gt;ORIENTATION_ROTATE_270&lt;/span&gt;:&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div class=&quot;p1&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://think-yogeeyo.blogspot.com/feeds/4955845672677070293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-treat-photo-orientation-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/4955845672677070293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2438403114690088300/posts/default/4955845672677070293'/><link rel='alternate' type='text/html' href='http://think-yogeeyo.blogspot.com/2011/09/how-to-treat-photo-orientation-using.html' title='How to treat Photo Orientation using ExifInterface'/><author><name>Seong</name><uri>http://www.blogger.com/profile/01242816011670674250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>