Recent Notes
Displaying keyword search results 61 - 70
Created by freyo on October 28, 2010 23:00:48
Last update: August 23, 2011 08:51:42
Running " adb shell procrank ":
root@android:/ # procrank ... Column Name Meaning VSS Virtual Set Size: how much virtual memory associated with process RSS Resident Set Size: how much physical pages allocated for the process. Pages shared between processes are counted multiple times PSS Proportional Set Size. Take the RSS number but evenly distribute shared pages among the sharing processes. For example, if three processes are sharing 3MB, each process gets 1MB in PSS. USS Also known as Private Dirty, which is basically the amount of RAM inside the process that can not be paged to disk (it is not backed by the same data on disk), and is not shared with any other processes. Reference: How to discover memory usage of my application...
Created by freyo on August 17, 2011 12:29:46
Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this:
LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t...
and in jarjar-rules.txt define a rule like this:
rule org.bouncycastle.** com.android.@0
The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like:
import com.android.org.bouncycastle...
Help for the jarjar utility (in prebuilt/common/jarjar/ ):
$ java -jar jarjar-1.0rc8.jar
Jar Jar Links - ...
Created by woolf on August 07, 2011 15:17:12
Last update: August 07, 2011 15:17:12
Normally opkg installs packages from a repository which is specified in /etc/opkg.conf :
src/gz packages http://downloads.openwrt.org/backf...
What if you built a package locally and want to install that instead? Do this instead of setting up your own web server:
Copy your package ( .ipk file) to /tmp on the router:
$ scp mypackage_brcm63xx.ipk root@172.30.33.1:/tmp...
Copy the Packages file to the router:
$ scp Packages root@172.30.33.1:/var/opkg-lists/pa...
Log on the router, cd /tmp and install the local package:
root@OpenWrt:~# opkg install mypackage_brcm63xx.ip...
Created by freyo on August 03, 2011 13:27:22
Last update: August 04, 2011 08:40:50
If your app is not available from Android Market but is downloaded to a PC, you can copy the APK to an SD card and install it following these steps. Copy the Android app APK file to the SD card. Enable "Unknown sources" on the phone: Menu -> Settings -> Applications -> check "Unknown sources". Open the browser ("Internet"), then enter the URL to the APK file like this:
file:///mnt/sdcard/external_sd/theApp.apk Select "Package installer" in the popup. The drawback of this method is that you have to know the exact path to the APK file, which may or may not be a problem. Other methods require third party utilities: Use AppsInstaller or ApkInstaller Use ASTRO File Manager or Dropbox Update: On my Samsung Galaxy S, there's...
Created by freyo on July 27, 2011 12:12:48
Last update: July 27, 2011 12:12:48
In contrast to the getString() , getInt() calls in JDBC ResultSet , for which the column index is 1 based, the corresponding calls for Android Cursor is 0 based!
Created by Dr. Xi on July 15, 2011 09:25:15
Last update: July 15, 2011 09:25:15
Some methods to search for a substring within a string:
To know that a substring indeed exists within a string:
boolean found = wholeString.contains(substring);
To find where the substring is contained:
int index = wholeString.indexOf(substring);
If the substring is regex:
boolean match = wholeString.matches(".*" + substri...
Case insensitive match: convert both whole string and substring to lowercase, then compare. Or, use case insensitive flag for regex.
Test code:
import java.util.regex.*;
public class Stri...
Created by Dr. Xi on July 11, 2011 12:04:52
Last update: July 11, 2011 12:04:52
From the Java Language Specification : Because some type information is erased during compilation, not all types are available at run time. Types that are completely available at run time are known as reifiable types . A type is reifiable if and only if one of the following holds: It refers to a non-generic type declaration. It is a parameterized type in which all type arguments are unbounded wildcards. It is a raw type. It is a primitive type. It is an array type whose component type is reifiable. For example: int is a reifiable type (primitive type) List is a reifiable type (raw type) List<?> is a reifiable type (parameterized type with unbound wildcards) List<String> is not a reifiable type (generic type) Class<?> is...
Created by alfa on July 08, 2011 08:58:12
Last update: July 08, 2011 08:58:42
By Java documentation , java.endorsed.dirs is used to provide an Endorsed Standards Override Mechanism . Which means, a user can provide newer versions of certain packages than those provided by the JDK. If there are newer implementations of these packages in the directories specified by java.endorsed.dirs , those implementations will be loaded instead of the default ones that come with the JDK. The packages that can be overriden this way are grouped into Endorsed Standards APIs and Standalone Technologies , and are listed in the Java documentation . Roughly speaking the Endorsed Standards APIs include: javax.rmi.CORBA various org.omg.* packages org.w3c.dom various org.xml.sax.* packages Standalone Technologies include: Java API for XML Processing (JAXP), version 1.4 Java Architecture for XML Binding (JAXB), version 2.0 Java API for...
Created by woolf on July 05, 2011 15:38:52
Last update: July 05, 2011 15:39:55
By default VirtualBox enables one network adapter ("Adapter 1") with NAT. Connection from the guest OS to the outside world works natually when the guest network adapter is assigned an IP address by the VirtualBox DHCP server. Use VBoxManage to see a list of DHCP servers:
$ VBoxManage list dhcpservers NetworkName: H... The guest IP address is not visible from the outside world. If you need to access a server on the guest OS, you need to set up port forwarding in VirtualBox settings: Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding . Beware that on Linux/Unix, port forwarding may not work if you bind to a privileged port (port number < 1024) but you are not root. Bridged networking can be...
Created by woolf on July 03, 2011 19:29:45
Last update: July 05, 2011 08:28:06
eHow gave this command for defragging NTFS in Linux:
fsck -t ntfs --kerneldefrag /dev/XXX
which was rebuked by stack exchange . I believe the latter is right: there's no such thing!
Yes, there's a set of utilities called ntfsprogs (including ntfsresize, which is widely used), but defragmentation does not seem to be part of it.