congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Volley
Code IndexAdd Tabnine to your IDE (free)

How to use
Volley
in
com.android.volley.toolbox

Best Java code snippets using com.android.volley.toolbox.Volley (Showing top 20 results out of 738)

origin: bumptech/glide

 private static RequestQueue getInternalQueue(Context context) {
  if (internalQueue == null) {
   synchronized (Factory.class) {
    if (internalQueue == null) {
     internalQueue = Volley.newRequestQueue(context);
    }
   }
  }
  return internalQueue;
 }
}
origin: mcxiaoke/android-volley

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context) {
  return newRequestQueue(context, null);
}
origin: mcxiaoke/android-volley

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @param stack An {@link HttpStack} to use for the network, or null for default.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context, HttpStack stack)
{
  return newRequestQueue(context, stack, -1);
}

origin: chentao0707/SimplifyReader

  /**
   * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
   *
   * @param context A {@link android.content.Context} to use for creating the cache dir.
   * @return A started {@link RequestQueue} instance.
   */
  public static RequestQueue newRequestQueue(Context context) {
    return newRequestQueue(context, null);
  }
}
origin: mcxiaoke/android-volley

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 * You may set a maximum size of the disk cache in bytes.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @param maxDiskCacheBytes the maximum size of the disk cache, in bytes. Use -1 for default size.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context, int maxDiskCacheBytes) {
  return newRequestQueue(context, null, maxDiskCacheBytes);
}

origin: kaushikgopal/RxJava-Android-Samples

public static void init(Context context) {
 mRequestQueue = Volley.newRequestQueue(context);
}
origin: jiangqqlmj/FastDev4Android

  /**
   * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
   *
   * @param context A {@link Context} to use for creating the cache dir.
   * @return A started {@link RequestQueue} instance.
   */
  public static RequestQueue newRequestQueue(Context context) {
    return newRequestQueue(context, null);
  }
}
origin: jiangqqlmj/FastDev4Android

  public static RequestQueue getInstace(Context pContext){
    if(instance==null){
      instance= Volley.newRequestQueue(pContext);
    }
    return instance;
  }
}
origin: Aspsine/SwipeToLoadLayout

  public static RequestQueue getRequestQueue() {
    if (sRequestQueue == null) {
      sRequestQueue = Volley.newRequestQueue(sContext);
    }
    return sRequestQueue;
  }
}
origin: bumptech/glide

private Api(Context context) {
 this.requestQueue = Volley.newRequestQueue(context.getApplicationContext());
 QueryListener queryListener = new QueryListener() {
  @Override
  public void onSearchCompleted(Query query, List<Photo> photos) {
   lastQueryResult = new QueryResult(query, photos);
  }
  @Override
  public void onSearchFailed(Query query, Exception e) {
   lastQueryResult = null;
  }
 };
 queryListeners.add(queryListener);
}
origin: jiangqqlmj/FastDev4Android

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestQueue=Volley.newRequestQueue(this);
}
@Click({R.id.top_bar_linear_back,R.id.btn_string,R.id.btn_json,R.id.btn_image_request,R.id.btn_image_loader,R.id.btn_image_network,R.id.btn_string_post,R.id.btn_loader_list,R.id.btn_gson,R.id.btn_fdv_get_params,R.id.btn_fdv_post_params})
origin: commonsguy/cw-omnibus

private VolleyManager(Context ctxt) {
 queue=Volley.newRequestQueue(ctxt);
 imageLoader=new ImageLoader(queue, new LruBitmapCache(ctxt));
}
origin: bumptech/glide

@Before
public void setUp() throws IOException {
 MockitoAnnotations.initMocks(this);
 waitForResponseLatch = new CountDownLatch(1);
 doAnswer(new CountDown()).when(callback).onDataReady(any(InputStream.class));
 doAnswer(new CountDown()).when(callback).onLoadFailed(any(Exception.class));
 requestQueue = Volley.newRequestQueue(RuntimeEnvironment.application);
 mockWebServer = new MockWebServer();
 mockWebServer.start();
 streamCaptor = ArgumentCaptor.forClass(InputStream.class);
}
origin: jiangqqlmj/FastDev4Android

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestQueue= Volley.newRequestQueue(this);
  imageLoader=new ImageLoader(requestQueue,new Fdv_ImageCache());
}
@AfterViews
origin: syncthing/syncthing-android

private RequestQueue getVolleyQueue() {
  if (sVolleyQueue == null) {
    Context context = mContext.getApplicationContext();
    sVolleyQueue = Volley.newRequestQueue(context, new NetworkStack());
  }
  return sVolleyQueue;
}
origin: JasonQS/Anti-recall

private void sendMsg() {
  RequestQueue queue = Volley.newRequestQueue(getContext());
  StringRequest request = new StringRequest(Request.Method.POST, "http://ar.qsboy.com/j/applyCaptcha",
      response -> {
        Log.i(TAG, "sendMsg: " + response);
        captcha = response;
      },
      error -> Log.e(TAG, "sendMsg: " + error)) {
    @Override
    protected Map<String, String> getParams() {
      Map<String, String> map = new HashMap<>();
      map.put("phone", phone);
      return map;
    }
  };
  queue.add(request);
}
origin: JasonQS/Anti-recall

/**
 * 支付宝支付业务
 */
public void pay(String type) {
  StringRequest request = new StringRequest(Request.Method.POST, "http://ar.qsboy.com/j/pay",
      response -> {
        Log.i(TAG, "sendMsg: " + response);
        Runnable payRunnable = () -> {
          PayTask alipay = new PayTask(activity);
          Map<String, String> result = alipay.payV2(response, true);
          Log.i("msp", result.toString());
          Message msg = new Message();
          msg.what = SDK_PAY_FLAG;
          msg.obj = result;
          mHandler.sendMessage(msg);
        };
        Thread payThread = new Thread(payRunnable);
        payThread.start();
      },
      error -> Log.e(TAG, "sendMsg: " + error)) {
    @Override
    protected Map<String, String> getParams() {
      Map<String, String> map = new HashMap<>();
      map.put("type", type);
      return map;
    }
  };
  RequestQueue queue = Volley.newRequestQueue(activity);
  queue.add(request);
}
origin: JasonQS/Anti-recall

private boolean verifyCaptcha(String captcha) {
  RequestQueue queue = Volley.newRequestQueue(getContext());
  RequestFuture future = RequestFuture.newFuture();
  StringRequest request = new StringRequest(Request.Method.POST,
      "http://ar.qsboy.com/j/verifyCaptcha", future, future) {
    @Override
    protected Map<String, String> getParams() {
      Map<String, String> map = new HashMap<>();
      map.put("phone", phone);
      map.put("captcha", captcha);
      return map;
    }
  };
  queue.add(request);
  try {
    String s = (String) future.get(5, TimeUnit.SECONDS);
    boolean isValid = s != null && s.length() > 0;
    if (isValid) {
      Gson gson = new Gson();
      gson.fromJson(s, App.User.class);
    }
    return isValid;
  } catch (InterruptedException | ExecutionException | TimeoutException e) {
    e.printStackTrace();
    return false;
  }
}
origin: com.mcxiaoke.volley/library

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context) {
  return newRequestQueue(context, null);
}
origin: jungletian/TitanjumNote

/**
 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
 *
 * @param context A {@link Context} to use for creating the cache dir.
 * @param stack An {@link HttpStack} to use for the network, or null for default.
 * @return A started {@link RequestQueue} instance.
 */
public static RequestQueue newRequestQueue(Context context, HttpStack stack)
{
  return newRequestQueue(context, stack, -1);
}

com.android.volley.toolboxVolley

Javadoc

Volley主入口类,来获取请求队列对象

Most used methods

  • newRequestQueue
    Creates a default instance of the worker pool and calls RequestQueue#start() on it. You may set a ma

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Permission (java.security)
    Legacy security code; do not use.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now