This file contains 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
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.LinearGradient; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff.Mode; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Shader.TileMode; | |
import android.util.AttributeSet; |
This file contains 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
/** | |
* Logging Heap Info for Android | |
* @source <a href="http://stackoverflow.com/a/8018476/918211">StackOverflow Thread</a> | |
*/ | |
public static void logHeap(Class clazz) { | |
final String APP = "MyApp"; | |
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/1048576d; | |
Double available = new Double(Debug.getNativeHeapSize())/1048576.0d; | |
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0d; | |
DecimalFormat df = new DecimalFormat(); |
This file contains 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
# This is a monkeyrunner jython script that opens a connection to an Android | |
# device and starts camera app and makes photos by touching the camerabutton. | |
# | |
# See http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html | |
# | |
# usage: monkeyrunner photo_monkey.py | |
# | |
# Imports the monkeyrunner modules used by this program | |
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice |
This file contains 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
using System; | |
using OpenTK; | |
using OpenTK.Graphics; | |
using OpenTK.Graphics.ES20; | |
using OpenTK.Platform; | |
using OpenTK.Platform.Android; | |
using Android.Views; | |
using Android.Content; |
This file contains 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
The bridge is now located at https://github.com/fjolnir/TLC |
This file contains 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
package test.fragment; | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.app.FragmentTransaction; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
public class MainActivity extends Activity { |
This file contains 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
import java.util.ArrayList; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.app.FragmentTransaction; | |
import android.support.v4.view.ViewPager; |
This file contains 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
/* | |
* ref | |
* http://www.mkyong.com/android/android-gridview-example/ | |
* http://blog.fujiu.jp/2011/11/android.html | |
* http://d.hatena.ne.jp/xuwei/20120316/1331868246 | |
* http://stackoverflow.com/questions/5730240/android-get-bounding-rectangle-of-a-view | |
*/ | |
This file contains 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
# これからWaitForConnectionすればいい感じ | |
from java.io import File | |
from java.net import URL | |
from java.net import URLClassLoader | |
import jarray | |
urlClassLoader=URLClassLoader(jarray.array([File("ddmlib.jar").toURL()], URL)) | |
AndroidDebugBridge=urlClassLoader.loadClass("com.android.ddmlib.AndroidDebugBridge") | |
bridge = AndroidDebugBridge.getBridge() |