<?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-1089315940126984688</id><updated>2025-10-26T18:46:11.262-07:00</updated><category term="Android"/><category term="Eclipse"/><category term="Ant"/><category term="BOOT_COMPLETED"/><category term="Browser"/><category term="Contacts"/><category term="CountDownTimer"/><category term="MMS"/><category term="ProGard"/><category term="-wipe-data"/><category term="1024 connects/disconnects"/><category term="ACTION_TIME_TICK"/><category term="ADB"/><category term="ANR"/><category term="Adapter pattern"/><category term="Android Web Terminal"/><category term="Animation"/><category term="C#"/><category term="Calender"/><category term="Call"/><category term="CefSharp"/><category term="ContentObserver"/><category term="CyanogenMod"/><category term="Cygwin"/><category term="Email"/><category term="Errors"/><category term="External Storage"/><category term="FileInputStream"/><category term="FileNameMap"/><category term="FileObserver"/><category term="Font issues"/><category term="IllegalStateException"/><category term="Image"/><category term="Import Outlook"/><category term="JDK"/><category term="Java"/><category term="KB3013455"/><category term="Kindle Fire"/><category term="LocalServerSocket"/><category term="MD5"/><category term="Media Scanner"/><category term="MediaPlayer"/><category term="NAudio"/><category term="Password popup"/><category term="PathFileObserver"/><category term="People"/><category term="SD Cards"/><category term="SMS"/><category term="Screen timeout"/><category term="SingleTop"/><category term="Sound"/><category term="Testing"/><category term="Threading"/><category term="Video"/><category term="Windows Update"/><category term="XML"/><category term="configuration"/><category term="getContentTypeFor NullReferenceException"/><category term="keytool"/><category term="locale"/><category term="multilanguage"/><category term="networking"/><category term="serialize"/><category term="thumbnail"/><category term="virtual devices"/><title type='text'>Android Bridge</title><subtitle type='html'>http://www.androidwebterminal.com/</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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>131</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1089315940126984688.post-2504630408184968194</id><published>2017-10-30T21:47:00.002-07:00</published><updated>2017-10-30T21:47:58.808-07:00</updated><title type='text'>How to create a new project using apache maven 3.5.2</title><content type='html'>I just installed apache-maven-3.5.2 and oh boy creating a project seems very difficult. Specially if you are new. It seems it&#39;s not possible to create a new project according to the quick start tutorials.&lt;br /&gt;
&lt;br /&gt;
xx&amp;gt; mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -Dgroup&lt;br /&gt;
Id=com.mycompany.app -DartifactId=my-app&lt;br /&gt;
[INFO] Scanning for projects...&lt;br /&gt;
[INFO] ------------------------------------------------------------------------&lt;br /&gt;
[INFO] BUILD FAILURE&lt;br /&gt;
[INFO] ------------------------------------------------------------------------&lt;br /&gt;
[INFO] Total time: 0.086 s&lt;br /&gt;
[INFO] Finished at: 2017-10-31T11:44:26+07:00&lt;br /&gt;
[INFO] Final Memory: 4M/15M&lt;br /&gt;
[INFO] ------------------------------------------------------------------------&lt;br /&gt;
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (xxx). Please verify you invoked Maven from the correct directory. -&amp;gt; [Help 1]&lt;br /&gt;
[ERROR]&lt;br /&gt;
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.&lt;br /&gt;
[ERROR] Re-run Maven using the -X switch to enable full debug logging.&lt;br /&gt;
[ERROR]&lt;br /&gt;
[ERROR] For more information about the errors and possible solutions, please read the following articles:&lt;br /&gt;
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instead, try this&lt;br /&gt;
&lt;br /&gt;
mvn -B archetype:generate -DinteractiveMode=true&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2504630408184968194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/10/how-to-create-new-project-using-apache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2504630408184968194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2504630408184968194'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/10/how-to-create-new-project-using-apache.html' title='How to create a new project using apache maven 3.5.2'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-3475484721198259932</id><published>2017-05-24T22:45:00.001-07:00</published><updated>2017-05-24T22:45:41.172-07:00</updated><title type='text'>How to check the Android SIM count</title><content type='html'>getprop ro.multisim.simslotcount&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
SystemProperties.getInt(&quot;ro.multisim.simslotcount&quot;, 1) &amp;gt; 1</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/3475484721198259932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-check-android-sim-count.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3475484721198259932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3475484721198259932'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-check-android-sim-count.html' title='How to check the Android SIM count'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-3651561891191162992</id><published>2017-05-24T02:40:00.000-07:00</published><updated>2017-05-24T21:23:48.944-07:00</updated><title type='text'>How to detect Dual SIM using Android shell ?</title><content type='html'>&lt;br /&gt;
getprop persist.radio.multisim.config returns &quot;dsds&quot; or &quot;dsda&quot;&amp;nbsp;&amp;nbsp; on multi sim Samsung devices&lt;br /&gt;
&lt;br /&gt;
source:&amp;nbsp;https://android.googlesource.com/platform/frameworks/base/+/master/telephony/java/com/android/internal/telephony/TelephonyProperties.java&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static Boolean isDualSimModel() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return (Boolean.valueOf(&quot;dsds&quot;.equals(SystemProperties.get(&quot;persist.radio.multisim.config&quot;))) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Boolean.valueOf(&quot;dsda&quot;.equals(SystemProperties.get(&quot;persist.radio.multisim.config&quot;))));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/3651561891191162992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-detect-dual-sim-using-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3651561891191162992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3651561891191162992'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-detect-dual-sim-using-android.html' title='How to detect Dual SIM using Android shell ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-5726695901876174108</id><published>2017-05-23T21:54:00.000-07:00</published><updated>2017-05-23T21:54:05.524-07:00</updated><title type='text'>How to get all Android system properties ?</title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; white-space: pre;&quot;&gt;here is the magic command&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; white-space: pre;&quot;&gt;getprop&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/5726695901876174108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-get-all-android-system-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5726695901876174108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5726695901876174108'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-get-all-android-system-properties.html' title='How to get all Android system properties ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-3994660602235246205</id><published>2017-05-23T21:53:00.001-07:00</published><updated>2017-05-23T21:53:32.101-07:00</updated><title type='text'>How to dump android processes with thread ids and names</title><content type='html'>&lt;br /&gt;
Here is the magic command&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; margin: 0px; padding: 0px; white-space: pre;&quot;&gt;ps &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; box-sizing: border-box; color: #666600; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; margin: 0px; padding: 0px; white-space: pre;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; margin: 0px; padding: 0px; white-space: pre;&quot;&gt;t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; box-sizing: border-box; color: #666600; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; margin: 0px; padding: 0px; white-space: pre;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 13.3333px; margin: 0px; padding: 0px; white-space: pre;&quot;&gt;p&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/3994660602235246205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-dump-android-processes-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3994660602235246205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/3994660602235246205'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/05/how-to-dump-android-processes-with.html' title='How to dump android processes with thread ids and names'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-5269134984123153147</id><published>2017-01-24T06:35:00.001-08:00</published><updated>2017-01-24T06:35:42.085-08:00</updated><title type='text'>How to install letsencrypt ssl certificate on nginx without Unable to locate package letsencrypt error</title><content type='html'>Today, I thought of moving some of the websites to ssl. so I looked up for a guide on Google and most of them says&lt;br /&gt;
&lt;br /&gt;
sudo apt-get install letsencrypt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
but it ends with&lt;br /&gt;
&lt;br /&gt;
E: Unable to locate package letsencrypt&lt;br /&gt;
&lt;br /&gt;
So, I had to go back to the original repo to fix this problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone https://github.com/letsencrypt/letsencrypt&lt;br /&gt;
cd letsencrypt&lt;br /&gt;
./letsencrypt-auto --help&lt;br /&gt;
&lt;br /&gt;
this will show the help. If you are trying to configure to run on nginx.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;sudo ./letsencrypt-auto --nginx&lt;br /&gt;
&lt;br /&gt;
and then select the website number. Make sure you do not have anything running on port 443 now.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/5269134984123153147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2017/01/how-to-install-letsencrypt-ssl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5269134984123153147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5269134984123153147'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2017/01/how-to-install-letsencrypt-ssl.html' title='How to install letsencrypt ssl certificate on nginx without Unable to locate package letsencrypt error'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-7489695774873503387</id><published>2016-12-21T02:01:00.000-08:00</published><updated>2016-12-21T02:01:20.345-08:00</updated><title type='text'>How to setup Android Studio for Java 8</title><content type='html'>&lt;div class=&quot;tr_bq&quot;&gt;
Today, I wanted to move one of the project I was working on to Android Studio 2.2 to support Java 8. It&#39;s kind of amazing there is not enough information about how to convert an existing project to support Android Studio&amp;nbsp;+ Java 8.&lt;/div&gt;
&lt;br /&gt;
1. In your project&amp;nbsp;build.gradle add classpath &#39;com.neenbedankt.gradle.plugins:android-apt:1.8&#39; &amp;nbsp;So it should be like this&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
// Top-level build file where you can add configuration options common to all sub-projects/modules.&lt;br /&gt;buildscript {&lt;br /&gt;&amp;nbsp; &amp;nbsp; repositories {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jcenter()&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; dependencies {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; classpath &#39;com.android.tools.build:gradle:2.2.2&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; classpath &#39;me.tatarka:gradle-retrolambda:3.2.3&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; classpath &#39;com.neenbedankt.gradle.plugins:android-apt:1.8&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // NOTE: Do not place your application dependencies here; they belong&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // in the individual module build.gradle files&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;allprojects {&lt;br /&gt;&amp;nbsp; &amp;nbsp; repositories {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jcenter()&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;task clean(type: Delete) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; delete rootProject.buildDir&lt;br /&gt;}&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. In your Module build.gradle add&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
apply plugin: &#39;me.tatarka.retrolambda&#39;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
compileOptions {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; sourceCompatibility JavaVersion.VERSION_1_8&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; targetCompatibility JavaVersion.VERSION_1_8&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
apply plugin: &#39;com.android.application&#39;&lt;br /&gt;apply plugin: &#39;com.neenbedankt.android-apt&#39;&lt;br /&gt;apply plugin: &#39;me.tatarka.retrolambda&#39;&lt;br /&gt;android {&lt;br /&gt;&amp;nbsp; &amp;nbsp; compileSdkVersion 25&lt;br /&gt;&amp;nbsp; &amp;nbsp; buildToolsVersion &quot;25.0.1&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; defaultConfig {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ..&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; buildTypes {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; compileOptions {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sourceCompatibility JavaVersion.VERSION_1_8&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; targetCompatibility JavaVersion.VERSION_1_8&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;dependencies {&lt;br /&gt;&amp;nbsp;....&lt;br /&gt;}&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/7489695774873503387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/12/how-to-setup-android-studio-for-java-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7489695774873503387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7489695774873503387'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/12/how-to-setup-android-studio-for-java-8.html' title='How to setup Android Studio for Java 8'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-98070569075431635</id><published>2016-11-02T07:45:00.000-07:00</published><updated>2016-11-02T07:45:01.995-07:00</updated><title type='text'>How to fix Arduino WeMos D1  (platform esp8266, package esp8266) is unknown error</title><content type='html'>fix this go to the folder:&lt;br /&gt;
&lt;br /&gt;
C:\Users\[username]\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\&lt;br /&gt;
&lt;br /&gt;
delete the older version folder and everything works fine again.</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/98070569075431635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/11/how-to-fix-arduino-wemos-d1-platform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/98070569075431635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/98070569075431635'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/11/how-to-fix-arduino-wemos-d1-platform.html' title='How to fix Arduino WeMos D1  (platform esp8266, package esp8266) is unknown error'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-108362819389671833</id><published>2016-10-03T20:55:00.002-07:00</published><updated>2016-10-03T20:55:37.216-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CefSharp"/><title type='text'>Deploying CefSharp with ClickOnce and Could not load file or assembly &#39;CefSharp.Core.dll</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
Could not load file or assembly &#39;CefSharp.Core.dll&lt;/blockquote&gt;
&lt;br /&gt;
oh boy, it is a pain in the ass.&lt;br /&gt;
&lt;br /&gt;
It all started when I decided to use&amp;nbsp;CefSharp in my application. Problem was I was deploying my app though MS ClickOnce and deploying CefSharp and it&#39;s dependencies is a pain.&lt;br /&gt;
&lt;br /&gt;
1st lesson&lt;br /&gt;
&lt;br /&gt;
Do not add CefSharp and&amp;nbsp;Xilium.CefGlue to the project. They both use different versions of&amp;nbsp;&#39;CefSharp.Core.dll&#39; and when you deploy they replace&amp;nbsp;&#39;CefSharp.Core.dll&#39; with different version rather than the one you used for developments.&lt;br /&gt;
&lt;br /&gt;
2. When you install CefSharp, install cef.redist.x64 and&amp;nbsp;cef.redist.x86 via Package Manager&lt;br /&gt;
&lt;br /&gt;
3. We need to modify the project to&lt;br /&gt;
&lt;br /&gt;
1. Deploy CefSharp and it&#39;s all dependancies&lt;br /&gt;
&lt;br /&gt;
2. Deploy CefSharp runtime. Which is &amp;nbsp;VC++ 2013 for&amp;nbsp;51.0.0.0&lt;br /&gt;
&lt;br /&gt;
To do that:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Unload the main project. Right click -&amp;gt; Edit. Just before &amp;lt;/project&amp;gt; past following code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Copy CEF Stuff--&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Content Include=&quot;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\*&quot; Exclude=&quot;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\locales\**\*.pak&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Link&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/Link&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Visible&amp;gt;false&amp;lt;/Visible&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Content&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Resource Include=&quot;Readme.txt&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Content Include=&quot;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-GB.*;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\**\en-US.*&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Link&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/Link&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Visible&amp;gt;false&amp;lt;/Visible&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Content&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Content Include=&quot;$(SolutionDir)packages\cef.redist.x86.3.2704.1432\CEF\x86\**\*&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Link&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/Link&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Visible&amp;gt;false&amp;lt;/Visible&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Content&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Content Include=&quot;$(SolutionDir)packages\CefSharp.Common.51.0.0\CefSharp\x86\**\CefSharp.BrowserSubprocess.*&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Link&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/Link&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Visible&amp;gt;false&amp;lt;/Visible&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Content&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;!-- Copy C++ 13 x84 redistributables &amp;nbsp;--&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;Content Include=&quot;$(ProjectDir)..\External\Microsoft.VC120.CRT\**\*&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Link&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/Link&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Visible&amp;gt;false&amp;lt;/Visible&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/Content&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this project is using&amp;nbsp;cef.redist.x86.3.2704.1432, If you are using x64 you have to modify the above script.&lt;br /&gt;
&lt;br /&gt;
You need to copy Microsoft.VC120.CRT from&amp;nbsp;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT to a local folder and change &quot;$(ProjectDir)..\External\Microsoft.VC120.CRT\**\*&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/108362819389671833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/10/deploying-cefsharp-with-clickonce-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/108362819389671833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/108362819389671833'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/10/deploying-cefsharp-with-clickonce-and.html' title='Deploying CefSharp with ClickOnce and Could not load file or assembly &#39;CefSharp.Core.dll'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-1824860793975656867</id><published>2016-09-26T20:18:00.000-07:00</published><updated>2016-09-26T21:42:41.867-07:00</updated><title type='text'>How to get the Android device name (Settings-&gt;About-&gt;DeviceName) in Samsung ?</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsDcjbHqKCfs-LVhOxpQzaEdVFJLyxkFsrrboVWQzZsFV1PwQE2qhaIdAbPtBcztKkZMWgEP4oN_UZZ37-DhzEwCTINxCLo3a97z1VDr35teYTL1kzxSoDz6ICwiPL53893_A-gHT4FPgT/s1600/GQ8sp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsDcjbHqKCfs-LVhOxpQzaEdVFJLyxkFsrrboVWQzZsFV1PwQE2qhaIdAbPtBcztKkZMWgEP4oN_UZZ37-DhzEwCTINxCLo3a97z1VDr35teYTL1kzxSoDz6ICwiPL53893_A-gHT4FPgT/s320/GQ8sp.png&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I wanted to get the device name specified in&amp;nbsp;Settings-&amp;gt;About-&amp;gt;DeviceName but I did not see any method in Android SDK that you can call to obtain this information. why ? Because this is only specific to Samsung Android devices, &amp;nbsp;rather than a part of Android itself.&lt;br /&gt;
&lt;br /&gt;
So, how to get the device name ??&lt;br /&gt;
&lt;br /&gt;
1. i tried&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();&lt;br /&gt;
String deviceName = myDevice.getName();&lt;/blockquote&gt;
&lt;br /&gt;
This returns Galexy S5, useless&lt;br /&gt;
&lt;br /&gt;
2. &amp;nbsp;android.os.Build.MODEL;&lt;br /&gt;
&lt;br /&gt;
returns SM-G900H&lt;br /&gt;
&lt;br /&gt;
3. Had to go deep. then i remembered android has a system values database. which is located at&lt;br /&gt;
&lt;br /&gt;
So I pulled it from my Samsung and took a look&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
/data/data/com.android.providers.settings/databases/settings.db&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9snAQ5b319HK2d9WU1GLLTNbwpYHLtsCecyJs1il8zUU91Vxr3oJJk42q2cMIxZXPlId_gU_VHjZzr2KyK0h1V76Qj3EAtQ7IDiRZbMdBdMtS4yRUOkoPYA_d8MQg3HDtMBayiZR4liLv/s1600/settings.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9snAQ5b319HK2d9WU1GLLTNbwpYHLtsCecyJs1il8zUU91Vxr3oJJk42q2cMIxZXPlId_gU_VHjZzr2KyK0h1V76Qj3EAtQ7IDiRZbMdBdMtS4yRUOkoPYA_d8MQg3HDtMBayiZR4liLv/s320/settings.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
So, how to get this using shell&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
shell@k3g:/ $ settings get system device_name&lt;br /&gt;
settings get system device_name&lt;br /&gt;
Milky Way&lt;/blockquote&gt;
&lt;br /&gt;
Using java&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;String deviceName = Settings.System.getString(getContentResolver(), &quot;device_name&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Github project&lt;br /&gt;
https://github.com/kakopappa/getdevcicename/blob/master/README.md&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/1824860793975656867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/09/how-to-get-android-device-name-settings.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1824860793975656867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1824860793975656867'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/09/how-to-get-android-device-name-settings.html' title='How to get the Android device name (Settings-&gt;About-&gt;DeviceName) in Samsung ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsDcjbHqKCfs-LVhOxpQzaEdVFJLyxkFsrrboVWQzZsFV1PwQE2qhaIdAbPtBcztKkZMWgEP4oN_UZZ37-DhzEwCTINxCLo3a97z1VDr35teYTL1kzxSoDz6ICwiPL53893_A-gHT4FPgT/s72-c/GQ8sp.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1089315940126984688.post-2860421748197641646</id><published>2016-08-31T22:24:00.001-07:00</published><updated>2016-08-31T22:25:00.528-07:00</updated><title type='text'>Simple Android Job Scheduler class</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
import java.util.concurrent.Executor;&lt;br /&gt;
import java.util.concurrent.LinkedBlockingQueue;&lt;br /&gt;
import java.util.concurrent.ThreadPoolExecutor;&lt;br /&gt;
import java.util.concurrent.TimeUnit;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
public class ThreadPool {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final String TAG = &quot;ThreadPool&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final int CORE_POOL_SIZE = 4;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final int MAX_POOL_SIZE = 8;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final int KEEP_ALIVE_TIME = 10; // 10 seconds&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Resource type&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static final int MODE_NONE = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static final int MODE_CPU = 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static final int MODE_NETWORK = 2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static final JobContext JOB_CONTEXT_STUB = new JobContextStub();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ResourceCounter mCpuCounter = new ResourceCounter(2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ResourceCounter mNetworkCounter = new ResourceCounter(2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // A Job is like a Callable, but it has an addition JobContext parameter.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public interface Job&amp;lt;T&amp;gt; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public T run(JobContext jc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public interface JobContext {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; boolean isCancelled();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void setCancelListener(CancelListener listener);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; boolean setMode(int mode);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static class JobContextStub implements JobContext {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean isCancelled() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void setCancelListener(CancelListener listener) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean setMode(int mode) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public interface CancelListener {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onCancel();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static class ResourceCounter {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public ResourceCounter(int v) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value = v;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private final Executor mExecutor;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public ThreadPool() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mExecutor = new ThreadPoolExecutor(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TimeUnit.SECONDS, new LinkedBlockingQueue&amp;lt;Runnable&amp;gt;(),&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new PriorityThreadFactory(&quot;thread-pool&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android.os.Process.THREAD_PRIORITY_BACKGROUND));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Submit a job to the thread pool. The listener will be called when the&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // job is finished (or cancelled).&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public &amp;lt;T&amp;gt; Future&amp;lt;T&amp;gt; submit(Job&amp;lt;T&amp;gt; job, FutureListener&amp;lt;T&amp;gt; listener) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Worker&amp;lt;T&amp;gt; w = new Worker&amp;lt;T&amp;gt;(job, listener);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mExecutor.execute(w);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return w;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public &amp;lt;T&amp;gt; Future&amp;lt;T&amp;gt; submit(Job&amp;lt;T&amp;gt; job) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return submit(job, null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private class Worker&amp;lt;T&amp;gt; implements Runnable, Future&amp;lt;T&amp;gt;, JobContext {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static final String TAG = &quot;Worker&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private Job&amp;lt;T&amp;gt; mJob;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private FutureListener&amp;lt;T&amp;gt; mListener;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private CancelListener mCancelListener;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private ResourceCounter mWaitOnResource;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private volatile boolean mIsCancelled;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private boolean mIsDone;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private T mResult;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private int mMode;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Worker(Job&amp;lt;T&amp;gt; job, FutureListener&amp;lt;T&amp;gt; listener) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mJob = job;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mListener = listener;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This is called by a thread in the thread pool.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void run() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T result = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // A job is in CPU mode by default. setMode returns false&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // if the job is cancelled.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (setMode(MODE_CPU)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result = mJob.run(this);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Throwable ex) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log.w(TAG, &quot;Exception in running a job&quot;, ex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized(this) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setMode(MODE_NONE);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mResult = result;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mIsDone = true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; notifyAll();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mListener != null) mListener.onFutureDone(this);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Below are the methods for Future.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public synchronized void cancel() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mIsCancelled) return;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mIsCancelled = true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mWaitOnResource != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized (mWaitOnResource) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mWaitOnResource.notifyAll();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mCancelListener != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCancelListener.onCancel();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean isCancelled() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mIsCancelled;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public synchronized boolean isDone() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mIsDone;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public synchronized T get() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (!mIsDone) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wait();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception ex) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Log.w(TAG, &quot;ingore exception&quot;, ex);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ignore.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mResult;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void waitDone() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Below are the methods for JobContext (only called from the&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // thread running the job)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public synchronized void setCancelListener(CancelListener listener) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCancelListener = listener;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mIsCancelled &amp;amp;&amp;amp; mCancelListener != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCancelListener.onCancel();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean setMode(int mode) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Release old resource&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ResourceCounter rc = modeToCounter(mMode);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (rc != null) releaseResource(rc);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMode = MODE_NONE;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Acquire new resource&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc = modeToCounter(mode);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (rc != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!acquireResource(rc)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mMode = mode;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private ResourceCounter modeToCounter(int mode) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mode == MODE_CPU) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mCpuCounter;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (mode == MODE_NETWORK) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return mNetworkCounter;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private boolean acquireResource(ResourceCounter counter) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (true) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized (this) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mIsCancelled) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mWaitOnResource = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mWaitOnResource = counter;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized (counter) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (counter.value &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter.value--;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter.wait();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (InterruptedException ex) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ignore.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized (this) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mWaitOnResource = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void releaseResource(ResourceCounter counter) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; synchronized (counter) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter.value++;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; counter.notifyAll();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2860421748197641646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/08/simple-android-job-scheduler-class.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2860421748197641646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2860421748197641646'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/08/simple-android-job-scheduler-class.html' title='Simple Android Job Scheduler class'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-113698806743830255</id><published>2016-08-26T00:10:00.002-07:00</published><updated>2016-08-26T00:10:49.091-07:00</updated><title type='text'>How to run a single instance of the application or bring app to foreground using C#</title><content type='html'>&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp;static class Program&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [STAThread]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static void Main()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool createdNew;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (new Mutex(true, &quot;MyApp&quot;, out createdNew))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (createdNew) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.EnableVisualStyles();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.SetCompatibleTextRenderingDefault(false);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var mainClass = new SynGesturesLogic();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.ApplicationExit += mainClass.tray_exit;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.Run();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var current = Process.GetCurrentProcess();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var process in Process.GetProcessesByName(current.ProcessName).Where(process =&amp;gt; process.Id != current.Id))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NativeMethods.SetForegroundWindow(process.MainWindowHandle);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/113698806743830255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-run-single-instance-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/113698806743830255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/113698806743830255'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-run-single-instance-of.html' title='How to run a single instance of the application or bring app to foreground using C#'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-1932694686176371204</id><published>2016-08-11T00:52:00.000-07:00</published><updated>2016-08-11T00:52:16.885-07:00</updated><title type='text'>How to get the activity on top of the stack using android shell (adb shell)</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
adb shell dumpsys activity activities | busybox sed -En -e &#39;/Stack #/p&#39; -e &#39;/Running activities/,/Run #0/p&#39;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/1932694686176371204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-get-activity-on-top-of-stack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1932694686176371204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1932694686176371204'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-get-activity-on-top-of-stack.html' title='How to get the activity on top of the stack using android shell (adb shell)'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-9044507411799942560</id><published>2016-08-04T01:10:00.005-07:00</published><updated>2016-08-04T01:11:47.403-07:00</updated><title type='text'>How to check whether an audio file is Silk file ?</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
private static boolean isSilkV3File(String filePath) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;RandomAccessFile rFile = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rFile = new RandomAccessFile(filePath, &quot;r&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; byte[] bArr = new byte[9];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rFile.seek(1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rFile.read(bArr, 0, 9);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String headStr = new String(bArr);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (headStr.endsWith(&quot;#!SILK_V3&quot;)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e3) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if(rFile != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try { rFile.close(); } catch (IOException e) { }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/9044507411799942560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-check-whether-audio-file-is-silk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/9044507411799942560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/9044507411799942560'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-check-whether-audio-file-is-silk.html' title='How to check whether an audio file is Silk file ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-2956634555391165865</id><published>2016-08-02T20:33:00.001-07:00</published><updated>2016-08-02T20:33:22.259-07:00</updated><title type='text'>How to view table schema in SQLite</title><content type='html'>Normally you can&lt;br /&gt;
&lt;br /&gt;
sp_help &#39;&amp;lt;TableName&amp;gt;&#39; will give you the structure of a table in SQL Server but how to do this in SQLite ?&lt;br /&gt;
&lt;br /&gt;
Use&lt;br /&gt;
&lt;br /&gt;
PRAGMA table_info(&amp;lt;table_name&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
PRAGMA table_info(ImgInfo2)</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2956634555391165865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-view-table-schema-in-sqlite.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2956634555391165865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2956634555391165865'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/08/how-to-view-table-schema-in-sqlite.html' title='How to view table schema in SQLite'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-8846822498143877073</id><published>2016-07-12T02:30:00.003-07:00</published><updated>2016-07-12T02:30:49.216-07:00</updated><title type='text'>How to add current path to .bashrc</title><content type='html'>&lt;br /&gt;
Go to the path and then:&lt;br /&gt;
&lt;br /&gt;
echo &quot;export PATH=$(pwd):\${PATH}&quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/8846822498143877073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/07/how-to-add-current-path-to-bashrc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/8846822498143877073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/8846822498143877073'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/07/how-to-add-current-path-to-bashrc.html' title='How to add current path to .bashrc'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-896576932221979674</id><published>2016-03-23T20:32:00.003-07:00</published><updated>2016-03-23T20:32:59.149-07:00</updated><title type='text'>How to make a rounded bitmap in Android</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; public static Bitmap getRoundedBitmap(Bitmap bitmap, int i, int i2) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (bitmap == null) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Bitmap createBitmap = Bitmap.createBitmap(i, i2, bitmap.getConfig());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Canvas canvas = new Canvas(createBitmap);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Paint paint = new Paint();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; canvas.drawARGB(0, 0, 0, 0);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; paint.setAntiAlias(true);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; canvas.drawOval(0.0f, 0.0f, (float) i, (float) i2, paint);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int width = bitmap.getWidth();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int height = bitmap.getHeight();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float min = Math.min(((float) width) / ((float) i), ((float) height) / ((float) i2));&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i3 = (int) ((((float) i) * min) / 2.0f);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int i4 = (int) ((min * ((float) i2)) / 2.0f);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; canvas.drawBitmap(bitmap, new Rect((width / 2) - i3, (height / 2) - i4, (width / 2) + i3, (height / 2) + i4), new RectF(0.0f, 0.0f, (float) i, (float) i2), paint);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return createBitmap;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/896576932221979674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/03/how-to-make-rounded-bitmap-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/896576932221979674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/896576932221979674'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/03/how-to-make-rounded-bitmap-in-android.html' title='How to make a rounded bitmap in Android'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-2897035575085390114</id><published>2016-02-28T19:57:00.001-08:00</published><updated>2016-02-28T19:57:57.755-08:00</updated><title type='text'>How to change the auto rotation feature to potrait using adb shell ?</title><content type='html'>&lt;code class=&quot;cpp string&quot;&gt;content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0&lt;/code&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2897035575085390114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-change-auto-rotation-feature-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2897035575085390114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2897035575085390114'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-change-auto-rotation-feature-to.html' title='How to change the auto rotation feature to potrait using adb shell ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-6716479018235816451</id><published>2016-02-04T00:48:00.003-08:00</published><updated>2016-08-02T20:33:51.030-07:00</updated><title type='text'>how to turn mobile data on or off using adb shell root</title><content type='html'>root@j2lte:/ # svc data&lt;br /&gt;
Control mobile data connectivity&lt;br /&gt;
&lt;br /&gt;
usage: svc data [enable|disable]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Turn mobile data on or off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
root@j2lte:/ # svc data enable&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/6716479018235816451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-turn-mobile-data-on-or-off-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/6716479018235816451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/6716479018235816451'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-turn-mobile-data-on-or-off-using.html' title='how to turn mobile data on or off using adb shell root'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-7307049394142147159</id><published>2016-02-04T00:44:00.002-08:00</published><updated>2016-02-04T00:44:58.473-08:00</updated><title type='text'>how to switch off or reboot phone using root ?</title><content type='html'>root@j2lte:/ # svc power&lt;br /&gt;Control the power manager&lt;br /&gt;&lt;br /&gt;usage: svc power stayon [true|false|usb|ac|wireless]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set the &#39;keep awake while plugged in&#39; setting.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; svc power reboot [reason]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Perform a runtime shutdown and reboot device with specified reason.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; svc power shutdown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Perform a runtime shutdown and power off the device.&lt;br /&gt;&lt;br /&gt;root@j2lte:/ # svc power reboot becauseican</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/7307049394142147159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-switch-off-or-reboot-phone-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7307049394142147159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7307049394142147159'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/02/how-to-switch-off-or-reboot-phone-using.html' title='how to switch off or reboot phone using root ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-1954270070190573789</id><published>2016-02-01T01:31:00.000-08:00</published><updated>2016-02-01T01:31:54.599-08:00</updated><title type='text'>Unable to load DLL (Module could not be found HRESULT: 0x8007007E)</title><content type='html'>I am using a .dll file that is written using C++ in my C# application. When I deployed it test PC I started seeing this error in Event Log.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, I used Dependency Walker to check the missing dependencies and I was missing `msvcp110d.dll` and `msvcr110d.dll` in the test PC&lt;br /&gt;&lt;br /&gt;I copied these two files from my dev PC to test PC&#39;s `C:\Windows\SysWOW64`&amp;nbsp; PC and worked!</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/1954270070190573789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/02/unable-to-load-dll-module-could-not-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1954270070190573789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/1954270070190573789'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/02/unable-to-load-dll-module-could-not-be.html' title='Unable to load DLL (Module could not be found HRESULT: 0x8007007E)'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-2267066517335185771</id><published>2016-01-09T03:27:00.005-08:00</published><updated>2016-01-09T03:27:43.426-08:00</updated><title type='text'>Transmission daemon overwrites settings.json to the default in Raspberry Pi</title><content type='html'>sudo /etc/init.d/transmission-daemon stop&lt;br /&gt;
&lt;br /&gt;
cd /var/lib/transmission-daemon/info&lt;br /&gt;
sudo nano settings.json&lt;br /&gt;
&lt;br /&gt;
Change&amp;nbsp;&quot;rpc-authentication-required&quot;: false,&lt;br /&gt;
&lt;br /&gt;
cd /etc/transmission-daemon&lt;br /&gt;
sudo nano settings.json&lt;br /&gt;
&lt;br /&gt;
Change&amp;nbsp;&quot;rpc-authentication-required&quot;: false,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sudo /etc/init.d/transmission-daemon start</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2267066517335185771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/01/transmission-daemon-overwrites.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2267066517335185771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2267066517335185771'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/01/transmission-daemon-overwrites.html' title='Transmission daemon overwrites settings.json to the default in Raspberry Pi'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-5324562668463672232</id><published>2016-01-06T00:53:00.000-08:00</published><updated>2016-01-06T00:53:02.324-08:00</updated><title type='text'>Android sh script error &quot;[: not found&quot; or incorrect systax if;</title><content type='html'>One of the scripts i was working suddenly starting showing Android sh script error &quot;[: not found&quot; or incorrect systax if; errors out of blue. I couldn&#39;t figure out what just went wrong.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Reson is file format and line ending. To fix this in NotePad ++&lt;br /&gt;
&lt;br /&gt;
Edit -&amp;gt; EOL Conversion -&amp;gt; Unix&lt;br /&gt;
Encoding -&amp;gt; Encode in ANSI&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/5324562668463672232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/01/android-sh-script-error-not-found-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5324562668463672232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/5324562668463672232'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/01/android-sh-script-error-not-found-or.html' title='Android sh script error &quot;[: not found&quot; or incorrect systax if;'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-2413548140231179938</id><published>2016-01-05T21:41:00.002-08:00</published><updated>2016-01-05T21:41:23.288-08:00</updated><title type='text'>How to write to Android LogCat via adb shell ?</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
log&amp;nbsp; -p i -t yourtag &quot;see this in logcat&quot;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
yourtag = is the tag for LogCat</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/2413548140231179938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2016/01/how-to-write-to-android-logcat-via-adb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2413548140231179938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/2413548140231179938'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2016/01/how-to-write-to-android-logcat-via-adb.html' title='How to write to Android LogCat via adb shell ?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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-1089315940126984688.post-7553017215898256048</id><published>2015-11-18T01:39:00.001-08:00</published><updated>2015-11-18T01:45:21.425-08:00</updated><title type='text'>How to open Google Settings app programmatically?</title><content type='html'>&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;/blockquote&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;175&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; GOOGLE_SETTINGS_COMPONENT &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;com.google.android.gms&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;176&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; GOOGLE_SETTINGS_ACTIVITY &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;.app.settings.GoogleSettingsActivity&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1319&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;        i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setClassName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;GOOGLE_SETTINGS_COMPONENT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1320&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;                GOOGLE_SETTINGS_COMPONENT &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; GOOGLE_SETTINGS_ACTIVITY&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1321&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1322&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;            startActivity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1323&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ActivityNotFoundException&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ex&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class=&quot;FileContents&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;td class=&quot;FileContents-lineContents&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;1324&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pln&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// &amp;nbsp; activity not found.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;u-pre u-monospace FileContents-line&quot;&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidbridge.blogspot.com/feeds/7553017215898256048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidbridge.blogspot.com/2015/11/how-to-open-google-settings-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7553017215898256048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1089315940126984688/posts/default/7553017215898256048'/><link rel='alternate' type='text/html' href='http://androidbridge.blogspot.com/2015/11/how-to-open-google-settings-app.html' title='How to open Google Settings app programmatically?'/><author><name>Aruna Tennakoon</name><uri>http://www.blogger.com/profile/13691654998632008962</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>