Category : android-volley

Not sure where I make a mistake. Code: public class VaccinationTotalUSA extends Fragment { RecyclerView rvRecentRecord; ProgressBar progressBar; private static final String TAG = VaccinationTotalUSA.class.getSimpleName(); ArrayList<VaccinationTimeline> recentRecords; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_vaccination, container, false); // call view rvRecentRecord = view.findViewById(R.id.vaccinationRecord); progressBar = ..

Read more

I am trying to get json data from my php server but whenever i try im getting "org.json.JSONException: End of input at character 0 of" also im using fragment for bottom menu private void getData() { // Initialize a new RequestQueue instance RequestQueue queue = Volley.newRequestQueue(this); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, dataurl+name, null, new Response.Listener<JSONObject>() ..

Read more

I have updated volley to 1.2.0. I got confused between the request listener and deliverResponse. If i get the response in StringRequest stringRequest = new StringRequest(apiUrl, response -> {} then why would i need an override method like @Override protected void deliverResponse(String response) { super.deliverResponse(response);} <br/> Can someone simplify these please. Thanks. Source: Android..

Read more

This is the class I’m using: https://gist.github.com/ycui1/5d25672430e6c014a9ef6b422f82652e this is the code: val request = object: VolleyFileUploadRequest(Method.POST, url, Response.Listener { val response = JSONObject(it) // finishSend(response, comment) }, Response.ErrorListener { commentNotSent() } ) { override fun getByteData(): MutableMap<String, FileDataPart> { val params = HashMap<String, FileDataPart>() params["file"] = FileDataPart("file$rnds", getBytes(finalInputSteam!!)!!,"fffff") return params } override fun getParams(): MutableMap<String, ..

Read more

I am trying to access data sent from stringRequest here: public class ProductDetailActivity extends AppCompatActivity { String cart_url = "http://192.168.1.15/AndroidAppDatabaseConnection/add_to_cart.php"; String favorites_url = "http://192.168.1.15/AndroidAppDatabaseConnection/add_to_favorites.php"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_product_detail); Intent intent = getIntent(); String imageUrl = intent.getStringExtra(EXTRA_URL); String email = intent.getStringExtra("user"); final int product_id = intent.getIntExtra(EXTRA_ID, 0); String name = intent.getStringExtra(EXTRA_NAME); Double ..

Read more

<?php $host = "localhost"; $user = "******"; $pass = "******"; $dbname = "******"; $conn = mysqli_connect($host, $user, $pass,$dbname); if(!$conn){ die(‘Could not connect: ‘.mysqli_connect_error()); } else{ $a=$_POST[‘a’]; $b=$_POST[‘b’]; $target_dir="upoads"; $image=$a; if(!file_exists($target_dir)){ mkdir($target_dir,0777,true); } $one=rand()."_".time().".jpeg"; ‘$target_dir1=$target_dir."/".$one; if(file_put_contents($target_dir1,base64_decode($image))){ // echo ‘{The file has been Uploaded.}’; }’ here is how i insert my file $target_di="http://myserver.online/nostics/$target_dir1"; $sql="UPDATE rmreg SET photo ..

Read more