Skip to content

Instantly share code, notes, and snippets.

@googolmo
googolmo / sdcard
Created September 16, 2011 01:43
Installing Android apps to the SD card
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>8</tool-api-level>
<manifest android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="7" />
</manifest>
</android>
@googolmo
googolmo / index.php
Created January 30, 2012 13:59 — forked from rpetrich/index.php
Twitter self-hosted image service/url shortener
<?
// Twitter self-hosted image service/url shortener by Ryan Petrich
// Installation:
// 1. Paste this script into the top of your HTTP root's index.php (rename index.html to index.php if it doesn't exist)
// 2. Add the following to your HTTP root's .htaccess file (create .htaccess if it doesn't exist):
// ErrorDocument 404 /index.php
// 3. Create a "s" subfolder and give it 777 permissions
// 4. Add the following as the custom URL for URL shortening in Twitter for iPhone's settings:
// http://yourdomain.com/?d=%@&p=password
// 5. Add the following as the custom URL for Image service:
11-15 14:40:28.774 24973-24973/com.douban.movie E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.douban.movie, PID: 24973
java.lang.UnsatisfiedLinkError: Couldn't load amapv3 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.douban.movie-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.douban.movie-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.autonavi.amap.mapcore.MapCore.<clinit>(MapCore.java:42)
at com.amap.api.mapcore.b.<init>(AMapDelegateImpGLSurfaceView.java:263)
at com.amap.api.mapcore.b.<init>(AMapDelegateImpGLSurfaceView.java:220)
at com.amap.api.mapcore.ac.a(MapFragmentDelegateImp.java:117)
at com.amap.api.maps.SupportMapFragment.onCreateView(SupportMapFragment.java:124)

#About Gradle# ##What is Gradle##

Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.

Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults. Gradle is quickly becoming the build system of choice for many open source projects, leading edge enterprises and legacy automation challenges.

http://www.gradle.org/

##Gradle和Maven的比较##

/*
* Copyright 2014 Google Inc.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@googolmo
googolmo / bearyboard
Created August 28, 2014 07:15
bearyboard
在一个工程进行中,有很多的角色,角色之间的交流比较复杂,白板的出现大大的提高了工程师和设计师在交流时候的效率,并且把工程项目里面先进的版本管理思想带了进来,虽然白板还有一些瑕疵,但这并不能阻碍我和设计师在项目推进过程中选择他.
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}
07-23 16:25:22.739 7749-7749/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.booking, PID: 7749
java.lang.ExceptionInInitializerError
at com.booking.common.exp.ExperimentsServer.init(ExperimentsServer.java:242)
at com.booking.common.exp.ExperimentsServer.getInstance(ExperimentsServer.java:93)
at com.booking.common.exp.ExperimentsServer.getInstance(ExperimentsServer.java:99)
at com.booking.common.data.Squeak$SqueakBuilder.getInformation(Squeak.java:152)
at com.booking.common.data.Squeak$SqueakBuilder.attachClientDetails(Squeak.java:263)
at com.booking.common.data.Squeak$SqueakBuilder.attach(Squeak.java:235)
at com.booking.DynamicLoaderLiveHelper.hasLoadedCodeDynamically(DynamicLoaderLiveHelper.java:151)
public static String generateUserAgent() {
StringBuilder builder = new StringBuilder("Android/");
builder.append(Build.VERSION.SDK_INT);
builder.append(" ");
builder.append(Build.BRAND.replace(" ", "_"));
builder.append("/");
builder.append(Build.MODEL.replace(" ", "_"));
builder.append(" ");
builder.append(Build.MANUFACTURER.replace(" ", "_"));
builder.append("/");
@googolmo
googolmo / layout.xml
Created September 16, 2015 13:56
Qyer
<android.support.design.widget.AppBarLayout
android:layout_height="192dp"
android:layout_width="match_parent">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"