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 android.util.SparseArray; | |
| import com.google.gson.Gson; | |
| import com.google.gson.reflect.TypeToken; | |
| import java.lang.reflect.Type; | |
| public class Main { | |
| public static class MyCustomClass { | |
| public int a; |
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
| /** | |
| * @copyright | |
| * This code is licensed under the Rekisoft Public License. | |
| * See http://www.rekisoft.eu/licenses/rkspl.html for more informations. | |
| */ | |
| /** | |
| * @package eu.rekisoft.android.util | |
| * This package contains utils provided by [rekisoft.eu](http://rekisoft.eu/). | |
| */ | |
| package eu.rekisoft.android.util; |
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 android.content.Context; | |
| import android.graphics.Matrix; | |
| import android.widget.ImageView; | |
| /** | |
| * ImageView to display top-crop scale of an image view. | |
| * | |
| * @author Chris Arriola | |
| */ | |
| public class TopCropImageView extends ImageView { |
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.io.File; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Random; | |
| import java.util.concurrent.Callable; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; |
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
| public class Statistics { | |
| public static void main(String[] args) { | |
| List<Observable<ObservableHttpResponse>> observableRequests = Arrays.asList( | |
| Http.getAsync("http://localhost:3001/stream"), | |
| Http.getAsync("http://localhost:3002/stream"), | |
| Http.getAsync("http://localhost:3003/stream"), | |
| Http.getAsync("http://localhost:3004/stream")); | |
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 org.paulbetts.shroom.core; | |
| import android.os.AsyncTask; | |
| import com.squareup.okhttp.*; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.UnsupportedEncodingException; | |
| import java.util.Arrays; |
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
| // With reference to the android.app.IntentService of the Android framework | |
| // Member variable | |
| private volatile Looper mServiceLooper; | |
| private volatile ServiceHandler mServiceHandler; | |
| // Handler Class | |
| private final class ServiceHandler extends Handler { | |
| public ServiceHandler(Looper looper) { | |
| super(looper); |
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
| <!-- ... --> | |
| <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.USE_CREDENTIALS" /> | |
| <!-- ... --> |
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
| public static int getDimensionForName(String resourceName, Context ctx) { | |
| int result = 0; | |
| int resourceId = ctx.getResources().getIdentifier(resourceName, "dimen", "android"); | |
| if (resourceId > 0) { | |
| result = ctx.getResources().getDimensionPixelSize(resourceId); | |
| } | |
| return result; | |
| } | |
| public static int getNotificationBarHeight(Context ctx) { |
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
| /** | |
| * Copyright (c) 2013 Xcellent Creations, Inc. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |