I use BasicNameValuePair class for passing String parameters with HttpPost in my Android application. How can I pass non String parameters like Double, Byte Array etc?
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer:
You can’t. Not really.
Long answer:
The stuff that can be easily converted to a string you can just convert to a string (.toString) and parse (Double.parseStr()).
Common practice for byte arrays is to encode them in – for instance – Base64. Android docs here