GithubHelp home page GithubHelp logo

android_volley_examples's People

Contributors

balduzzi85 avatar drkein avatar ogrebgr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android_volley_examples's Issues

SSL context may not be null only with API 15

Hi,

if i try with API level = 15 i have this error:

1496-1510/com.package E/Volley﹕ [81] NetworkDispatcher.run: Unhandled exception java.lang.IllegalArgumentException: SSL context may not be null

The examples might need more comments

I'm a beginner Android developer and I've barely been exposed to basic Java before. As a result, I'm finding it difficult to understand some of these examples.

For instance I'm reading through "android_volley_examples / src / com / github / volley_examples / Act_SimpleRequest.java" and trying to figure out what you're doing and what parts I can apply to my own code. Within the code, there's interactions with the UI, additional function calls, and new functions added further down the file. Figuring out these parts took a while, and figuring out more of the examples might take even longer.

Could you add some simple comments that summarize what's going on to some of your examples?

JsonRequest with SSL

Hi,

i try to do simple JsonRequest with TLS/SSL and i write this code:

// Replace R.raw.clienttruststore with your trust keystore in this import server cert
InputStream trustKeyStore = getResources().openRawResource(R.raw.clienttruststore);

            // Replace R.raw.client with your client keystore
            InputStream keyStore = getResources().openRawResource(R.raw.client);

            RequestQueue queue = Volley
                    .newRequestQueue(Act_JsonRequest.this,
                            new ExtHttpClientStack(new SslHttpClient(trustKeyStore, "secret", 443, keyStore)));



            JsonObjectRequest myReq = new JsonObjectRequest(Method.GET, 
                                                    "https://192.168.1.4:8443/REST/app/generali/getA",null,
                                                    createMyReqSuccessListener(),
                                                    createMyReqErrorListener()){
                @Override
                public Map<String, String> getHeaders() throws AuthFailureError {
                    return createBasicAuthHeader("1", "2");
                }};
            queue.add(myReq);
}
    });

But not work, if i try with StringRequest work..but i want Json..you have any idea?

Synchronous Example

I was wondering if you could add a synchronous example to your set that uses RequestFuture and future.get(4, TimeUnit.SECONDS)
I followed the sample in the source code of the RequestFuture but future.get() blocks first and then times out with no result!

Thanks

How to implement non JSON services?

Hi,
Thanks for sharing such a good library. I used this in some android apps contains JSON Request and Response but now i am working on GraphQL so, it is different from JSON. Do you have chance to share some sample code how to implement volley using GraphQL

Error in the SSLHttpClient

Hi,

I wanted to use your library to better understand how I can use SSL with Volley, the only problem is that I got exception on my 4.1.2 and 4.4.4 emulators. The real problem is that these exceptions aren't same on both devices : I receive a javax.net.ssl.SSLPeerUnverifiedException on the 4.1.2 (which seems quite logical because it's a self-signed certificate) but on the 4.4.4 it's quite critical because I'm receiving a java.net.UnknownHostException. I checked and the address is ok : it's yours!

SocketFactory

Hi,

Trying to use new httpClient with PoolingHttpClientConnectionManager. Having so many issue.
Is there any way that I can get source of khandroid-httpclient-4.2.3.jar?

Regards,

Mike

IllegalStateException: RequestQueue not Initialized

Why does it return the exception? I've followed through your codes.

Logs
Caused by: java.lang.IllegalStateException: RequestQueue Not Initialized at com.capstone.artink.app.CustomVolley.getRequestQueue(CustomVolley.java:29) at com.capstone.artink.Dashboard.onCreate(Dashboard.java:101) at android.app.Activity.performCreate(Activity.java:5008) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)  at android.app.ActivityThread.access$600(ActivityThread.java:130)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:137)  at android.app.ActivityThread.main(ActivityThread.java:4745)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:511)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)  at dalvik.system.NativeStart.main(Native Method) 

This is the CustomVolley(MyVolley).

package com.capstone.artink.app;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.capstone.artink.utils.LruBitmapCache;

public class CustomVolley{

    private static RequestQueue mRequestQueue;
    private static ImageLoader mImageLoader;

    private CustomVolley(){

    }

    static void init(Context context){
        mRequestQueue = Volley.newRequestQueue(context);
        mImageLoader = new ImageLoader(mRequestQueue, new LruBitmapCache());
    }

    public static RequestQueue getRequestQueue(){
        if(mRequestQueue != null){
            return mRequestQueue;
        }
        else { throw new IllegalStateException("RequestQueue Not Initialized"); }
    }

    public static ImageLoader getImageLoader(){
        if(mImageLoader != null){
            return mImageLoader;
        }

        else
        { throw new IllegalStateException("ImageLoader Not Initialized"); }
    }
}

This is the error on Dashboard.java line 101

RequestQueue queue = CustomVolley.getRequestQueue();

        final String user = username;
        final String type = usertype;

        JsonObjectRequest myRequest = new JsonObjectRequest(Request.Method.GET,
                Config.ENT_PROFILE_URL,
                null,
                RequestSuccessListener(),
                RequestFailedListener()) {

        };
        queue.add(myRequest);

I think I posted at the wrong file, it's supposed to be at Act_JsonRequest.java

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.