Skip to content

Instantly share code, notes, and snippets.

View dmpatel151282's full-sized avatar

Dharmesh Patel dmpatel151282

View GitHub Profile
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... */
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.
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.
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
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
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" +
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"
FILE_LIST := $(wildcard $(LOCAL_PATH)/[DIRECTORY]/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
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
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