This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are three ways to do this. | |
1. | |
private static final ScheduledExecutorService worker = | |
Executors.newSingleThreadScheduledExecutor(); | |
void someMethod() { | |
... | |
Runnable task = new Runnable() { | |
public void run() { | |
/* Do something... */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get current global time zone: | |
adb shell settings get global time_zone | |
Set a time zone: | |
adb shell settings put global time_zone Europe/Madrid | |
This way, developers can change other global settings too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Android Error in Eclipse: "Unable to execute dex: Cannot merge new index 65799 into a non-jumbo instruction!" | |
Solution:- Add dex.force.jumbo=true to project.properties file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get extract-ikconfig in kernel-source/scripts/ | |
$mkdir extract-uImage | |
$cd extract-uImage | |
$cp {kernel-source}/scripts/extract-ikconfig | |
Dump uImage skip 1024 bytes | |
$cp {uImage/what/you/want} uImage | |
$dd if=uImage of=dd_uImage bs=1024 skip=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /xyz_path\ 1.z01 ~/temp/xyz\ 1.z01 | |
cp /xyz_path\ 1.zip ~/temp/xyz\ 1.zip | |
zip -FF xyz\ 1.zip --out xyz\ 1.zip.fixed | |
mkdir xyz\ 3 | |
unzip -d xyz\ 3/ xyz\ 1.zip.fixed | |
du --total xyz\ 3 | |
>> 10466048 (~10.5 GB => success) | |
zip -FF should be applied to last part of archive, it will automatically check for all parts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String htmlString = | |
"<h1>HTML String Title in TextView</h1>\n" + | |
"<h3>HTML Paragraph:</h3>\n" + | |
"<p>Display html string in android TextView. How to show HTMl string in android TextView. This html paragraph</p>\n" + | |
"<h3>HTML Unordered List: </h3>\n" + | |
"<ol>\n" + | |
"\t<li>HTML List Item 1</li> \n" + | |
"\t<li>HTML List Item 2</li>\n" + | |
"\t<li>HTML List Item 3</li>\n" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage: input [text|keyevent] | |
input text <string> | |
input keyevent <event_code> | |
Codes:- | |
0 --> "KEYCODE_UNKNOWN" | |
1 --> "KEYCODE_MENU" | |
2 --> "KEYCODE_SOFT_RIGHT" | |
3 --> "KEYCODE_HOME" | |
4 --> "KEYCODE_BACK" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE_LIST := $(wildcard $(LOCAL_PATH)/[DIRECTORY]/*.cpp) | |
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Download latest apktool version. | |
2. Download the batch file and aapt.exe. | |
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder. | |
4. Open command prompt. | |
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe. | |
6. Now, you need to install the file using the " IF " command. | |
7. Type the following command. | |
apktool if name-of-the-app.apk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unzip "zip" file | |
Install Dependency :- apt-get install unzip' | |
Unzip -> unzip file.zip, | |
unzip file.zip -d destination_folder | |
Compress/Extract from/to "tar.gz" file | |
Compress -> tar -zcvf folder1_path folder2_path ... file.tar.gz | |
Extract -> tar -zxvf file.tar.gz | |
Merge / convert multiple PDF files into one PDF |