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
/* | |
I've been writing tests for Android code that uses Handlers to communicate with background threads. | |
I couldn't get my callbacks to be called back to. | |
I got angry. | |
I finally found the solution...after way too much looking. | |
Here it is. | |
*/ | |
package com.caseycrites.android.testexample |
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
package com.yourco.yourapp; | |
import java.util.ArrayList; | |
import java.util.List; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; |
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
// THIS IS A BETA! I DON'T RECOMMEND USING IT IN PRODUCTION CODE JUST YET | |
/* | |
* Copyright 2012 Roman Nurik | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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
# -*- coding:utf-8 -*- | |
# author :Kazushige TAKEUCHI(@myb1126) | |
import sys | |
import os | |
# おまじない1 | |
srcroot = os.path.dirname(__file__) | |
sys.path.append(srcroot) |
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
# これから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() |
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
/* | |
* 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 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
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 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
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 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
The bridge is now located at https://github.com/fjolnir/TLC |