One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
private void enableHTML5AppCache() { | |
webView.getSettings().setDomStorageEnabled(true); | |
// Set cache size to 8 mb by default. should be more than enough | |
webView.getSettings().setAppCacheMaxSize(1024*1024*8); | |
// This next one is crazy. It's the DEFAULT location for your app's cache | |
// But it didn't work for me without this line | |
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache"); |
import com.octo.android.robospice.request.springandroid.SpringAndroidSpiceRequest; | |
import org.springframework.http.HttpEntity; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.http.MediaType; | |
import org.springframework.util.LinkedMultiValueMap; | |
import org.springframework.util.MultiValueMap; | |
public class MyRequest extends SpringAndroidSpiceRequest<MyResponse> { | |
public MyRequest(){ |
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services | |
Download the following ZIPs: | |
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
Download the correct GApps for your Android version: | |
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) |
/** | |
* Allows easy swapping of production and test modules to satisfy Dagger dependencies | |
*/ | |
public class DaggerHelper | |
{ | |
//DAGGER | |
private static ObjectGraph sObjectGraph; | |
private static final List<Object> productionModules; |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Great set of colors from from http://flatuicolors.com/ and converted into Android colors.xml | |
--> | |
<resources> | |
<color name="turquoise">#1abc9c</color> | |
<color name="emerald">#2ecc71</color> | |
<color name="peter_river">#3498db</color> |
package com.dexode.fragment; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v4.app.Fragment; | |
import android.view.KeyEvent; |
Spinner spinner = (Spinner) findViewById(R.id.main_spinner); | |
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getSupportActionBar().getThemedContext(), | |
R.layout.spinner_list_style, | |
getResources().getStringArray(R.array.countries)); | |
spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |
spinner.setAdapter(spinnerAdapter); |
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
buildToolsVersion rootProject.ext.buildToolsVersion | |
defaultConfig { | |
applicationId "com.example.yourapp" | |
minSdkVersion 16 | |
targetSdkVersion 23 |