android-volley

com.android.volley.NoConnectionError: java.net.UnknownHostException

做~自己de王妃 提交于 2019-12-25 14:11:54
问题 i have to do some network operations with Volly. i am getting com.android.volley.NoConnectionError: java.net.UnknownHostException for below Code. String url="https://www.user.url.in" JsonObjectRequest medStats = new JsonObjectRequest(Request.Method.PUT, url, object, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { Boolean success = response.getBoolean("success"); System.out.println("On Success" + success); // Toast.makeText

Volley-AuthFailureError

谁说胖子不能爱 提交于 2019-12-25 09:28:41
问题 I am trying to insert new user in phpMyAdmin database when users populate textboxes on android device. For that i write php code and I test it on POSTMAN and it's works but when i test on android real device i got AuthFailureError! In POSTMAN i set Authorization to "No Auth". This is my code in android studio: public class Registration extends AppCompatActivity { private EditText name,surname,email,password,adress; private Button btnLog; private RequestQueue requestQueue; private static final

Android Volley how to synchronize data from Listener.onRespone() for to use it outside onRespone()

主宰稳场 提交于 2019-12-25 08:41:04
问题 I need to read data from a internet server and display it in MainActivity via ListView. I've decided to use Volley lib to get data. After reading stackoverflow for hours I've achieved to extract data from JSONArray via Volley lib using callback. My code is follows public class DownloadsManager { public interface VolleyCallback { void onSuccess(JSONArray result); } public static void getVolleyResponse(String url, Context ctx, final VolleyCallback callback) { RequestQueue requestQueue = Volley

Unable to add window Android dialog box

左心房为你撑大大i 提交于 2019-12-25 07:17:48
问题 First the user enter his username and password, then the app gets a list of data from an API. I'm trying to show a dialog box while the the app is synchronizing the data from an API, but I'm getting the following error: Log: ERROR 07-03 14:12:29.791 24439-24439/com.rep E/AndroidRuntime﹕ FATAL EXCEPTION: main android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application at android.view.ViewRootImpl.setView(ViewRootImpl.java:571) at android.view

Get WCF REST GET request in Android

旧城冷巷雨未停 提交于 2019-12-25 06:48:36
问题 When I call to my WCF service using andoroid volley library it throw TimeOut Exception. This is my code. What is the error of this code. RequestQueue queue = Volley.newRequestQueue(getApplicationContext()); String URL = "http://192.168.42.200:10963/DisasterService.svc/type/findDisType"; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, URL, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { Toast.makeText

Android Volley code 400

别来无恙 提交于 2019-12-25 06:43:55
问题 I'm trying to post data to website. It is login operation. I check form data hidden tag etc. In form data there is a hidden input _RequestVerificationToken. That's why first, I made get request to parse _RequestVerificationToken and for headers. StringRequest _StringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { //Parsing Process } }, new Response.ErrorListener() { @Override public void onErrorResponse

Android Studio Gradle error “Multiple dex files define…”

ぐ巨炮叔叔 提交于 2019-12-25 06:23:13
问题 My Project was working fine, until I added the volley library. Then, it started giving me an error like this: Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.> java.util.zip.ZipException: duplicate entry: com/android/volley/AuthFailureError.class What should I do to fix this error? My App gradle is below apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId

Android Studio Project broken after adding Google Volley

扶醉桌前 提交于 2019-12-25 04:15:30
问题 I added Google volley to my app project. However, now I can no longer compile it. When trying to Gradle sync I constantly get the following error message: Error:Cause: failed to find target with hash string 'android-22' in: /Users/Tom/Library/Android/sdk Open Android SDK Manager I opened the SDK Manager and installed everything that was requested. However, I'm still getting the same error. I did the following: git clone volley project In Studio: File -> New -> New Module -> Import Gradle

Android Volley “Unknown Host Exception” when tried to fetch IPV6 address

微笑、不失礼 提交于 2019-12-25 04:12:31
问题 Im trying to get IPV6 public address via volley. So far, i managed to toast ip address for IPV4 but when volley tries to fetch IPV6 data, it throws Unknown Host Exception even the code for both method were same except the url part.. What happen? I already give internet permission in manifest. My implementation were as below: Service file @Override public int onStartCommand(Intent pIntent, int flags, int startId) { // TODO Auto-generated method stub Toast.makeText(this, "Restart service!",

GsonRequest with POST

我只是一个虾纸丫 提交于 2019-12-25 03:52:21
问题 This is currently the code that I'm using: /** * Volley adapter for JSON requests that will be parsed into Java objects by Gson. */ public class GsonRequest<T> extends Request<T> { private final Gson gson = new GsonBuilder() .registerTypeAdapter(ClusterUnits.class, new ClusterUnitsDeserializer()).create(); private final Class<T> clazz; private final Map<String, String> headers; private final Listener<T> listener; private JSONObject parameters = null; /** * Make a GET request and return a