First, install VirtualBox. Then:
brew update
brew upgrade
brew install docker boot2docker
mkdir ~/.boot2docker
curl http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso \
> ~/.boot2docker/boot2docker.isoFirst, install VirtualBox. Then:
brew update
brew upgrade
brew install docker boot2docker
mkdir ~/.boot2docker
curl http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso \
> ~/.boot2docker/boot2docker.iso| public class ApiModule { | |
| private TwitterApi mApi; | |
| public void init(String token, String tokenSecret) { | |
| OAuthConsumer consumer = new DefaultOAuthConsumer( | |
| Config.TWEET_API_KEY, | |
| Config.TWEET_API_SECRET); | |
| consumer.setTokenWithSecret(token, tokenSecret); |
| #Android and CI and Gradle (A How-To) | |
| There are tech stacks in this world that make it dead simple to integrate a <abbr title="Continuous Integration">CI</abbr> build system. <br> | |
| The Android platform is not one of them. | |
| Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming. | |
| But fear not! It can be done! | |
| Before we embark on our journey, you'll need a few things to run locally: |
| # -*- encoding:utf-8 -*- | |
| # | |
| # CentOSをセキュアにセットアップするFabricスクリプト | |
| # | |
| # This software is released under the MIT License, see LICENSE.txt. | |
| ##################################################################### | |
| from fabric.api import env, run, sudo, put | |
| from fabric.colors import green | |
| from fabric.decorators import task |
| import android.content.Context; | |
| import android.text.Editable; | |
| import android.text.Spannable; | |
| import android.text.TextWatcher; | |
| import android.text.style.RelativeSizeSpan; | |
| import android.util.AttributeSet; | |
| import android.widget.EditText; | |
| public class TitledEditText extends EditText implements TextWatcher{ | |
| public class ObjectGsonParceler { | |
| private final Gson gson; | |
| public ObjectGsonParceler(Gson gson) { | |
| this.gson = gson; | |
| } | |
| public Parcelable wrap(Object instance) { | |
| try { | |
| String json = encode(instance); |
| private class HttpInterceptor implements Interceptor { | |
| @Override | |
| public Response intercept(Chain chain) throws IOException { | |
| Request request = chain.request(); | |
| //Build new request | |
| Request.Builder builder = request.newBuilder(); | |
| builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |