Android BasicNameValuePair - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BasicNameValuePair class.

This code example shows how to use the following methods:
   * @param key - キー 
   * @param value - 値 
   * </span> 
   */ 
  public void addQueryParams(String key, String value) {
    queryParams.add(new BasicNameValuePair(key, value));
  } 
  protected List<NameValuePair> queryParams() {
    return queryParams;
  } 
  private List<NameValuePair> queryParams = new ArrayList<NameValuePair>();	
 
  //*********************************************************** 
  // Methods 
  //*********************************************************** 
 
  protected Scheme createScheme() {
    if(SCHEME_HTTPS.equals(scheme())) {
      return new Scheme(scheme(), HTTPS_PORT, SSLSocketFactory.getSocketFactory());
    } else if(port() == -1) { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
     */ 
    public URIBuilder addParameter(final String param, final String value) {
        if (this.queryParams == null) {
            this.queryParams = new ArrayList<NameValuePair>();
        } 
        this.queryParams.add(new BasicNameValuePair(param, value));
        this.encodedQuery = null;
        this.encodedSchemeSpecificPart = null;
        return this;
    } 
 
    /** 
     * Sets parameter of URI query overriding existing value if set. The parameter name and value 
     * are expected to be unescaped and may contain non ASCII characters. 
     */ 
    public URIBuilder setParameter(final String param, final String value) {
        if (this.queryParams == null) {
            this.queryParams = new ArrayList<NameValuePair>();
        } 
        if (!this.queryParams.isEmpty()) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	    HttpPost httppost = new HttpPost(PUSH_URL);
 
	    try { 
	        // Add your data 
	        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(4);
	        nameValuePairs.add(new BasicNameValuePair("user", user));
	        nameValuePairs.add(new BasicNameValuePair("sender", sender));
	        nameValuePairs.add(new BasicNameValuePair("phone", phone));
	        nameValuePairs.add(new BasicNameValuePair("sms", sms));
	        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, HTTP.UTF_8));
 
	        // Execute HTTP Post Request 
	        httpclient.execute(httppost);
	         
	    } catch (ClientProtocolException e) {
	        // TODO Auto-generated catch block 
	    } catch (IOException e) {
	        // TODO Auto-generated catch block 
	    } 
	}  
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
					List<NameValuePair> params = new ArrayList<NameValuePair>();
					params.add(new BasicNameValuePair("package_name", mPackageName));
					params.add(new BasicNameValuePair("package_version", mPackageVersion));
					params.add(new BasicNameValuePair("phone_model", Build.MODEL));
					params.add(new BasicNameValuePair("sdk_version", Build.VERSION.RELEASE));
					params.add(new BasicNameValuePair("message", msg));
 
					httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
					httpClient.execute(httpPost);
				} 
				catch (Exception e) {
				} 
			} 
		}).start();
	} 
 
	public static void dump(String longMsg) {
		dump(mTag, longMsg, LEVEL_INFO);
	} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
			List<NameValuePair> formparams = new ArrayList<NameValuePair>();
			formparams.add(new BasicNameValuePair("extTID", "1"));
			formparams.add(new BasicNameValuePair("extAction", "infoController"));
			formparams.add(new BasicNameValuePair("extMethod", "updateInfo"));
			formparams.add(new BasicNameValuePair("extType", "rpc"));
			formparams.add(new BasicNameValuePair("extUpload", "false"));
			formparams.add(new BasicNameValuePair("userName", "RALPH"));
			UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8");
 
			post.setEntity(postEntity);
 
			response = client.execute(post);
			HttpEntity entity = response.getEntity();
			assertThat(entity).isNotNull();
			String responseString = EntityUtils.toString(entity);
 
			ObjectMapper mapper = new ObjectMapper();
			Map<String, Object> rootAsMap = mapper.readValue(responseString, Map.class);
			assertThat(rootAsMap).hasSize(5);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
	@Test 
	public void testPostWithDate() throws IOException { 
		Locale.setDefault(Locale.ENGLISH);
		List<NameValuePair> formparams = new ArrayList<NameValuePair>();
		formparams.add(new BasicNameValuePair("extTID", "2"));
		formparams.add(new BasicNameValuePair("extAction", "userServiceInitBinderService"));
		formparams.add(new BasicNameValuePair("extMethod", "updateUser"));
		formparams.add(new BasicNameValuePair("extType", "rpc"));
		formparams.add(new BasicNameValuePair("extUpload", "false"));
		formparams.add(new BasicNameValuePair("name", "Bacon"));
		formparams.add(new BasicNameValuePair("firstName", "Kevin"));
		formparams.add(new BasicNameValuePair("email", "kevin@test.com"));
		formparams.add(new BasicNameValuePair("age", "45"));
		formparams.add(new BasicNameValuePair("flag", "true"));
		formparams.add(new BasicNameValuePair("dateOfBirth", "21.12.1966"));
		UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8");
 
		post.setEntity(postEntity);
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		formparams.add(new BasicNameValuePair("extTID", "3")); 
		formparams.add(new BasicNameValuePair("extAction", "userService")); 
		formparams.add(new BasicNameValuePair("extMethod", "updateUser")); 
		formparams.add(new BasicNameValuePair("extType", "rpc")); 
		formparams.add(new BasicNameValuePair("extUpload", "false")); 
		formparams.add(new BasicNameValuePair("name", "Jim")); 
		formparams.add(new BasicNameValuePair("age", "25")); 
		formparams.add(new BasicNameValuePair("email", "test@test.ch")); 
		UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8"); 
 
		post.setEntity(postEntity); 
 
		CloseableHttpResponse response = client.execute(post); 
		try { 
			HttpEntity entity = response.getEntity(); 
			assertThat(entity).isNotNull(); 
			String responseString = EntityUtils.toString(entity); 
 
			Map<String, Object> rootAsMap = mapper.readValue(responseString, Map.class); 
			assertThat(rootAsMap).hasSize(5); 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://cyanogenmodstats.appspot.com/submit");
        try { 
            List<NameValuePair> kv = new ArrayList<NameValuePair>(5);
            kv.add(new BasicNameValuePair("id", deviceId));
            kv.add(new BasicNameValuePair("type", deviceName));
            kv.add(new BasicNameValuePair("version", deviceVersion));
            kv.add(new BasicNameValuePair("country", deviceCountry));
            kv.add(new BasicNameValuePair("carrier", deviceCarrier));
            kv.add(new BasicNameValuePair("carrierid", deviceCarrierId));
            httppost.setEntity(new UrlEncodedFormEntity(kv));
            httpclient.execute(httppost);
        } catch (Exception e) {
            Log.e(TAG, "Got Exception", e);
        } 
 
        stopSelf();
    } 
 
    private void promptUser() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		formparams.add(new BasicNameValuePair("extTID", "3")); 
		formparams.add(new BasicNameValuePair("extAction", "userController")); 
		formparams.add(new BasicNameValuePair("extMethod", "updateUser")); 
		formparams.add(new BasicNameValuePair("extType", "rpc")); 
		formparams.add(new BasicNameValuePair("extUpload", "false")); 
		formparams.add(new BasicNameValuePair("name", "Jim")); 
		formparams.add(new BasicNameValuePair("age", "25")); 
		formparams.add(new BasicNameValuePair("email", "test@test.ch")); 
		UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8"); 
 
		post.setEntity(postEntity); 
 
		CloseableHttpResponse response = client.execute(post); 
		try { 
			HttpEntity entity = response.getEntity(); 
			assertThat(entity).isNotNull(); 
			String responseString = EntityUtils.toString(entity); 
 
			Map<String, Object> rootAsMap = mapper.readValue(responseString, Map.class); 
			assertThat(rootAsMap).hasSize(5); 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		} 
	} 
 
	private void addNameValuePair(List<NameValuePair> list, Set<String> fieldsToSend, String name, String value) {
		if (fieldsToSend.contains("all") || fieldsToSend.contains(name)) {
			list.add(new BasicNameValuePair(name, value));
		} 
		 
	} 
	 
	private boolean isFroyoOrAbove() { 
		int sdk = getSdkInt();
		return sdk >= 8;
	} 
	 
	private int getSdkInt() { 
		String sdk = android.os.Build.VERSION.SDK;
		try { 
			return Integer.parseInt(sdk);
		} catch (NumberFormatException e) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android BasicNameValuePair Questions & Answers:

Other Android BasicNameValuePair Examples

34:			// Building Parameters
35:			List<NameValuePair> params = new ArrayList<NameValuePair>();
36:			params.add(new BasicNameValuePair("tag", login_tag));
37:			params.add(new BasicNameValuePair("email", email));
38:			params.add(new BasicNameValuePair("password", password));
-
35:			List<NameValuePair> params = new ArrayList<NameValuePair>();
36:			params.add(new BasicNameValuePair("tag", login_tag));
37:			params.add(new BasicNameValuePair("email", email));
38:			params.add(new BasicNameValuePair("password", password));
39:			JSONObject json = jsonParser.getJSONFromUrl(loginURL, params);
-
36:			params.add(new BasicNameValuePair("tag", login_tag));
37:			params.add(new BasicNameValuePair("email", email));
38:			params.add(new BasicNameValuePair("password", password));
39:			JSONObject json = jsonParser.getJSONFromUrl(loginURL, params);
40:			// return json
-
52:			// Building Parameters
53:			List<NameValuePair> params = new ArrayList<NameValuePair>();
54:			params.add(new BasicNameValuePair("tag", register_tag));
55:			params.add(new BasicNameValuePair("name", name));
56:			params.add(new BasicNameValuePair("email", email));
-
53:			List<NameValuePair> params = new ArrayList<NameValuePair>();
54:			params.add(new BasicNameValuePair("tag", register_tag));
55:			params.add(new BasicNameValuePair("name", name));
56:			params.add(new BasicNameValuePair("email", email));
57:			params.add(new BasicNameValuePair("password", password));
-
54:			params.add(new BasicNameValuePair("tag", register_tag));
55:			params.add(new BasicNameValuePair("name", name));
56:			params.add(new BasicNameValuePair("email", email));
57:			params.add(new BasicNameValuePair("password", password));
58:			
-
55:			params.add(new BasicNameValuePair("name", name));
56:			params.add(new BasicNameValuePair("email", email));
57:			params.add(new BasicNameValuePair("password", password));
58:			
59:			// getting JSON Object

Read More

33:			// key and value pair
34:			List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
35:			nameValuePair.add(new BasicNameValuePair("email", "user@gmail.com"));
36:			nameValuePair.add(new BasicNameValuePair("message",
37:					"Hi, trying Android HTTP post!"));
-
34:			List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
35:			nameValuePair.add(new BasicNameValuePair("email", "user@gmail.com"));
36:			nameValuePair.add(new BasicNameValuePair("message",
37:					"Hi, trying Android HTTP post!"));
38:

Read More

86:				List<NameValuePair> params = new ArrayList<NameValuePair>();
87:				params.add(new BasicNameValuePair("name", name));
88:				params.add(new BasicNameValuePair("price", price));
89:				params.add(new BasicNameValuePair("description", description));
90:	
-
87:				params.add(new BasicNameValuePair("name", name));
88:				params.add(new BasicNameValuePair("price", price));
89:				params.add(new BasicNameValuePair("description", description));
90:	
91:				// getting JSON Object
-
88:				params.add(new BasicNameValuePair("price", price));
89:				params.add(new BasicNameValuePair("description", description));
90:	
91:				// getting JSON Object
92:				// Note that create product url accepts POST method

Read More

See Code Examples for Android BasicNameValuePair Methods: