Skip to content

Instantly share code, notes, and snippets.

View kmansoft's full-sized avatar

Kostya Vasilyev kmansoft

View GitHub Profile
@kmansoft
kmansoft / MediaScannerNotifier.java
Created August 13, 2012 22:53
MediaScanner example
public class MediaScannerNotifier implements MediaScannerConnectionClient, Handler.Callback {
private static final String TAG = "MediaScannerNotifier";
public static boolean submit(Context context, File file, String type) {
if (needScan(type)) {
new MediaScannerNotifier(context, file);
return true;
}
return false;
@kmansoft
kmansoft / find_missing_translations.py
Created July 3, 2012 09:22
A simple script to find missing translations in an Android project
#!/usr/bin/python
'''
This script finds missing string translations in Android applicaitons.
Author: Kostya Vasilyev. License: Creative Commons Attribution.
The output format is, I believe, more suitable to working with external
translators than the output of Lint from the Android SDK.
@kmansoft
kmansoft / drawable_convert.py
Created May 22, 2012 21:39
A simple script to create lower-resolution Android drawables from higher-resolution ones.
#!/usr/bin/python
import sys
import argparse
import os
import re
'''
A simple script to create lower-resolution Android drawables from higher-resolution ones.
static class TestAsyncTask extends AsyncTask<Void, Void, Void> {
private static final String TAG = "TestAsyncTask";
private static final int TASK_COUNT = 5;
@Override
protected Void doInBackground(Void... params) {
Log.i(TAG, "doInBackground " + mId);
try {