Posts

Showing posts from November, 2014

how to used wget to quickly download many files

1.what i need used wget to batch download many files. then i used excel input : 1 row 1 column text: http://example.com/1.txt 2 row 1 column text: http://example.com/2.txt then draw  these two rows to 100 rows,so it will generate from http://example.com/1.txt to http://example.com/100.txt . after that,copy this all content,then paste them to text editor for download.txt  2.how command >wget -i download.txt --content-disposition download.txt: http: //example.com/1.txt http: //example.com/2.txt // more file here... http://example.com/100.txt 3. last: thanks!

android get and post url content code sample

1.code package com.pkrss.helper; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.util.Map; public class WebHelper { public static String GetPageContent(String pageURL) { return _GetRemotePageContent( "GET" ,pageURL, null ); } public static String GetPostPageContent(String pageURL,Map<String,String> parameters) { return _GetRemotePageContent( "POST" ,pageURL,parameters); } private static String _GetRemotePageContent(String method,String pageURL,Map<String,String> parameters) { String pageContent= "" ; BufferedReader in = null ; InputStreamReader isr = null ; InputStream is = null ; HttpURLConnection huc = null ; try { String strp...

11-24 22:27:37.685: E/AndroidRuntime(8653): Caused by: java.lang.InstantiationException: can't instantiate class com.pkrss.webview_core.WebViewHasControlActivity$FragmentOptionsDialog; no empty constructor

1.error: 11-24 22:27:37.685: E/AndroidRuntime(8653): Caused by: java.lang.InstantiationException: can't instantiate class com.pkrss.webview_core.WebViewHasControlActivity$FragmentOptionsDialog; no empty constructor 2.fixed: old: public class WebViewHasControlActivity{ private class FragmentOptionsDialog extends FragmentBaseDialog { public FragmentOptionsDialog( int arg1){ } } } new : public class WebViewHasControlActivity{ } public class FragmentOptionsDialog extends FragmentBaseDialog { public FragmentOptionsDialog(){ } public void setArg1( int arg1){ } } 3.Last Thanks!

Android java enumerate JSONObject child items code

1.what i need enumerate the JSONObject child item key and value by code 2.how JSONObject obj = null ; // please set this not null value in first Iterator<String> k = obj.keys(); String key; Object value ; while (k.hasNext()){ key = k.next(); value = obj.opt(key); if ( value == null || obj.isNull(key) ) continue ; if ( value instanceof JSONArray){ JSONArray jary = (JSONArray) value ; } else if ( value instanceof JSONObject){ JSONObject jobj = (JSONObject) value ; } else if ( value instanceof String){ String s = (String) value ; } else if ( value instanceof Long){ Long l = (Long) value ; } ...

android Spinner setAdapter ArrayAdapter

1.xml: <Spinner android:id= "@+id/spinner" android:layout_width= "match_parent" android:layout_height= "wrap_content" /> 2.code: List<String> _spinnerList; ArrayAdapter _spinnerAdapter; _spinnerList = new ArrayList<String>(); _spinnerAdapter = new ArrayAdapter<String>( this ,android.R.layout.simple_spinner_item, _spinnerList); _spinnerList.add( "1" ); _spinnerList.add( "2" ); _spinnerList.add( "3" ); Spinner spinner = (Spinner) this .findViewById(R.id.spinner); spinner.setAdapter(_spinnerAdapter); 3.event: _spinner.setOnItemSelectedListener( new OnItemSelectedListener(){ @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { // get content: ...