The trick is really easy. Just to keep record.Here we take the /tmp folder as the desired one.
1 2 3 4 5 6 |
|
The trick is really easy. Just to keep record.Here we take the /tmp folder as the desired one.
1 2 3 4 5 6 |
|
适宜的环境,这里介绍适宜的温度和湿度,数据来自TANITA湿度计的附带资料
This trick works. It’s really easy.
1 2 3 |
|
The following code works. Here take getting String resource for example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
An easy way to get system available features.
1 2 3 4 5 6 7 |
|
Have a glance at the result
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
You can also use adb shell
to get into the shell of your device and the use pm list features
to get the available features of a device.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
For a detailed understanding of use-filter,please read this post http://developer.android.com/guide/topics/manifest/uses-feature-element.html
How to get application’s required features? Actually the aapt really does a great help.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
To understand the feature more detailed, please visit http://developer.android.com/guide/topics/manifest/uses-feature-element.html
There was a requirement of my work. It requires me to integrated my current project with Facebook SDK for measuring. However this came into my sights.
1
|
|
The fact is that Both my project and my library project which the former refers to have used android-support-v4.jar. However I realize the two android-support-v4.jar are different after making the md5 hash.
My solution:
I use the android-support-v4.jar in my project as the right one. And then replace the one in Facebook SDK with my project one. And then it works.
But my question remains; why it asks me for fix the dependencies to use the same lib jar file?
I guess android will keep only one file for all the references so this will ask developers to make all the same lib all the same.
Sorry for the codeless post.
This will work if you want to remove account without factory reset your device.
When I create a new application on Facebook, I meet the problem. Facebook asks me to provide the Key Hash. But it does not show the guidance about how to generate. After Googling, I have found this works for me.
Before executing the following command, you need install openssl
1
|
|
Replace your-alias-value and your-keystore-path with the real data.
Best answer to the question
Use PRAGMA table_info
This pragma returns one row for each column in the named table. Columns in the result set include the column name, data type, whether or not the column can be NULL, and the default value for the column. The “pk” column in the result set is zero for columns that are not part of the primary key, and is the index of the column in the primary key for columns that are part of the primary key.
Reference:http://www.sqlite.org/pragma.html#pragma_table_info
1 2 3 4 5 6 7 8 |
|
Another answer may also work
.schema [tablename] will show the CREATE statement(s) for a table or tables
1 2 |
|
I was once stucked in How to check Whether a Python module has been installed or not. After Googling, I found this trick.
Python allows user to pass command from out of a python file.See here
1
|
|
The result if we import an installed module
1 2 3 4 |
|
Now if we import an module which is not installed.
1 2 3 4 5 6 7 |
|
As a coder, I am always handling exceptions or errors,or in a word throwables. To impove the release build, I need to collect every throwable information.
And I need to get the information as string and post it to the Bug Collect Server. Now here is an easy trick to get stacktrace from a Throwable
1 2 3 4 5 6 7 |
|
之前一直和女朋友有一个讨论,就是搭乘扶梯时究竟时靠左站立,还是靠右站立。起因时从地铁北宫门出来的时候,我要求她站在左侧。
Python provides a lot of method to read output from a just executed shell. However many of them has been deprecated(Not recommened). But subprocess works at present compared to other methods.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
A detailed description about subprocess has been written down here. http://docs.python.org/2/library/subprocess.html
A trick in Bash
1 2 3 4 5 6 7 8 |
|
Trick
1
|
|
Just write down this litte trick for further use. The problem how to replace one character in vim does be really simple for me now.
Now I have two tags under my git repository. Let’s take a look at how to push the git tags to Server.
1 2 |
|
1 2 3 |
|
1
|
|
A few months ago,I dealed with a task:To build a large amount of apk files. The trick I came up with is to build apk file from the command so that I could use Python to glue all the works. Eventually I made it.And so this post is to make some description about the trick.
In Android,We use R class to refer resources instead of hard-coding the resouces.
For a better understanding,pleae have a look at http://www.satyakomatineni.com/akc/display?url=displaynoteimpurl&ownerUserId=satya&reportId=2883
1
|
|
1
|
|
1
|
|
To dive into Dalvik, please visit http://source.android.com/devices/tech/dalvik/index.html
1
|
|
1
|
|
1
|
|
1
|
|
To be more geek,I began to start an Android App by using adb.Thanks to Google.It’s possible and powerful.
The tool we use to make it is ADB(Android Debug Tool),For more detailed use please visit http://developer.android.com/tools/help/adb.html#shellcommands
Actually What I use here is
1
|
|
An example is followed.
1 2 3 4 |
|
the Package name(com.mx.browser) before the slash is provided to determine which app should the intent delivered to.The com.mx.browser.MxBrowserActivity is the destination Activity.
For more explanations about ADB INTENT,please visit http://developer.android.com/tools/help/adb.html#IntentSpec
An easy trick to solve problem:Could not reliably determine the server’s fully qualified domain name
Let’s take Linux for example.
1 2 |
|
Find out the following sentence
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
If the ServerName localhost:80 has been commented,it may cause above problem.A simple trick is just uncomment the sentence.Let it be like this
1
|
|
Hope you could resolve your problem,Guys.
Recently I have been dealing with files and I need to get md5 hash of all kinds of files;Some are small and some are big.
For the small files I use this method to get md5 hash value.
1 2 3 4 5 6 7 |
|
However for calculating md5 hash value of big files,the above method will be very Less Efficient.For Big files I use the following method(It’s acquired from stackoverflow)
1 2 3 4 5 6 7 8 9 10 |
|
And I did a test.The cost of Getting md5 hash of a Big file(size:10.7 GiB; 11,455,512,109 bytes) is 213.447s.And I think it’s OK.