¡@

Home 

2014/10/16 ¤W¤È 08:23:29

android Programming Glossary: sb

JSONException: Value of type java.lang.String cannot be converted to JSONObject

http://stackoverflow.com/questions/10267910/jsonexception-value-of-type-java-lang-string-cannot-be-converted-to-jsonobject

new InputStreamReader is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine.. String line null while line reader.readLine null sb.append line n is.close hier habe ich das JSON File als String.. n is.close hier habe ich das JSON File als String json sb.toString Log.i JSON Parser json catch Exception e Log.e Buffer..

Android Image View Pinch Zooming

http://stackoverflow.com/questions/10630373/android-image-view-pinch-zooming

OUTSIDE POINTER_DOWN POINTER_UP 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode.. int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append names actionCode if actionCode.. actionCode MotionEvent.ACTION_POINTER_UP sb.append pid .append action MotionEvent.ACTION_POINTER_ID_SHIFT..

Contact Bubble EditText

http://stackoverflow.com/questions/10812316/contact-bubble-edittext

Editable e tv.getEditableText final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan.. final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext.. sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE..

http post method passing null values to the server

http://stackoverflow.com/questions/13134019/http-post-method-passing-null-values-to-the-server

BufferedReader reader new BufferedReader isr StringBuffer sb new StringBuffer while line reader.readLine null sb.append.. sb new StringBuffer while line reader.readLine null sb.append line response sb.toString response.getEntity .getContent.. while line reader.readLine null sb.append line response sb.toString response.getEntity .getContent Log.i Test updated..

pass arraylist bean from android to webservice php

http://stackoverflow.com/questions/17057712/pass-arraylist-bean-from-android-to-webservice-php

new InputStreamReader is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine.. String line null while line reader.readLine null sb.append line n is.close json sb.toString catch Exception.. reader.readLine null sb.append line n is.close json sb.toString catch Exception e Log.e Buffer Error Error converting..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

content mms part id InputStream is null StringBuilder sb new StringBuilder try is getContentResolver .openInputStream.. isr String temp reader.readLine while temp null sb.append temp temp reader.readLine catch IOException e finally.. if is null try is.close catch IOException e return sb.toString How to get image from MMS It's the same than getting..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

response.getEntity .getContent StringBuffer sb new StringBuffer String line String NL System.getProperty line.separator.. line.separator while line in.readLine null sb.append line NL in.close String page sb.toString System.out.println.. in.readLine null sb.append line NL in.close String page sb.toString System.out.println page tv.setText page catch ClientProtocolException..

Simple HTTP client example in Android [closed]

http://stackoverflow.com/questions/4457492/simple-http-client-example-in-android

new BufferedReader new InputStreamReader is StringBuilder sb new StringBuilder String line null try while line reader.readLine.. String line null try while line reader.readLine null sb.append line n catch IOException e e.printStackTrace finally..

AlertDialog from within BroadcastReceiver?? Can it be done?

http://stackoverflow.com/questions/4844031/alertdialog-from-within-broadcastreceiver-can-it-be-done

.equals SMSPopUpReceiver.ACTION StringBuilder sb new StringBuilder Bundle bundle intent.getExtras if bundle.. SmsMessage messages SmsMessage.createFromPdu byte pdu sb.append Received SMS nFrom sb.append messages.getDisplayOriginatingAddress.. byte pdu sb.append Received SMS nFrom sb.append messages.getDisplayOriginatingAddress sb.append n Message..

Geocoder.getFromLocation throws IOException on Android emulator

http://stackoverflow.com/questions/5205650/geocoder-getfromlocation-throws-ioexception-on-android-emulator

location.getLongitude 10 StringBuilder sb new StringBuilder if myList.size 0 Address address myList.get.. 0 for int i 0 i address .getMaxAddressLineIndex i sb.append address.getAddressLine i .append n sb.append address.getLocality.. i sb.append address.getAddressLine i .append n sb.append address.getLocality .append n sb.append address.getPostalCode..

Rotate zoom drag image in android imageview

http://stackoverflow.com/questions/5894736/rotate-zoom-drag-image-in-android-imageview

OUTSIDE POINTER_DOWN POINTER_UP 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode.. int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append names actionCode if actionCode.. actionCode MotionEvent.ACTION_POINTER_UP sb.append pid .append action MotionEvent.ACTION_POINTER_ID_SHIFT..

How to Consume WCF Service with Android

http://stackoverflow.com/questions/669764/how-to-consume-wcf-service-with-android

try int length int entity.getContentLength StringBuffer sb new StringBuffer length InputStreamReader isr new InputStreamReader.. char length int cnt while cnt isr.read buff 0 length 1 0 sb.append buff 0 cnt response sb.toString isr.close catch IOException.. isr.read buff 0 length 1 0 sb.append buff 0 cnt response sb.toString isr.close catch IOException ioe ioe.printStackTrace..

Android/SQLite IN clause and placeholders

http://stackoverflow.com/questions/7418849/android-sqlite-in-clause-and-placeholders

new RuntimeException No placeholders else StringBuilder sb new StringBuilder len 2 1 sb.append for int i 1 i len i sb.append.. else StringBuilder sb new StringBuilder len 2 1 sb.append for int i 1 i len i sb.append return sb.toString ..

android.os.NetworkOnMainThreadException . Need to use async task?

http://stackoverflow.com/questions/8612406/android-os-networkonmainthreadexception-need-to-use-async-task

response.getEntity .getContent StringBuffer sb new StringBuffer String line String NL System.getProperty.. line.separator while line in.readLine null sb.append line NL in.close String result sb.toString return.. null sb.append line NL in.close String result sb.toString return result finally if in null try in.close catch..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

onError MediaPlayer mp int what int extra StringBuilder sb new StringBuilder sb.append Media Player Error switch what case.. mp int what int extra StringBuilder sb new StringBuilder sb.append Media Player Error switch what case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK.. MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK sb.append Not Valid for Progressive Playback break case MediaPlayer.MEDIA_ERROR_SERVER_DIED..

JSONException: Value of type java.lang.String cannot be converted to JSONObject

http://stackoverflow.com/questions/10267910/jsonexception-value-of-type-java-lang-string-cannot-be-converted-to-jsonobject

JSONObject jObj null try BufferedReader reader new BufferedReader new InputStreamReader is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine null sb.append line n is.close hier habe ich das JSON File.. is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine null sb.append line n is.close hier habe ich das JSON File als String json sb.toString Log.i JSON Parser json catch Exception e.. line null while line reader.readLine null sb.append line n is.close hier habe ich das JSON File als String json sb.toString Log.i JSON Parser json catch Exception e Log.e Buffer Error Error converting result e.toString try parse the string..

Android Image View Pinch Zooming

http://stackoverflow.com/questions/10630373/android-image-view-pinch-zooming

void dumpEvent MotionEvent event String names DOWN UP MOVE CANCEL OUTSIDE POINTER_DOWN POINTER_UP 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append.. 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append names actionCode if actionCode MotionEvent.ACTION_POINTER_DOWN actionCode MotionEvent.ACTION_POINTER_UP.. .append names actionCode if actionCode MotionEvent.ACTION_POINTER_DOWN actionCode MotionEvent.ACTION_POINTER_UP sb.append pid .append action MotionEvent.ACTION_POINTER_ID_SHIFT sb.append sb.append for int i 0 i event.getPointerCount..

Contact Bubble EditText

http://stackoverflow.com/questions/10812316/contact-bubble-edittext

I set the bubble span like so final Editable e tv.getEditableText final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE.. the bubble span like so final Editable e tv.getEditableText final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE e.append.. Editable e tv.getEditableText final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE e.append sb However instead of the oval..

http post method passing null values to the server

http://stackoverflow.com/questions/13134019/http-post-method-passing-null-values-to-the-server

isr new InputStreamReader connection.getInputStream BufferedReader reader new BufferedReader isr StringBuffer sb new StringBuffer while line reader.readLine null sb.append line response sb.toString response.getEntity .getContent.. BufferedReader reader new BufferedReader isr StringBuffer sb new StringBuffer while line reader.readLine null sb.append line response sb.toString response.getEntity .getContent Log.i Test updated response response catch IOException.. new BufferedReader isr StringBuffer sb new StringBuffer while line reader.readLine null sb.append line response sb.toString response.getEntity .getContent Log.i Test updated response response catch IOException e e.printStackTrace ..

pass arraylist bean from android to webservice php

http://stackoverflow.com/questions/17057712/pass-arraylist-bean-from-android-to-webservice-php

e.printStackTrace try BufferedReader reader new BufferedReader new InputStreamReader is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine null sb.append line n is.close json sb.toString catch.. is iso 8859 1 8 StringBuilder sb new StringBuilder String line null while line reader.readLine null sb.append line n is.close json sb.toString catch Exception e Log.e Buffer Error Error converting result e.toString .. sb new StringBuilder String line null while line reader.readLine null sb.append line n is.close json sb.toString catch Exception e Log.e Buffer Error Error converting result e.toString try parse the string to a JSON object..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

like private String getMmsText String id Uri partURI Uri.parse content mms part id InputStream is null StringBuilder sb new StringBuilder try is getContentResolver .openInputStream partURI if is null InputStreamReader isr new InputStreamReader.. InputStreamReader is UTF 8 BufferedReader reader new BufferedReader isr String temp reader.readLine while temp null sb.append temp temp reader.readLine catch IOException e finally if is null try is.close catch IOException e return sb.toString.. temp temp reader.readLine catch IOException e finally if is null try is.close catch IOException e return sb.toString How to get image from MMS It's the same than getting the text part... the only difference is that you will be looking..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

client.execute request in new BufferedReader new InputStreamReader response.getEntity .getContent StringBuffer sb new StringBuffer String line String NL System.getProperty line.separator while line in.readLine null sb.append line NL.. StringBuffer sb new StringBuffer String line String NL System.getProperty line.separator while line in.readLine null sb.append line NL in.close String page sb.toString System.out.println page tv.setText page catch ClientProtocolException.. line String NL System.getProperty line.separator while line in.readLine null sb.append line NL in.close String page sb.toString System.out.println page tv.setText page catch ClientProtocolException e e.printStackTrace catch IOException..

Simple HTTP client example in Android [closed]

http://stackoverflow.com/questions/4457492/simple-http-client-example-in-android

StringBuilder and returned as String. BufferedReader reader new BufferedReader new InputStreamReader is StringBuilder sb new StringBuilder String line null try while line reader.readLine null sb.append line n catch IOException e e.printStackTrace.. new InputStreamReader is StringBuilder sb new StringBuilder String line null try while line reader.readLine null sb.append line n catch IOException e e.printStackTrace finally try is.close catch IOException e e.printStackTrace return..

AlertDialog from within BroadcastReceiver?? Can it be done?

http://stackoverflow.com/questions/4844031/alertdialog-from-within-broadcastreceiver-can-it-be-done

context Intent intent Log.i LOG_TAG onReceive if intent.getAction .equals SMSPopUpReceiver.ACTION StringBuilder sb new StringBuilder Bundle bundle intent.getExtras if bundle null Object pdus Object bundle.get pdus for Object pdu pdus.. null Object pdus Object bundle.get pdus for Object pdu pdus SmsMessage messages SmsMessage.createFromPdu byte pdu sb.append Received SMS nFrom sb.append messages.getDisplayOriginatingAddress sb.append n Message n sb.append messages.getDisplayMessageBody.. pdus for Object pdu pdus SmsMessage messages SmsMessage.createFromPdu byte pdu sb.append Received SMS nFrom sb.append messages.getDisplayOriginatingAddress sb.append n Message n sb.append messages.getDisplayMessageBody Log.i SMSPopUpReceiver.LOG_TAG..

Geocoder.getFromLocation throws IOException on Android emulator

http://stackoverflow.com/questions/5205650/geocoder-getfromlocation-throws-ioexception-on-android-emulator

1 myList geocoder.getFromLocation location.getLatitude location.getLongitude 10 StringBuilder sb new StringBuilder if myList.size 0 Address address myList.get 0 for int i 0 i address .getMaxAddressLineIndex i .. StringBuilder if myList.size 0 Address address myList.get 0 for int i 0 i address .getMaxAddressLineIndex i sb.append address.getAddressLine i .append n sb.append address.getLocality .append n sb.append address.getPostalCode .append.. myList.get 0 for int i 0 i address .getMaxAddressLineIndex i sb.append address.getAddressLine i .append n sb.append address.getLocality .append n sb.append address.getPostalCode .append n sb.append address.getCountryName catch..

Rotate zoom drag image in android imageview

http://stackoverflow.com/questions/5894736/rotate-zoom-drag-image-in-android-imageview

void dumpEvent MotionEvent event String names DOWN UP MOVE CANCEL OUTSIDE POINTER_DOWN POINTER_UP 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append.. 7 8 9 StringBuilder sb new StringBuilder int action event.getAction int actionCode action MotionEvent.ACTION_MASK sb.append event ACTION_ .append names actionCode if actionCode MotionEvent.ACTION_POINTER_DOWN actionCode MotionEvent.ACTION_POINTER_UP.. .append names actionCode if actionCode MotionEvent.ACTION_POINTER_DOWN actionCode MotionEvent.ACTION_POINTER_UP sb.append pid .append action MotionEvent.ACTION_POINTER_ID_SHIFT sb.append sb.append for int i 0 i event.getPointerCount..

How to Consume WCF Service with Android

http://stackoverflow.com/questions/669764/how-to-consume-wcf-service-with-android

private String getResponse HttpEntity entity String response try int length int entity.getContentLength StringBuffer sb new StringBuffer length InputStreamReader isr new InputStreamReader entity.getContent UTF 8 char buff new char length int.. new InputStreamReader entity.getContent UTF 8 char buff new char length int cnt while cnt isr.read buff 0 length 1 0 sb.append buff 0 cnt response sb.toString isr.close catch IOException ioe ioe.printStackTrace return response But on the server.. UTF 8 char buff new char length int cnt while cnt isr.read buff 0 length 1 0 sb.append buff 0 cnt response sb.toString isr.close catch IOException ioe ioe.printStackTrace return response But on the server side so far I haven't figured..

Android/SQLite IN clause and placeholders

http://stackoverflow.com/questions/7418849/android-sqlite-in-clause-and-placeholders

android.os.NetworkOnMainThreadException . Need to use async task?

http://stackoverflow.com/questions/8612406/android-os-networkonmainthreadexception-need-to-use-async-task

client.execute request in new BufferedReader new InputStreamReader response.getEntity .getContent StringBuffer sb new StringBuffer String line String NL System.getProperty line.separator while line in.readLine null sb.append line.. sb new StringBuffer String line String NL System.getProperty line.separator while line in.readLine null sb.append line NL in.close String result sb.toString return result finally if in null try in.close catch IOException.. String NL System.getProperty line.separator while line in.readLine null sb.append line NL in.close String result sb.toString return result finally if in null try in.close catch IOException e e.printStackTrace Performs an HTTP GET..

Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

http://stackoverflow.com/questions/8681550/android-2-2-mediaplayer-is-working-fine-with-one-shoutcast-url-but-not-with-the

public void onCompletion MediaPlayer mp stop public boolean onError MediaPlayer mp int what int extra StringBuilder sb new StringBuilder sb.append Media Player Error switch what case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK.. MediaPlayer mp stop public boolean onError MediaPlayer mp int what int extra StringBuilder sb new StringBuilder sb.append Media Player Error switch what case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK sb.append Not Valid.. StringBuilder sb.append Media Player Error switch what case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK sb.append Not Valid for Progressive Playback break case MediaPlayer.MEDIA_ERROR_SERVER_DIED sb.append Server Died break case..