Back to project page Tvdb-Api-Android.
The source code is released under:
Apache License
If you think the Android project Tvdb-Api-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sburba.tvdbapi.example; // w w w .j a v a 2 s . c o m import android.app.Application; import android.content.Context; import android.util.DisplayMetrics; import android.util.Log; import com.android.volley.RequestQueue; import com.android.volley.toolbox.DiskBasedCache; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.Volley; public class App extends Application { public static final String TVDB_API_KEY = "<YOUR API KEY HERE>"; private RequestQueue mRequestQueue; private ImageLoader mImageLoader; @Override public void onCreate() { super.onCreate(); mRequestQueue = Volley.newRequestQueue(this); mImageLoader = new ImageLoader(mRequestQueue, new LruBitmapCache(getCacheSize())); } public RequestQueue getRequestQueue() { return mRequestQueue; } public ImageLoader getImageLoader() { return mImageLoader; } public static App getInstance(Context context) { return (App) context.getApplicationContext(); } private int getCacheSize() { final DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); final int screenWidth = displayMetrics.widthPixels; final int screenHeight = displayMetrics.heightPixels; final int screenBytes = screenWidth * screenHeight * 4; return screenBytes * 3; } }