<?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-2104108011617545171</id><updated>2024-10-25T13:38:27.801+08:00</updated><category term="android"/><category term="Ubuntu"/><category term="application"/><category term="shell"/><category term="tips"/><category term="adb"/><category term="Build"/><category term="Environment"/><category term="emulator"/><category term="vi"/><category term="Eclipse"/><category term="Google API"/><category term="M$"/><category term="Manifest"/><category term="Remote desktop"/><category term="SDCard"/><category term="SSH"/><category term="activity"/><category term="alertdialog"/><category term="apn"/><category term="connectivity"/><category term="cscope"/><category term="droiddoc"/><category term="error"/><category term="file system"/><category term="git"/><category term="phone"/><category term="sdk"/><category term="sign"/><category term="skin"/><category term="sqlite"/><category term="vim"/><category term="vsftp"/><title type='text'>Android experiences</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2104108011617545171.post-8473150088706860545</id><published>2013-09-06T13:54:00.000+08:00</published><updated>2014-12-31T08:57:43.137+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cscope"/><category scheme="http://www.blogger.com/atom/ns#" term="vi"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Note for cscope and vim</title><content type='html'>&lt;b&gt;How to install cscope:&lt;/b&gt;&lt;br /&gt;
sudo apt-get install cscope&lt;br /&gt;
mkdir -p ~/.vim/plugin&lt;br /&gt;
cd ~/.vim/plugin&lt;br /&gt;
wget http://cscope.sourceforge.net/cscope_maps.vim&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to create the index:&lt;/b&gt;&lt;br /&gt;
cscope -bR&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to find file:&lt;/b&gt;&lt;br /&gt;
:cs f f &amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Useful command:&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;CTRL+]&lt;/i&gt; &lt;br /&gt;
Go to function definition.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;CTRL+ O&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
Back to the previous place.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;]]&lt;/i&gt;&lt;br /&gt;
Go to the start of this function&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;[[&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
Go to the end of this function&lt;br /&gt;
&lt;br /&gt;
Ctrl&amp;nbsp;+ \ and press &#39;s&#39;&lt;br /&gt;
Find all references.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference:&lt;/b&gt;&lt;br /&gt;
用 vim 和 cscope 來 trace 程式碼&lt;br /&gt;
&lt;a href=&quot;http://softsmith.blogspot.tw/2009/01/vim-cscope-trace.html&quot;&gt;http://softsmith.blogspot.tw/2009/01/vim-cscope-trace.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/8473150088706860545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2013/09/note-for-cscope-and-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8473150088706860545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8473150088706860545'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2013/09/note-for-cscope-and-vim.html' title='Note for cscope and vim'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-585617073435864175</id><published>2013-09-06T11:08:00.001+08:00</published><updated>2013-09-06T11:08:30.235+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="application"/><category scheme="http://www.blogger.com/atom/ns#" term="phone"/><title type='text'>How to make a call for last outgoing casll from application</title><content type='html'>String dialNumber = CallLog.Calls.getLastOutgoingCall(getApplicationContext());&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
if (dialNumber != &quot;&quot;) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; dialNumber = &quot;tel:&quot;+dialNumber;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Intent dial = new Intent();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;dial.setAction(&quot;android.intent.action.CALL&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;dial.setData(Uri.parse(dialNumber));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;dial.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;startActivity(dial);&lt;/div&gt;
&lt;div&gt;
} else {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;Log.e(TAG, &quot;no last outgoing call&quot;);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/585617073435864175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2013/09/how-to-make-call-for-last-outgoing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/585617073435864175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/585617073435864175'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2013/09/how-to-make-call-for-last-outgoing.html' title='How to make a call for last outgoing casll from application'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-6585501429289348093</id><published>2013-08-29T17:23:00.000+08:00</published><updated>2013-08-29T17:23:17.237+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="application"/><title type='text'>How to get the package name and intent of installed apps</title><content type='html'>PackageManager pm = getPackageManager();&lt;br /&gt;
List&amp;lt;ApplicationInfo&amp;gt;packages = m.getInstalledApplications(PackageManager.GET_META_DATA);&lt;br /&gt;
for (ApplicationInfo packageInfo : packages) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(TAG, &quot;Installed package :&quot; + packageInfo.packageName);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(TAG, &quot;Launch Activity :&quot; + pm.getLaunchIntentForPackage(packageInfo.packageName));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference:&lt;/b&gt;&lt;br /&gt;
How to launch another app from your app.&lt;br /&gt;
&lt;a href=&quot;http://qtcstation.com/2011/02/how-to-launch-another-app-from-your-app/&quot;&gt;http://qtcstation.com/2011/02/how-to-launch-another-app-from-your-app/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/6585501429289348093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2013/08/how-to-get-package-name-and-intent-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/6585501429289348093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/6585501429289348093'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2013/08/how-to-get-package-name-and-intent-of.html' title='How to get the package name and intent of installed apps'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-40854895016546211</id><published>2013-01-19T11:30:00.000+08:00</published><updated>2013-01-19T11:37:08.515+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="application"/><title type='text'>Sharing the application development experience part 2</title><content type='html'>&lt;span style=&quot;font-family: Calibri; font-size: large; text-align: -webkit-auto;&quot;&gt;1. Framework will give you the exception unexpected.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;In&amp;nbsp;&lt;a href=&quot;http://developer.android.com/&quot;&gt;http://developer.android.com&lt;/a&gt;, it mentioned that if you use some APIs, it may throws exception, developer should noticed that catch this exception properly. However, framework will sometimes throw the exception unexpected, developer should also take care about this. In normal use case, you may not meet this problem, but once the system is going to busy and trigger some memory killer event. The best way to avoid such problem, you should look into the source code of APIs that you used in the app. It will make your app more robust and stable.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;2. Handle click event carefully.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;In your app, you may use different button in the same activity and you know you should handle these click event. But you may not know sometimes, the event is not come one by one. If one click event will make some other click event go into invalid state, you should take care about it. For example, if you want to handle click event one by one, you should have the mechanism to avoid the multiple click event come&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #222222; font-family: Calibri; font-weight: normal; margin: 0px; overflow: hidden; padding: 0px; text-overflow: ellipsis; white-space: nowrap;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;
simultaneously.&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;3. Take care of dialog&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Dialog needs the context object to show or dismss. If your app may use this dialog in backgorund, you should make sure the context is really existed or not, otherwise user may meet force close issue. Actually, the best way is that you should take care of the dialog by different activity life cycle.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/40854895016546211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2013/01/sharing-application-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/40854895016546211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/40854895016546211'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2013/01/sharing-application-development.html' title='Sharing the application development experience part 2'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-8910403850186788712</id><published>2012-08-06T17:39:00.001+08:00</published><updated>2012-08-06T17:40:29.304+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="alertdialog"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="application"/><title type='text'>how to catch the dialog dismiss</title><content type='html'>It is a very simple example and I just want to put here because many AlertDialog example doesn&#39;t mention this.&lt;br /&gt;
&lt;br /&gt;
AlertDialog al = new AlertDialog.Builder(this)&lt;br /&gt;
.setTitle(&quot;Title&quot;)&lt;br /&gt;
.setSingleChoiceItems(adapter, 0, new DialogInterface.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void onClick(DialogInterface dialog, int whichButton) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //do something when pressing the list item.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
})&lt;br /&gt;
.setPositiveButton(&quot;Done&quot;, new DialogInterface.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void onClick(DialogInterface dialog,&amp;nbsp;int whichButton) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //do something when pressing the Done button.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}).create();&lt;br /&gt;
al.show();&lt;br /&gt;
al.setOnDismissListener(new OnDismissListener() { &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; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;&amp;nbsp; &amp;nbsp; public void onDismiss(DialogInterface dialog) {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt;&amp;nbsp;   &lt;/span&gt;//do something when the dialog dismiss.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
});</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/8910403850186788712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2012/08/how-to-catch-dialog-dismiss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8910403850186788712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8910403850186788712'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2012/08/how-to-catch-dialog-dismiss.html' title='how to catch the dialog dismiss'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-3800309403946711233</id><published>2012-05-22T09:50:00.000+08:00</published><updated>2013-01-19T11:30:06.364+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="application"/><title type='text'>Sharing the application development experience</title><content type='html'>&lt;br /&gt;
&lt;div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span style=&quot;border-collapse: separate; border-spacing: 0px; font-family: Tahoma; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 16px;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Create the application is very easy but create the excellent application is not easy. I want to share the experience for you. If you have any question or other experience you want to share with us, please reply here.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0mm; margin-top: 0mm;&quot;&gt;
&lt;li style=&quot;font-family: Calibri; font-size: 12pt; margin-left: -7pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;You must understand the usage of the API if you want to use.&lt;/span&gt;&lt;ol style=&quot;margin-bottom: 0mm; margin-top: 0mm;&quot; type=&quot;A&quot;&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;At least you should know why you use this API.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;If you are in the activity, you must understand the life cycle of activity.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;If you are in the service, you must understand the life cycle of service.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;If you can not understand the explain from Android official website, you should directly check the source code of framework.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: Calibri; font-size: 12pt; margin-left: -7pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;You must consider the ANR problem.&lt;/span&gt;&lt;ol style=&quot;margin-bottom: 0mm; margin-top: 0mm;&quot; type=&quot;A&quot;&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;You can refer to&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/practices/design/responsiveness.html&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;u&gt;http://developer.android.com/guide/practices/design/responsiveness.html&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;If you want to do any operation that may consume much time, you must consider it and don’t just do it in main thread.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: Calibri; font-size: 12pt; margin-left: -7pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;You can use log more smart.&lt;/span&gt;&lt;ol style=&quot;margin-bottom: 0mm; margin-top: 0mm;&quot; type=&quot;A&quot;&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;You should use the flag to control your log.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;Log level is very useful.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;Just need to show the key log in the shipped software.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;font-family: Calibri; font-size: 12pt; margin-left: -7pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;You must remove unnecessary code of this application.&lt;/span&gt;&lt;ol style=&quot;margin-bottom: 0mm; margin-top: 0mm;&quot; type=&quot;A&quot;&gt;
&lt;li style=&quot;font-size: 12pt; margin-left: -2pt; margin-right: 0pt; padding-left: 0pt;&quot;&gt;&lt;span style=&quot;color: white; font-family: Calibri;&quot;&gt;Same as item 1, if you don’t understand what you do, the best solution is DON’T USE IT.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/3800309403946711233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2012/05/sharing-application-developement.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3800309403946711233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3800309403946711233'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2012/05/sharing-application-developement.html' title='Sharing the application development experience'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-3896598415158636312</id><published>2012-02-23T16:44:00.002+08:00</published><updated>2012-03-05T19:03:15.028+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="file system"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>How to support exFAT on ubuntu</title><content type='html'>&lt;em style=&quot;background-color: black; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;sudo apt-add-repository ppa:relan/exfat&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em style=&quot;background-color: black; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt; sudo apt-get update&lt;br /&gt;
sudo apt-get install fuse-exfat&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: black; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: small; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Success on 11.04&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: small; line-height: 18px;&quot;&gt;&lt;b style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;If you use 10.04, you should continue below.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: small; line-height: 18px;&quot;&gt;&lt;b style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Success on 10.04&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small; line-height: 18px;&quot;&gt;sudo mkdir /media/Data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small; line-height: 18px;&quot;&gt;sudo mount -t exfat-fuse /dev/sda6 /media/Data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;[Unmount]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;sudo umount /media/Data&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: white; line-height: 18px;&quot;&gt;&lt;b style=&quot;background-color: black;&quot;&gt;Note:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: black; color: white; line-height: 18px;&quot;&gt;&#39;/dev/sda6/ is Device ID, please check in System -&amp;gt; Administration -&amp;gt; &amp;nbsp;Disk Utility.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/3896598415158636312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2012/02/how-to-support-exfat-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3896598415158636312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3896598415158636312'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2012/02/how-to-support-exfat-on-ubuntu.html' title='How to support exFAT on ubuntu'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-3504463772339431419</id><published>2011-09-02T20:49:00.002+08:00</published><updated>2011-09-02T20:49:41.711+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="sign"/><title type='text'>How to sign apk</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: black; color: white;&quot;&gt;java -jar out/host/linux-x86/framework/signapk.jar build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 Test.apk.unsigned Test.apk&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/3504463772339431419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/09/how-to-sign-apk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3504463772339431419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3504463772339431419'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/09/how-to-sign-apk.html' title='How to sign apk'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-1472881957213924451</id><published>2011-08-19T19:31:00.002+08:00</published><updated>2011-08-19T19:31:12.755+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>How to beep</title><content type='html'>&lt;br /&gt;
sudo modprobe pcspkr&lt;br /&gt;
beep&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/1472881957213924451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/08/how-to-beep.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/1472881957213924451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/1472881957213924451'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/08/how-to-beep.html' title='How to beep'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-7884712365568116117</id><published>2011-03-17T09:09:00.000+08:00</published><updated>2011-03-17T09:09:35.136+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Build"/><category scheme="http://www.blogger.com/atom/ns#" term="M$"/><title type='text'>Get Android source code in M$ Windows</title><content type='html'>&lt;span style=&quot;color: red;&quot;&gt;(Updated in 20110317)&lt;/span&gt;&lt;br /&gt;
Link to &lt;a href=&quot;http://code.google.com/p/msysgit/&quot;&gt;http://code.google.com/p/msysgit/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Download the Git application as below red rectangle.&lt;br /&gt;
&lt;img alt=&quot;git&quot; class=&quot;alignnone size-full wp-image-104&quot; height=&quot;103&quot; src=&quot;http://bradchow.files.wordpress.com/2009/01/git.jpg&quot; title=&quot;git&quot; width=&quot;436&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Keep pressing next to install Git. (Very easy!!)&lt;br /&gt;
Execute Git by Git bash&lt;br /&gt;
Create a directory to get the Android source code and copy &quot;autogit.sh&quot; to android_source folder&lt;br /&gt;
cd /c&lt;br /&gt;
mkdir android_source&lt;br /&gt;
cd android_source&lt;br /&gt;
sh &lt;a href=&quot;https://docs.google.com/leaf?id=0B1KLYLroMk--NjNiYzdjZDYtYzhmZS00OWMwLTkyOGQtMDE1YTRiMTQyNDhi&amp;amp;hl=en&amp;amp;authkey=CO2zxY8J&quot;&gt;autogit.sh&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
(Need about 13.7 GB)&lt;br /&gt;
&lt;br /&gt;
autogit.sh is created by me and reference by &lt;a href=&quot;http://android.git.kernel.org/?a=project_index&quot;&gt;http://android.git.kernel.org/?a=project_index&lt;/a&gt;&lt;br /&gt;
There are 163 projects in Android open source project.&lt;br /&gt;
If the structure of this project is modified, please tell me to modify autogit.sh.&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
&lt;a href=&quot;http://ysl-paradise.blogspot.com/2008/10/windows-android.html&quot;&gt;如何在 Windows 平台上下載 Android 的原始碼？&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/7884712365568116117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/01/get-android-source-code-in-m-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/7884712365568116117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/7884712365568116117'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/01/get-android-source-code-in-m-windows.html' title='Get Android source code in M$ Windows'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-202991543686739785</id><published>2011-02-23T15:08:00.000+08:00</published><updated>2011-02-23T15:08:56.527+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><title type='text'>shell script - test</title><content type='html'>&lt;b&gt;Check if the string is null&lt;/b&gt;&lt;br /&gt;
test -z $var &amp;amp;&amp;amp; echo &quot;The string is null&quot; || echo &quot;The string is not null&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check if the var1 is greater than var2&lt;/b&gt;&lt;br /&gt;
test $var1 -gt $var2&amp;nbsp;&amp;amp;&amp;amp; echo &quot;var1 &amp;gt; var2&quot; || echo &quot;var1 &amp;lt; var2&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check if value is 0&lt;/b&gt;&lt;br /&gt;
test $var -eq 0&amp;nbsp;&amp;amp;&amp;amp; echo &quot;var1 is 0&quot; || echo &quot;var1 is not 0&quot;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/202991543686739785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/02/shell-script-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/202991543686739785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/202991543686739785'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/02/shell-script-test.html' title='shell script - test'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-5399886622344797041</id><published>2011-02-22T11:30:00.000+08:00</published><updated>2011-02-22T11:30:17.739+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><title type='text'>shell script function</title><content type='html'>&lt;b&gt;No parameter&lt;/b&gt;&lt;br /&gt;
function_name() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;statement&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;call function&lt;/b&gt;&lt;br /&gt;
function_name&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;b&gt;Parameter&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;function_name() {&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var=$1&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var2=$2&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;call function&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;function_name arg1 arg2&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Return value (1)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;function_name() {&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;statement&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 2&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;call function&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;echo &quot;Return is: $?&quot;&lt;/div&gt;&lt;div style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Return value (2)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;function_name() {&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;statement&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return $RET&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;call function&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;echo &quot;Return is: &lt;/div&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;$RET&quot;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-weight: normal;&quot;&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/5399886622344797041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/02/shell-script-function.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5399886622344797041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5399886622344797041'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/02/shell-script-function.html' title='shell script function'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-5901030044418506383</id><published>2011-02-21T20:25:00.000+08:00</published><updated>2011-02-21T20:25:46.557+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adb"/><title type='text'>send intent and key event by adb</title><content type='html'>&lt;b&gt;Send intent&lt;/b&gt;&lt;br /&gt;
adb shell am start -a [intent] -n [class]&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
open Message application&lt;br /&gt;
adb shell am start -a android.intent.action.MAIN -n com.android.mms/.ui.ConversationList&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Send key event&lt;/b&gt;&lt;br /&gt;
adb shell input keyevent 7 # for key &#39;0&#39;&lt;br /&gt;
&lt;br /&gt;
also can send string as a text,&lt;br /&gt;
adb shell input text &quot;ANDROID&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: verdana; font-size: 14px; line-height: 24px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;0 --&amp;gt;  &quot;KEYCODE_UNKNOWN&quot;
1 --&amp;gt;  &quot;KEYCODE_MENU&quot;
2 --&amp;gt;  &quot;KEYCODE_SOFT_RIGHT&quot;
3 --&amp;gt;  &quot;KEYCODE_HOME&quot;
4 --&amp;gt;  &quot;KEYCODE_BACK&quot;
5 --&amp;gt;  &quot;KEYCODE_CALL&quot;
6 --&amp;gt;  &quot;KEYCODE_ENDCALL&quot;
7 --&amp;gt;  &quot;KEYCODE_0&quot;
8 --&amp;gt;  &quot;KEYCODE_1&quot;
9 --&amp;gt;  &quot;KEYCODE_2&quot;
10 --&amp;gt;  &quot;KEYCODE_3&quot;
11 --&amp;gt;  &quot;KEYCODE_4&quot;
12 --&amp;gt;  &quot;KEYCODE_5&quot;
13 --&amp;gt;  &quot;KEYCODE_6&quot;
14 --&amp;gt;  &quot;KEYCODE_7&quot;
15 --&amp;gt;  &quot;KEYCODE_8&quot;
16 --&amp;gt;  &quot;KEYCODE_9&quot;
17 --&amp;gt;  &quot;KEYCODE_STAR&quot;
18 --&amp;gt;  &quot;KEYCODE_POUND&quot;
19 --&amp;gt;  &quot;KEYCODE_DPAD_UP&quot;
20 --&amp;gt;  &quot;KEYCODE_DPAD_DOWN&quot;
21 --&amp;gt;  &quot;KEYCODE_DPAD_LEFT&quot;
22 --&amp;gt;  &quot;KEYCODE_DPAD_RIGHT&quot;
23 --&amp;gt;  &quot;KEYCODE_DPAD_CENTER&quot;
24 --&amp;gt;  &quot;KEYCODE_VOLUME_UP&quot;
25 --&amp;gt;  &quot;KEYCODE_VOLUME_DOWN&quot;
26 --&amp;gt;  &quot;KEYCODE_POWER&quot;
27 --&amp;gt;  &quot;KEYCODE_CAMERA&quot;
28 --&amp;gt;  &quot;KEYCODE_CLEAR&quot;
29 --&amp;gt;  &quot;KEYCODE_A&quot;
30 --&amp;gt;  &quot;KEYCODE_B&quot;
31 --&amp;gt;  &quot;KEYCODE_C&quot;
32 --&amp;gt;  &quot;KEYCODE_D&quot;
33 --&amp;gt;  &quot;KEYCODE_E&quot;
34 --&amp;gt;  &quot;KEYCODE_F&quot;
35 --&amp;gt;  &quot;KEYCODE_G&quot;
36 --&amp;gt;  &quot;KEYCODE_H&quot;
37 --&amp;gt;  &quot;KEYCODE_I&quot;
38 --&amp;gt;  &quot;KEYCODE_J&quot;
39 --&amp;gt;  &quot;KEYCODE_K&quot;
40 --&amp;gt;  &quot;KEYCODE_L&quot;
41 --&amp;gt;  &quot;KEYCODE_M&quot;
42 --&amp;gt;  &quot;KEYCODE_N&quot;
43 --&amp;gt;  &quot;KEYCODE_O&quot;
44 --&amp;gt;  &quot;KEYCODE_P&quot;
45 --&amp;gt;  &quot;KEYCODE_Q&quot;
46 --&amp;gt;  &quot;KEYCODE_R&quot;
47 --&amp;gt;  &quot;KEYCODE_S&quot;
48 --&amp;gt;  &quot;KEYCODE_T&quot;
49 --&amp;gt;  &quot;KEYCODE_U&quot;
50 --&amp;gt;  &quot;KEYCODE_V&quot;
51 --&amp;gt;  &quot;KEYCODE_W&quot;
52 --&amp;gt;  &quot;KEYCODE_X&quot;
53 --&amp;gt;  &quot;KEYCODE_Y&quot;
54 --&amp;gt;  &quot;KEYCODE_Z&quot;
55 --&amp;gt;  &quot;KEYCODE_COMMA&quot;
56 --&amp;gt;  &quot;KEYCODE_PERIOD&quot;
57 --&amp;gt;  &quot;KEYCODE_ALT_LEFT&quot;
58 --&amp;gt;  &quot;KEYCODE_ALT_RIGHT&quot;
59 --&amp;gt;  &quot;KEYCODE_SHIFT_LEFT&quot;
60 --&amp;gt;  &quot;KEYCODE_SHIFT_RIGHT&quot;
61 --&amp;gt;  &quot;KEYCODE_TAB&quot;
62 --&amp;gt;  &quot;KEYCODE_SPACE&quot;
63 --&amp;gt;  &quot;KEYCODE_SYM&quot;
64 --&amp;gt;  &quot;KEYCODE_EXPLORER&quot;
65 --&amp;gt;  &quot;KEYCODE_ENVELOPE&quot;
66 --&amp;gt;  &quot;KEYCODE_ENTER&quot;
67 --&amp;gt;  &quot;KEYCODE_DEL&quot;
68 --&amp;gt;  &quot;KEYCODE_GRAVE&quot;
69 --&amp;gt;  &quot;KEYCODE_MINUS&quot;
70 --&amp;gt;  &quot;KEYCODE_EQUALS&quot;
71 --&amp;gt;  &quot;KEYCODE_LEFT_BRACKET&quot;
72 --&amp;gt;  &quot;KEYCODE_RIGHT_BRACKET&quot;
73 --&amp;gt;  &quot;KEYCODE_BACKSLASH&quot;
74 --&amp;gt;  &quot;KEYCODE_SEMICOLON&quot;
75 --&amp;gt;  &quot;KEYCODE_APOSTROPHE&quot;
76 --&amp;gt;  &quot;KEYCODE_SLASH&quot;
77 --&amp;gt;  &quot;KEYCODE_AT&quot;
78 --&amp;gt;  &quot;KEYCODE_NUM&quot;
79 --&amp;gt;  &quot;KEYCODE_HEADSETHOOK&quot;
80 --&amp;gt;  &quot;KEYCODE_FOCUS&quot;
81 --&amp;gt;  &quot;KEYCODE_PLUS&quot;
82 --&amp;gt;  &quot;KEYCODE_MENU&quot;
83 --&amp;gt;  &quot;KEYCODE_NOTIFICATION&quot;
84 --&amp;gt;  &quot;KEYCODE_SEARCH&quot;
85 --&amp;gt;  &quot;TAG_LAST_KEYCODE&quot;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/5901030044418506383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/02/send-intent-and-key-event-by-adb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5901030044418506383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5901030044418506383'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/02/send-intent-and-key-event-by-adb.html' title='send intent and key event by adb'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-7224238008597639093</id><published>2011-02-18T01:08:00.000+08:00</published><updated>2011-02-17T09:40:33.851+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>grep</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;-i, --ignore-case&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Ignore case distinctions in both the PATTERN and the input files.  (-i is specified by POSIX.)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;-R, -r, --recursive&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Read all files under each directory, recursively; this is equivalent to the -d recurse option.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;-v, --invert-match&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Invert the sense of matching, to select non-matching lines.  (-v is specified by POSIX.)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;-w, --word-regexp&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Select only those lines containing matches that form whole words.  The test is that  the  matching  substring  must  either  be  at  the beginning of the line, or preceded by a non-word constituent character.  Similarly, it must be either at the end of the line or followed by a non-word constituent character.  Word-constituent characters are letters, digits, and the underscore.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; line-height: 24px;&quot;&gt;-A&amp;nbsp;NUM，--after-context=NUM&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;Print NUM lines of trailing context after matching lines.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;Places a line containing a group separator (--) between&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp;contiguous groups of matches. With the -o or&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp;--only-matching option, this has no effect and a warning is&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;given.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; line-height: 24px;&quot;&gt;-C&amp;nbsp;[NUM],&amp;nbsp;-NUM,&amp;nbsp;--context[=NUM]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;Print NUM lines of output context. Places a line&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp;containing a group separator (--) between contiguous groups&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;of matches. With the -o or --only-matching option, this&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;&amp;nbsp;has no effect and a warning is given.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/7224238008597639093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2010/04/grep.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/7224238008597639093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/7224238008597639093'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2010/04/grep.html' title='grep'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-3289707797369693871</id><published>2011-01-12T19:45:00.000+08:00</published><updated>2011-01-24T10:08:37.775+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>git</title><content type='html'>git diff&lt;br/&gt;find the different between local and server.&lt;br/&gt;&lt;br/&gt;git diff .&lt;br/&gt;find the different between . and server.&lt;br/&gt;&lt;br/&gt;git reset --hard&lt;br/&gt;all the changes are lost.&lt;br/&gt;&lt;br/&gt;git reset --hard HEAD~2&lt;br/&gt;reset to previous 2 commit&lt;br/&gt;&lt;br/&gt;git reset --hard &lt;br/&gt;reset to commit-id&lt;br/&gt;&lt;br/&gt;git pull&lt;br/&gt;sync code&lt;br/&gt;&lt;br/&gt;git branch -f  &lt;br/&gt;change branch&lt;br/&gt;&lt;br/&gt;git checkout &lt;br/&gt;check out</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/3289707797369693871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/01/git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3289707797369693871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3289707797369693871'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/01/git.html' title='git'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-8166887022906674966</id><published>2011-01-12T19:39:00.000+08:00</published><updated>2011-01-24T10:08:37.778+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>count from file output</title><content type='html'>cat file | cut -f 1 | awk &#39;{tot=tot+$1} END {print tot}&#39;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/8166887022906674966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2011/01/count-from-file-output.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8166887022906674966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/8166887022906674966'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2011/01/count-from-file-output.html' title='count from file output'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-4742844715334749118</id><published>2010-08-09T14:43:00.000+08:00</published><updated>2011-01-24T10:08:37.782+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="SDCard"/><title type='text'>Check if SD card storage is available</title><content type='html'>&lt;code&gt;public static boolean hasStorage(boolean requireWriteAccess) {  &lt;br/&gt;    String state = Environment.getExternalStorageState();  &lt;br/&gt;  &lt;br/&gt;    if (Environment.MEDIA_MOUNTED.equals(state)) {  &lt;br/&gt;        return true;  &lt;br/&gt;    } else if (!requireWriteAccess  &lt;br/&gt;            &amp;amp;&amp;amp; Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {  &lt;br/&gt;        return true;  &lt;br/&gt;    }  &lt;br/&gt;    return false;  &lt;br/&gt;}  &lt;/code&gt;&lt;br/&gt;&lt;br/&gt;Reference:&lt;br/&gt;&lt;a href=&quot;http://blog.elsdoerfer.name/2010/04/15/android-check-if-sd-card-storage-is-available/&quot;&gt;Android: Check if SD card storage is available&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/4742844715334749118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2010/08/check-if-sd-card-storage-is-available.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4742844715334749118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4742844715334749118'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2010/08/check-if-sd-card-storage-is-available.html' title='Check if SD card storage is available'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-5405872164069405661</id><published>2010-07-27T19:07:00.000+08:00</published><updated>2011-01-24T10:08:37.787+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="connectivity"/><title type='text'>check if any network connected</title><content type='html'>private boolean checkIfNetworkConnected() {&lt;br/&gt;　　boolean result = false;&lt;br/&gt;　　ConnectivityManager connManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);&lt;br/&gt;　　NetworkInfo info=connManager.getActiveNetworkInfo();&lt;br/&gt;　　if (info == null || !info.isConnected()) {&lt;br/&gt;　　　　result = false;&lt;br/&gt;　　} else {&lt;br/&gt;　　　　if (!info.isAvailable()) {&lt;br/&gt;　　　　　　result =false;&lt;br/&gt;　　　　} else {&lt;br/&gt;　　　　　　result = true;&lt;br/&gt;　　　　}&lt;br/&gt;　　}&lt;br/&gt;&lt;br/&gt;　　return result;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Reference:&lt;br/&gt;&lt;a href=&quot;http://jjnnykimo.pixnet.net/blog/post/30349753&quot;&gt;Android 偵測網路是否連線&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/5405872164069405661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2010/07/check-if-any-network-connected.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5405872164069405661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/5405872164069405661'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2010/07/check-if-any-network-connected.html' title='check if any network connected'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-4088494380797893681</id><published>2010-06-28T10:42:00.000+08:00</published><updated>2011-01-24T10:08:37.792+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>7z in Ubuntu</title><content type='html'>sudo apt-get install p7zip-full&lt;br/&gt;&lt;br/&gt;//x: Extract with full paths&lt;br/&gt;7z x 7zfile</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/4088494380797893681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2010/06/7z-in-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4088494380797893681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4088494380797893681'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2010/06/7z-in-ubuntu.html' title='7z in Ubuntu'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-2043248443395199155</id><published>2009-09-30T18:34:00.000+08:00</published><updated>2011-01-24T10:08:37.799+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="droiddoc"/><category scheme="http://www.blogger.com/atom/ns#" term="sdk"/><title type='text'>make sdk fail about DroidDoc</title><content type='html'>&lt;code&gt;&lt;br/&gt;$ sudo apt-get install sun-java5-jdk&lt;br/&gt;$ cd /etc/alternatives&lt;br/&gt;$ sudo rm javadoc.1.gz&lt;br/&gt;$ sudo ln -s /usr/lib/jvm/java-1.5.0-sun/man/man1/javadoc.1.gz javadoc.1.gz&lt;br/&gt;$ sudo rm javadoc&lt;br/&gt;$ sudo ln -s /usr/lib/jvm/java-1.5.0-sun/bin/javadoc javadoc&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;Reference:&lt;br/&gt;&lt;a href=&quot;http://www.iim.nctu.edu.tw/~richardlin/blog/?p=6&quot;&gt;編譯Android cupcake SDK&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/2043248443395199155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/09/make-sdk-fail-about-droiddoc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/2043248443395199155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/2043248443395199155'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/09/make-sdk-fail-about-droiddoc.html' title='make sdk fail about DroidDoc'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-2288494589145598049</id><published>2009-09-22T09:24:00.000+08:00</published><updated>2014-05-30T19:53:11.381+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="vi"/><title type='text'>how to remove ^M in vi</title><content type='html'>:1,$s/&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;^M&lt;/strong&gt;&lt;/span&gt;//g&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;^M&lt;/strong&gt;&lt;/span&gt;: Ctrl+V, and press Enter&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[2014/05/30 updated]&lt;/b&gt;&lt;br /&gt;
It seems &lt;i&gt;dos2unix&lt;/i&gt; is better than this command.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;dos2unix – Removing Hidden Windows Characters from Files&lt;/b&gt;&lt;br /&gt;
http://www.liquidweb.com/kb/dos2unix-removing-hidden-windows-characters-from-files/</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/2288494589145598049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/09/how-to-remove-m-in-vi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/2288494589145598049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/2288494589145598049'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/09/how-to-remove-m-in-vi.html' title='how to remove ^M in vi'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-4578069956148476351</id><published>2009-09-20T11:26:00.000+08:00</published><updated>2011-01-24T10:14:46.239+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>Get and build source code in Cygwin</title><content type='html'>You should install Java 5 on your computer first!!&lt;br/&gt;Add the path of javac.exe to $PATH.&lt;br/&gt;&lt;br/&gt;Download cygwin from http://cygwin.com/setup.exe&lt;br/&gt;&lt;br/&gt;Choose A Download Site: You can choose many Taiwan sites. &lt;br/&gt;&lt;br/&gt;Select Packages:( Select Binary )&lt;br/&gt;&lt;br/&gt;Press &#39;View&#39; to Not Installed&lt;br/&gt;&lt;br/&gt;Bison: A parser generator that is compatible with YACC&lt;br/&gt;Curl: Command line tool for tranferring files with HTTP, HTTPS, FTP, etc.&lt;br/&gt;Flex: A fast lexical analyzer generator&lt;br/&gt;Gcc: C compiler upgrade helper&lt;br/&gt;Git: Fast version control system - core files&lt;br/&gt;Gperf: Perfect hash function generator&lt;br/&gt;Libncurses-devel: Libraries for terminal handling (development)&lt;br/&gt;Make: The GNU version of the &#39;make&#39; utility&lt;br/&gt;Python: An interactive object-oriented scripting language&lt;br/&gt;Vim: Vi IMproved - enhanced vi editor&lt;br/&gt;Wget: Utility to retrieve files from the WWW via HTTP and FTP&lt;br/&gt;Zip: The zlib compression and decompression library&lt;br/&gt;&lt;br/&gt;Installing as below picture&lt;br/&gt;&lt;br/&gt;[caption id=&quot;attachment_73&quot; align=&quot;alignnone&quot; width=&quot;450&quot; caption=&quot;Installing Cygwin&quot;]&lt;a href=&quot;http://bradchow.files.wordpress.com/2008/11/1.jpg&quot;&gt;&lt;img class=&quot;size-full wp-image-73&quot; title=&quot;1&quot; src=&quot;http://bradchow.files.wordpress.com/2008/11/1.jpg&quot; alt=&quot;Installing Cygwin&quot; width=&quot;450&quot; height=&quot;346&quot; /&gt;&lt;/a&gt;[/caption]&lt;br/&gt;&lt;br/&gt;/*&lt;br/&gt;create a directory to store some source code&lt;br/&gt;mkdir src&lt;br/&gt;cd src&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Install libsdl (http://www.libsdl.org/) not libsdl-dev as Android open project mentioned&lt;/strong&gt;&lt;br/&gt;wget http://www.libsdl.org/release/SDL-1.2.13.tar.gz&lt;br/&gt;tar -zxvf SDL-1.2.13.tar.gz&lt;br/&gt;cd SDL-1.2.13&lt;br/&gt;./configure&lt;br/&gt;make&lt;br/&gt;make install&lt;br/&gt;if success, you can find SDL.dll in /usr/local/bin&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Install libwxgtk2.6-dev&lt;/strong&gt;&lt;br/&gt;Download &quot;libwxgtk2.6-devel-2.6.4-14mdv2008.1.i586.rpm&quot; from http://rpmfind.net/linux/rpm2html/search.php?query=libwxgtk-devel&lt;br/&gt;Copy it to ~/src&lt;br/&gt;*/&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Install cyg-apt&lt;/strong&gt;&lt;br/&gt;cd /bin&lt;br/&gt;wget http://www.lilypond.org/~janneke/software/cyg-apt&lt;br/&gt;chmod a+rx cyg-apt&lt;br/&gt;vi cyg-apt&lt;br/&gt;1. root = &#39;/cygwin&#39; =&amp;gt; root = &#39;/&#39;&lt;br/&gt;2. downloads = root + &#39;/var/cache..... =&amp;gt; downloads = root + &#39;var/cache....&lt;br/&gt;3. config = root + &#39;/etc/setup&#39; =&amp;gt; config = root + &#39;etc/setup&#39;&lt;br/&gt;4. mirror = &#39;http://mirror.mcs.anl.gov/cygwin&#39;&lt;br/&gt;cyg-apt setup&lt;br/&gt;cyg-apt update&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Install some essential application&lt;/strong&gt;&lt;br/&gt;libsdl-dev&lt;br/&gt;libesd0-dev&lt;br/&gt;libwxgtk2.6-dev&lt;br/&gt;valgrind&lt;br/&gt;zlib1g-dev&lt;br/&gt;libncurses5-dev&lt;br/&gt;git-core gnupg&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;br/&gt;1. &lt;a title=&quot;Frequently Asked Questions about Java and Cygwin&quot; href=&quot;http://www.inonit.com/cygwin/faq/&quot; target=&quot;_blank&quot;&gt;Frequently Asked Questions about Java and Cygwin&lt;/a&gt;&lt;br/&gt;2. &lt;a title=&quot;apt for cygwin&quot; href=&quot;http://donc.wordpress.com/2006/08/04/apt-for-cygwin/&quot; target=&quot;_blank&quot;&gt;apt for cygwin&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/4578069956148476351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/09/get-and-build-source-code-in-cygwin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4578069956148476351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4578069956148476351'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/09/get-and-build-source-code-in-cygwin.html' title='Get and build source code in Cygwin'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-3058022709262774076</id><published>2009-07-07T10:30:00.000+08:00</published><updated>2011-01-24T10:08:37.807+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>Basic Concept of Android Application Components</title><content type='html'>&lt;strong&gt;Activity&lt;/strong&gt;&lt;br/&gt;An application may or may not have a User Interface. If it has a user interface, it will have one or more Activity.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Service&lt;/strong&gt;&lt;br/&gt;If an application is to have a long life cycle it should be put into a Service. For example a background data synchronization utility running continuously should be implemented as a Service.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;BroadcastReceiver&lt;/strong&gt;&lt;br/&gt;Like Services, BroadcastReceivers do not have a User Interface. Of even more importance, the code running in the onReceive method of a BroadcastReceiver should make no assumptions about persistence or long-running operations. If the BroadcastReceiver requires more than a trivial amount of code execution, it is recommended that the code initiate a request to a Service to complete the requested functionality.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Content Provider&lt;/strong&gt;&lt;br/&gt;If an application manages data and needs to expose that data to other applications running in the Android environment, a ContentProvider should be implemented.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Reference:&lt;br/&gt;&lt;a href=&quot;http://code.google.com/p/unlocking-android/&quot;&gt;Unlocking Android - A Developer&#39;s Guide&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/3058022709262774076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/07/basic-concept-of-android-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3058022709262774076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/3058022709262774076'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/07/basic-concept-of-android-application.html' title='Basic Concept of Android Application Components'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-312305357281531038</id><published>2009-07-05T20:47:00.000+08:00</published><updated>2011-01-24T10:08:37.809+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Google API"/><title type='text'>Not useful Google API for Android application</title><content type='html'>&lt;a href=&quot;http://code.google.com/apis/gears/&quot;&gt;Google Gears&lt;/a&gt;&lt;br/&gt;Gears is an open source project that enables &lt;strong&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;more powerful web applications&lt;/span&gt;&lt;/strong&gt;, by adding new features to web browsers.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://code.google.com/apis/coupons/&quot;&gt;Google Coupon Feeds&lt;/a&gt;&lt;br/&gt;Google coupon feeds &lt;strong&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;enable businesses to provide coupon listings&lt;/span&gt;&lt;/strong&gt; that will be included in Google search results.</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/312305357281531038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/07/not-useful-google-api-for-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/312305357281531038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/312305357281531038'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/07/not-useful-google-api-for-android.html' title='Not useful Google API for Android application'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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-2104108011617545171.post-4671723078010014678</id><published>2009-06-23T22:20:00.000+08:00</published><updated>2011-01-24T10:08:37.811+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activity"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Manifest"/><title type='text'>Create a activity with no background</title><content type='html'>Insert &lt;strong&gt;android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar&quot;&lt;/strong&gt; in application tag.</content><link rel='replies' type='application/atom+xml' href='http://bradchow.blogspot.com/feeds/4671723078010014678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://bradchow.blogspot.com/2009/06/create-activity-with-no-background.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4671723078010014678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2104108011617545171/posts/default/4671723078010014678'/><link rel='alternate' type='text/html' href='http://bradchow.blogspot.com/2009/06/create-activity-with-no-background.html' title='Create a activity with no background'/><author><name>Brad Chou</name><uri>http://www.blogger.com/profile/14474472269520424510</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>