android Programming Glossary: log.i
How to make a phone call in android and come back to my activity when the call is done? http://stackoverflow.com/questions/1556987/how-to-make-a-phone-call-in-android-and-come-back-to-my-activity-when-the-call-i if TelephonyManager.CALL_STATE_RINGING state Log.i LOG_TAG RINGING number incomingNumber if TelephonyManager.CALL_STATE_OFFHOOK.. a boolean flag so you know your app initiated the call. Log.i LOG_TAG OFFHOOK if TelephonyManager.CALL_STATE_IDLE state ..
Caching images and displaying http://stackoverflow.com/questions/16789676/caching-images-and-displaying dialog public ProgressTask ListActivity activity Log.i 1 Called context activity dialog new ProgressDialog context..
Android: ListView elements with multiple clickable buttons http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons AdapterView list View view int position long id Log.i TAG onListItemClick position However I don't want the whole..
Android ACTION_IMAGE_CAPTURE Intent http://stackoverflow.com/questions/1910608/android-action-image-capture-intent fi.getAbsolutePath null null if fi.delete Log.i logMarker Failed to delete fi catch FileNotFoundException..
Android SplashScreen http://stackoverflow.com/questions/1979524/android-splashscreen Object protected Object doInBackground String... args Log.i MyApp Background thread starting This is where you would do..
Why doesn't System.out.println work? (in Android) http://stackoverflow.com/questions/2220547/why-doesnt-system-out-println-work-in-android gets redirected to LogCat and printed using Log.i . This may not be true on very old or custom Android versions...
Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” http://stackoverflow.com/questions/2634991/android-1-6-android-view-windowmanagerbadtokenexception-unable-to-add-window switch id case RENAME_DIALOG_ID Log.i Edit Creating rename dialog... dialog new Dialog appContext..
Declaring a custom android UI element using XML http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml attrs R.styleable.MyCustomView Use a Log.i test a.getString R.styleable.MyCustomView_android_text Log.i.. test a.getString R.styleable.MyCustomView_android_text Log.i test a.getColor R.styleable.MyCustomView_android_textColor Color.BLACK.. R.styleable.MyCustomView_android_textColor Color.BLACK Log.i test a.getString R.styleable.MyCustomView_extraInformation Don't..
Android - SMS Broadcast receiver http://stackoverflow.com/questions/4117701/android-sms-broadcast-receiver public void onReceive Context context Intent intent Log.i TAG Intent recieved intent.getAction if intent.getAction SMS_RECEIVED.. byte pdus i if messages.length 1 Log.i TAG Message recieved messages 0 .getMessageBody And the..
Example: Communication between Activity and Service using Messaging http://stackoverflow.com/questions/4300291/example-communication-between-activity-and-service-using-messaging i @Override public void onCreate super.onCreate Log.i MyService Service Started. showNotification timer.scheduleAtFixedRate.. int onStartCommand Intent intent int flags int startId Log.i MyService Received start id startId intent return START_STICKY.. isRunning return isRunning private void onTimerTick Log.i TimerTick Timer doing work. counter try counter incrementby..
How to Consume WCF Service with Android http://stackoverflow.com/questions/669764/how-to-consume-wcf-service-with-android response httpClient.execute method if response null Log.i login received getResponse response.getEntity else Log.i login.. Log.i login received getResponse response.getEntity else Log.i login got a null response catch IOException e Log.e error e.getMessage..
How to make a phone call in android and come back to my activity when the call is done? http://stackoverflow.com/questions/1556987/how-to-make-a-phone-call-in-android-and-come-back-to-my-activity-when-the-call-i @Override public void onCallStateChanged int state String incomingNumber if TelephonyManager.CALL_STATE_RINGING state Log.i LOG_TAG RINGING number incomingNumber if TelephonyManager.CALL_STATE_OFFHOOK state wait for phone to go offhook probably.. state wait for phone to go offhook probably set a boolean flag so you know your app initiated the call. Log.i LOG_TAG OFFHOOK if TelephonyManager.CALL_STATE_IDLE state when this state occurs and your flag is set restart your app..
Caching images and displaying http://stackoverflow.com/questions/16789676/caching-images-and-displaying extends AsyncTask String Void Boolean private ProgressDialog dialog public ProgressTask ListActivity activity Log.i 1 Called context activity dialog new ProgressDialog context progress dialog to show user that the backup is processing...
Android: ListView elements with multiple clickable buttons http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons new OnItemClickListener @Override public void onItemClick AdapterView list View view int position long id Log.i TAG onListItemClick position However I don't want the whole item to be clickable but only the two buttons of each list..
Android ACTION_IMAGE_CAPTURE Intent http://stackoverflow.com/questions/1910608/android-action-image-capture-intent android.provider.MediaStore.Images.Media.insertImage getContentResolver fi.getAbsolutePath null null if fi.delete Log.i logMarker Failed to delete fi catch FileNotFoundException e e.printStackTrace else u intent.getData this saves you..
Android SplashScreen http://stackoverflow.com/questions/1979524/android-splashscreen here private class DownloadTask extends AsyncTask String Void Object protected Object doInBackground String... args Log.i MyApp Background thread starting This is where you would do all the work of downloading your data return replace this with..
Why doesn't System.out.println work? (in Android) http://stackoverflow.com/questions/2220547/why-doesnt-system-out-println-work-in-android question Correction On the emulator and most devices System.out.println gets redirected to LogCat and printed using Log.i . This may not be true on very old or custom Android versions. Original There is no console to send the messages to so the..
Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” http://stackoverflow.com/questions/2634991/android-1-6-android-view-windowmanagerbadtokenexception-unable-to-add-window onCreateDialog int id Dialog dialog Context appContext this.getApplicationContext switch id case RENAME_DIALOG_ID Log.i Edit Creating rename dialog... dialog new Dialog appContext dialog.setContentView R.layout.rename dialog.setTitle Rename..
Declaring a custom android UI element using XML http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml void init AttributeSet attrs TypedArray a getContext .obtainStyledAttributes attrs R.styleable.MyCustomView Use a Log.i test a.getString R.styleable.MyCustomView_android_text Log.i test a.getColor R.styleable.MyCustomView_android_textColor.. attrs R.styleable.MyCustomView Use a Log.i test a.getString R.styleable.MyCustomView_android_text Log.i test a.getColor R.styleable.MyCustomView_android_textColor Color.BLACK Log.i test a.getString R.styleable.MyCustomView_extraInformation.. R.styleable.MyCustomView_android_text Log.i test a.getColor R.styleable.MyCustomView_android_textColor Color.BLACK Log.i test a.getString R.styleable.MyCustomView_extraInformation Don't forget this a.recycle R.styleable.MyCustomView is an autogenerated..
Android - SMS Broadcast receiver http://stackoverflow.com/questions/4117701/android-sms-broadcast-receiver private static final String TAG SMSBroadcastReceiver @Override public void onReceive Context context Intent intent Log.i TAG Intent recieved intent.getAction if intent.getAction SMS_RECEIVED Bundle bundle intent.getExtras if bundle null .. pdus.length for int i 0 i pdus.length i messages i SmsMessage.createFromPdu byte pdus i if messages.length 1 Log.i TAG Message recieved messages 0 .getMessageBody And the manifest file xml version 1.0 encoding utf 8 manifest xmlns..
Example: Communication between Activity and Service using Messaging http://stackoverflow.com/questions/4300291/example-communication-between-activity-and-service-using-messaging to front so this is safe to do inside the loop. mClients.remove i @Override public void onCreate super.onCreate Log.i MyService Service Started. showNotification timer.scheduleAtFixedRate new TimerTask public void run onTimerTick 0 100L isRunning.. R.string.service_started notification @Override public int onStartCommand Intent intent int flags int startId Log.i MyService Received start id startId intent return START_STICKY run until explicitly stopped. public static boolean isRunning.. START_STICKY run until explicitly stopped. public static boolean isRunning return isRunning private void onTimerTick Log.i TimerTick Timer doing work. counter try counter incrementby sendMessageToUI counter catch Throwable t you should always..
How to Consume WCF Service with Android http://stackoverflow.com/questions/669764/how-to-consume-wcf-service-with-android password test HttpGet method new HttpGet new URI url HttpResponse response httpClient.execute method if response null Log.i login received getResponse response.getEntity else Log.i login got a null response catch IOException e Log.e error e.getMessage.. response httpClient.execute method if response null Log.i login received getResponse response.getEntity else Log.i login got a null response catch IOException e Log.e error e.getMessage catch URISyntaxException e Log.e error e.getMessage..
|