Skip to content

Instantly share code, notes, and snippets.

@yihongyuelan
yihongyuelan / CellSignalStrength.java
Last active September 25, 2018 03:16
Check the validity of the SIM card for Android
public abstract class CellSignalStrength {
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
public static final int SIGNAL_STRENGTH_POOR = 1;
public static final int SIGNAL_STRENGTH_MODERATE = 2;
public static final int SIGNAL_STRENGTH_GOOD = 3;
@bitsgalore
bitsgalore / loggingGUI.py
Created January 31, 2017 13:43
Minimal threaded GUI application with logging to both text file and ScrolledText widget
#! /usr/bin/env python
import time
import threading
import logging
try:
import tkinter as tk # Python 3.x
import tkinter.scrolledtext as ScrolledText
except ImportError:
import Tkinter as tk # Python 2.x
import ScrolledText
@moshekaplan
moshekaplan / TextHandler.py
Last active February 25, 2024 01:33
A Logging Handler that allows logging to a Tkinter Text Widget
#!/usr/bin/env python
# Built-in modules
import logging
import Tkinter
import threading
class TextHandler(logging.Handler):
"""This class allows you to log to a Tkinter Text or ScrolledText widget"""
def __init__(self, text):
@rajivnarayana
rajivnarayana / DrawableAlignedButton.java
Created March 22, 2013 21:26
Custom drawn Android button which aligns left drawable and its text to center.
package com.webileapps.myrtprofile;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.Button;
/**
*