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
public class UIUtils { | |
public static <T extends View> T findView(View root, int id) { | |
return (T) root.findViewById(id); | |
} | |
} |
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
public class ContentValuesBuilder { | |
private ContentValues mValues; | |
private ContentValuesBuilder() { | |
mValues = new ContentValues(); | |
} | |
public static ContentValuesBuilder newBuilder() { | |
return new ContentValuesBuilder(); | |
} |
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
dependencies { | |
// Java goodies | |
compile ('com.google.guava:guava-jdk5:14.0.+') | |
// Annotations (e.g. @Nullable, @Beta) | |
compile ('com.google.code.findbugs:jsr305:2.0.+') | |
} |
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
MyProject/ | |
| settings.gradle | |
+ app/ | |
| build.gradle | |
+ libraries/ | |
+ compiled-libraries/ | |
| settings.gradle | |
+ lib1/ | |
| build.gradle | |
+ lib2/ |
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 the main build configuration | |
// It lives in: compiled-libraries/ | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.5.+' | |
} |
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
repositories { | |
// Add the local repository | |
maven { url '../localrepo' } | |
} | |
dependencies { | |
// This is built from libraries in the 'compiled-libraries' | |
// Replace the old dependency with this | |
compile ('com.rileybrewer.mylib:mylib:1.0.+') | |
} |
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
<activity | |
android:name="MyActivity" > | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<data android:scheme="http" /> | |
<data android:host="www.youtu.be" /> | |
<data android:host="youtu.be" /> | |
</intent-filter> | |
</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
public class YTUrlActivity extends Activity { | |
private static final String YOUTUBE = "http://www.youtube.com/watch?v=%s"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
String uriString = String.format(YOUTUBE, getIntent().getData().getLastPathSegment()); | |
Intent intent = new Intent(); | |
intent.setData(Uri.parse(uriString)); | |
startActivity(intent); | |
finish(); |
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 re | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
PERMISSIONS_URL = 'http://developer.android.com/reference/android/Manifest.permission.html' | |
NON_THIRD_PARTY = 'Not for use by third-party applications.' | |
MANIFEST_START = ("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" | |
"<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" |
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
ext { | |
PATH_TO_SCRIPT = '../scripts/collect_licenses.py' | |
PATH_TO_SOURCE_ROOT = 'src' | |
PATH_TO_ANOTHER_SOURCE_ROOT = '../libraries/MyLibrary/src' | |
} | |
task generateLicenseReport(type:Exec) { | |
def script = file(PATH_TO_SCRIPT) | |
def sourceRoot = file(PATH_TO_SOURCE_ROOT) | |
def anotherSourceRoot = file(PATH_TO_ANOTHER_SOURCE_ROOT) |
OlderNewer