Android NameValuePair - 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 NameValuePair class.

This code example shows how to use the following methods:getValue
    private static ContentType create(final HeaderElement helem) {
        String mimeType = helem.getName();
        String charset = null;
        NameValuePair param = helem.getParameterByName("charset");
        if (param != null) {
            charset = param.getValue();
        } 
        return create(mimeType, charset);
    } 
 
    /** 
     * Parses textual representation of <code>Content-Type</code> value. 
     * 
     * @param s text 
     * @return content type 
     * @throws ParseException if the given text does not represent a valid 
     * <code>Content-Type</code> value. 
     */ 
    public static ContentType parse( 
            final String s) throws ParseException, UnsupportedCharsetException {
5
CodeRank
This code example shows how to use the following methods:getValue
            if (elems.length > 0) {
                HeaderElement elem = elems[0];
                contentType = elem.getName();
                NameValuePair param = elem.getParameterByName("charset");
                if (param != null) {
                    charset = param.getValue();
                } 
            } 
        } 
 
        if (contentType != null && contentType.equalsIgnoreCase(CONTENT_TYPE)) {
            final String content = EntityUtils.toString(entity, HTTP.ASCII);
            if (content != null && content.length() > 0) {
                result = new ArrayList <NameValuePair>();
                org.apache.http.client.utils.URLEncodedUtils.parse(result, new Scanner(content), charset);
            } 
        } 
        return result;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getValue
        Assert.assertEquals(1, elems.length);
 
        HeaderElement elem = elems[0];
        Assert.assertEquals("multipart/form-data", elem.getName());
        NameValuePair p1 = elem.getParameterByName("boundary");
        Assert.assertNotNull(p1);
 
        String boundary = p1.getValue();
        Assert.assertNotNull(boundary);
 
        Assert.assertTrue(boundary.length() >= 30);
        Assert.assertTrue(boundary.length() <= 40);
 
        NameValuePair p2 = elem.getParameterByName("charset");
        Assert.assertNull(p2);
    } 
 
    @Test 
    public void testRepeatable() throws Exception { 
        MultipartEntity entity = new MultipartEntity();
4
CodeRank
This code example shows how to use the following methods:getValue
	private static final long serialVersionUID = 1L;
 
	@Override 
	public boolean add(NameValuePair nameValuePair)
	{ 
		if (!TAStringUtils.isEmpty(nameValuePair.getValue()))
		{ 
			return super.add(nameValuePair);
		} else 
		{ 
			return false; 
		} 
	} 
 
	/** 
	 * Ìí¼ÓÊý¾Ý 
	 *  
	 * @param key 
	 * @param value 
	 * @return 
4
CodeRank
This code example shows how to use the following methods:getValue
 
    private static final long serialVersionUID = 1L;
 
    @Override 
    public boolean add(NameValuePair nameValuePair) {
        if(QStrOperate.hasValue(nameValuePair.getValue())){
            return super.add(nameValuePair);
        }else{ 
            return false; 
        } 
    } 
     
     
 
 
} 
4
CodeRank
This code example shows how to use the following methods:getName, getValue
This code example shows how to use the following methods:getName
		} 
		 
		Collections.sort(list, new Comparator<NameValuePair>() {
	        @Override 
	        public int compare(NameValuePair object1, NameValuePair object2) {
	            return String.CASE_INSENSITIVE_ORDER.compare(object1.getName(), object2.getName());
	        } 
	    }); 
 
		 
		String encoded = URLEncodedUtils.format(list, "UTF-8");
		 
		String url2call = new StringBuilder(APIURL)
			.append('?').append(encoded)
			.append("&hashkey=").append(SHA1(encoded+"&"+apiKey))
			.toString();
		 
		Log.d(TAG, url2call);
		 
		HttpEntity entity = null;
4
CodeRank

Related Android NameValuePair Questions & Answers:

See Code Examples for Android NameValuePair Methods: