android Programming Glossary: each
How do I get the current GPS location programmatically in Android? http://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android for the Internet Weather and Service WeatherPlus demos each of which uses LocationManager . Or you can download the source..
Standard Android Button with a different color http://stackoverflow.com/questions/1521640/standard-android-button-with-a-different-color that I actually create three different drawables for each button I want to customize one for the button at rest one when..
Is it possible to have multiple styles inside a TextView? http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview word2 t word3 Is it possible to have a different style for each text element E.g. line1 bold word1 italic etc. The developer.. vw.getText Create our span sections and assign a format to each. str.setSpan new StyleSpan android.graphics.Typeface.ITALIC..
Android: ListView elements with multiple clickable buttons http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons the whole item to be clickable but only the two buttons of each list element. So my question is how do I implement a onClickListener..
How do I pass data between activities in Android? http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android in through a login page there will be sign out button on each activity. On clicking signout I will be passing the session..
How to discover memory usage of my application in Android http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android were to take all of the physical RAM actually mapped in to each process and add up all of the processes you would probably end.. computes that takes into account memory sharing basically each page of RAM in a process is scaled by a ratio of the number.. spit out a bunch of information about the memory use of each Java process containing the above info as well as a variety..
creating a system overlay (always on top) button in android http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android wm.addView mView params Now you will start getting each and every click event. So you need to rectify in your event..
Strange out of memory issue while loading an image to a Bitmap object http://stackoverflow.com/questions/477572/strange-out-of-memory-issue-while-loading-an-image-to-a-bitmap-object I have a list view with a couple of image buttons on each row. When you click the list row it launches a new activity... some changes to the properties of the widgets elements in each row as I am unable to select a row with touch screen because..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables your state with the Application context. As you know each Activity is also a Context which is information about its execution..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context context points to an Activity that is being destroyed each time the user tilts the phone or leave the app etc.. Which apparently..
Android accelerometer accuracy (Inertial navigation) http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation value to calibrate the phone subtracting this value from each subsequent reading . I then tested the system by again placing.. that these accelerations should add up to 0 roughly in each direction. However this is not the case and the total acceleration.. 5000 iterations is nowhere near 0 averaging around 10 on each axis . I realise without seeing my code this might be difficult..
Android - basic gesture detection http://stackoverflow.com/questions/937313/android-basic-gesture-detection click situation I need only set the onClickListener for each ImageView I add to be the main activity which implements View.OnClickListener.. to all the views you add to the main layout Do this for each view added to the grid imageView.setOnClickListener SelectFilterActivity.this..
Send message from a basic server to a specific client http://stackoverflow.com/questions/10777678/send-message-from-a-basic-server-to-a-specific-client times in a loop to accept all incoming connections. Each Socket object returned will be for a different client. In order..
Search in ListView with EditText http://stackoverflow.com/questions/10816243/search-in-listview-with-edittext in ListView with EditText I have a ListView . Each row of it contains 3 TextView 's and 2 Button 's. Above it I..
Push Notifications in Android Platform http://stackoverflow.com/questions/1378671/push-notifications-in-android-platform a pull from the server Poll the server periodically Each has its own limitations. SMS no guarantee on arrival time. Poll..
Duplicate ID, tag null, or parent id with another fragment for com.google.android.gms.maps.MapFragment http://stackoverflow.com/questions/14083950/duplicate-id-tag-null-or-parent-id-with-another-fragment-for-com-google-androi I have an application with three tabs. Each tab has its own layout .xml file. The main.xml has its own map..
Out of Memory error with Bitmap http://stackoverflow.com/questions/16765899/out-of-memory-error-with-bitmap therefore can easily result in an OutOfMemory exception. Each type of decode method has additional signatures that let you..
AES algo - Decryption Issue http://stackoverflow.com/questions/17079579/aes-algo-decryption-issue e TODO Auto generated catch block e.printStackTrace Each time i am getting exception 06 13 05 03 43.013 W System.err..
LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included http://stackoverflow.com/questions/18068627/logcat-message-the-google-play-services-resources-were-not-found-check-your-pr try to address whatever the problem might be Further info Each time the Google Play services resources were not found message..
Android static object lifecycle (Application act crazy) http://stackoverflow.com/questions/1944369/android-static-object-lifecycle-application-act-crazy process table.A process start an instance of DVM Dalvik VM Each application runs inside a DVM. A DVM manages class loading unloading..
java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android by the VM and then at some point the user enters again. Each time the user enters to the app I can see the memory growing..
ListSelector applies to the entire list http://stackoverflow.com/questions/2183447/listselector-applies-to-the-entire-list inside listSelector. I created two 3x3 pixel .png files. Each saved with the gamma layer. In my case it's two of the same..
How to find serial number of Android device? http://stackoverflow.com/questions/2322234/how-to-find-serial-number-of-android-device depending on which radio the phone uses GSM or CDMA . Each device MUST return a unique value here assuming it's a phone..
How to pick an image from gallery (SD Card) for my app in Android? http://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app-in-android ContentResolver database but that on its own isn't enough. Each image has about 18 columns of information ranging from its filepath..
Effective Android Programming Techniques [closed] http://stackoverflow.com/questions/2961049/effective-android-programming-techniques tools directory such as hierarchyviewer and layoutopt. Each is helpful and there is no shortcut to learning about each tool..
How can I parse this JSON in Android? http://stackoverflow.com/questions/3605077/how-can-i-parse-this-json-in-android object.getJSONArray results for int i 0 i users.length i Each element in the results array is a JSONObject with a single property..
Help regarding onClick() event on an item of ListView custom row layout http://stackoverflow.com/questions/4181994/help-regarding-onclick-event-on-an-item-of-listview-custom-row-layout layout I have a ListView whose rows are formatted by me. Each row has a mix of ImageView and TextView. I have also implemented..
How to change color of ListView items on focus and on click http://stackoverflow.com/questions/4247385/how-to-change-color-of-listview-items-on-focus-and-on-click vertical android drawSelectorOnTop true ListView Each item of my list View is composed of two TextView xml version..
Simple HTTP client example in Android [closed] http://stackoverflow.com/questions/4457492/simple-http-client-example-in-android return null which means there's no more data to read. Each line will appended to a StringBuilder and returned as String...
Separate Back Stack for each tab in Android using Fragments http://stackoverflow.com/questions/6987334/separate-back-stack-for-each-tab-in-android-using-fragments browser in the various ways you can go in and out of it. Each window in the browser is essentially a tab. share improve this..
Save ArrayList to SharedPreferences http://stackoverflow.com/questions/7057845/save-arraylist-to-sharedpreferences I have an ArrayList with custom objects. Each custom object contains a variety of strings and numbers. I need..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context still not getting it quite right As I understand it so far Each is an instance of its class which means that some programmers..
How do I get the current GPS location programmatically in Android? http://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android You can download the source code for one of my books look for the Internet Weather and Service WeatherPlus demos each of which uses LocationManager . Or you can download the source for another of my books look for the 23 Location tutorial..
Standard Android Button with a different color http://stackoverflow.com/questions/1521640/standard-android-button-with-a-different-color @drawable red_button_rest selector But doing that requires that I actually create three different drawables for each button I want to customize one for the button at rest one when focused and one when pressed . That seems more complicated..
Is it possible to have multiple styles inside a TextView? http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview the text as follows tv.setText line1 n line2 n word1 t word2 t word3 Is it possible to have a different style for each text element E.g. line1 bold word1 italic etc. The developer guide's Common Tasks and How to Do Them in Android includes.. XML. Get the EditText's internal text storage Spannable str vw.getText Create our span sections and assign a format to each. str.setSpan new StyleSpan android.graphics.Typeface.ITALIC 0 7 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE str.setSpan new BackgroundColorSpan..
Android: ListView elements with multiple clickable buttons http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons 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 element. So my question is how do I implement a onClickListener for these two buttons with the following parameters..
How do I pass data between activities in Android? http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android activities in Android I have a scenario where after logging in through a login page there will be sign out button on each activity. On clicking signout I will be passing the session id of the signed in user to signout. Can anyone guide me on..
How to discover memory usage of my application in Android http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android don't use on Android and it is even less clear. Thus if you were to take all of the physical RAM actually mapped in to each process and add up all of the processes you would probably end up with a number much greater than the actual total RAM... the actual total RAM. The Pss number is a metric the kernel computes that takes into account memory sharing basically each page of RAM in a process is scaled by a ratio of the number of other processes also using that page. This way you can in.. common one is the command adb shell dumpsys meminfo which will spit out a bunch of information about the memory use of each Java process containing the above info as well as a variety of other things. You can also tack on the name or pid of a single..
creating a system overlay (always on top) button in android http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android WindowManager wm WindowManager getSystemService WINDOW_SERVICE wm.addView mView params Now you will start getting each and every click event. So you need to rectify in your event handler. In your ViewGroup touch event @Override public boolean..
Strange out of memory issue while loading an image to a Bitmap object http://stackoverflow.com/questions/477572/strange-out-of-memory-issue-while-loading-an-image-to-a-bitmap-object out of memory issue while loading an image to a Bitmap object I have a list view with a couple of image buttons on each row. When you click the list row it launches a new activity. I have had to build my own tabs because of an issue with the.. fly bit wise This would be preferable as I also need to make some changes to the properties of the widgets elements in each row as I am unable to select a row with touch screen because of focus issue. I can use roller ball. I know I can do an out..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables found however that a more elegant way in Android is to associate your state with the Application context. As you know each Activity is also a Context which is information about its execution environment in the broadest sense. Your application..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context This is because the other this getting the Activity instance context points to an Activity that is being destroyed each time the user tilts the phone or leave the app etc.. Which apparently the Garbage Collector GC doesn't catch and therefor..
Android accelerometer accuracy (Inertial navigation) http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation directions . I then averaged these readings and used this value to calibrate the phone subtracting this value from each subsequent reading . I then tested the system by again placing it on the table and sampling 5000 accelerometer readings.. in the X and Y directions. I would expect given the calibration that these accelerations should add up to 0 roughly in each direction. However this is not the case and the total acceleration over 5000 iterations is nowhere near 0 averaging around.. However this is not the case and the total acceleration over 5000 iterations is nowhere near 0 averaging around 10 on each axis . I realise without seeing my code this might be difficult to answer but in a more general sense... Is this simply..
Android - basic gesture detection http://stackoverflow.com/questions/937313/android-basic-gesture-detection application and has only been slightly adapted. For the simple click situation I need only set the onClickListener for each ImageView I add to be the main activity which implements View.OnClickListener . It seems infinitely more complicated to.. e nothing return false Attach your gesture listener to all the views you add to the main layout Do this for each view added to the grid imageView.setOnClickListener SelectFilterActivity.this imageView.setOnTouchListener gestureListener..
Send message from a basic server to a specific client http://stackoverflow.com/questions/10777678/send-message-from-a-basic-server-to-a-specific-client server and one client. You can call ServerSocket.accept multiple times in a loop to accept all incoming connections. Each Socket object returned will be for a different client. In order to have the server send a message to a specific client it..
Search in ListView with EditText http://stackoverflow.com/questions/10816243/search-in-listview-with-edittext in ListView with EditText I have a ListView . Each row of it contains 3 TextView 's and 2 Button 's. Above it I have an EditText . How can I filter my ListView by the value..
Push Notifications in Android Platform http://stackoverflow.com/questions/1378671/push-notifications-in-android-platform of methods to do this. SMS Intercept the incoming SMS and initiate a pull from the server Poll the server periodically Each has its own limitations. SMS no guarantee on arrival time. Poll may drain the battery. Do you have a better suggestion please..
Duplicate ID, tag null, or parent id with another fragment for com.google.android.gms.maps.MapFragment http://stackoverflow.com/questions/14083950/duplicate-id-tag-null-or-parent-id-with-another-fragment-for-com-google-androi or parent id with another fragment for com.google.android.gms.maps.MapFragment I have an application with three tabs. Each tab has its own layout .xml file. The main.xml has its own map fragment. It's the one that shows up when the application..
Out of Memory error with Bitmap http://stackoverflow.com/questions/16765899/out-of-memory-error-with-bitmap attempt to allocate memory for the constructed bitmap and therefore can easily result in an OutOfMemory exception. Each type of decode method has additional signatures that let you specify decoding options via the BitmapFactory.Options class...
AES algo - Decryption Issue http://stackoverflow.com/questions/17079579/aes-algo-decryption-issue K1mDabx164 6cfoKk8 6b5WlNfBQVobZpQs2 Log.e s s catch Exception e TODO Auto generated catch block e.printStackTrace Each time i am getting exception 06 13 05 03 43.013 W System.err 1757 java.lang.NumberFormatException unable to parse 'LV' as..
LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included http://stackoverflow.com/questions/18068627/logcat-message-the-google-play-services-resources-were-not-found-check-your-pr as my app does work fine. But what can I do or check to try to address whatever the problem might be Further info Each time the Google Play services resources were not found message appears in LogCat it is preceded by these messages which..
Android static object lifecycle (Application act crazy) http://stackoverflow.com/questions/1944369/android-static-object-lifecycle-application-act-crazy process and assigns it a unique process id and allocates a process table.A process start an instance of DVM Dalvik VM Each application runs inside a DVM. A DVM manages class loading unloading instance lifecycle GC etc. Lifetime of a static variable..
java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android quits the onDestroy method is executed and app stays in memory by the VM and then at some point the user enters again. Each time the user enters to the app I can see the memory growing more and more until user gets the java.lang.OutOfMemoryError..
ListSelector applies to the entire list http://stackoverflow.com/questions/2183447/listselector-applies-to-the-entire-list stay away from any @color or @drawable that refers to a color inside listSelector. I created two 3x3 pixel .png files. Each saved with the gamma layer. In my case it's two of the same color each mixed down in Gimp with a different transparency..
How to find serial number of Android device? http://stackoverflow.com/questions/2322234/how-to-find-serial-number-of-android-device class. getDeviceID will return the MDN or MEID of the device depending on which radio the phone uses GSM or CDMA . Each device MUST return a unique value here assuming it's a phone . This should work for any Android device with a sim slot or..
How to pick an image from gallery (SD Card) for my app in Android? http://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app-in-android This code works by getting the location of the image in the ContentResolver database but that on its own isn't enough. Each image has about 18 columns of information ranging from its filepath to 'date last modified' to the GPS coordinates of where..
Effective Android Programming Techniques [closed] http://stackoverflow.com/questions/2961049/effective-android-programming-techniques the tools directory There a lot helpful tools in the sdk's tools directory such as hierarchyviewer and layoutopt. Each is helpful and there is no shortcut to learning about each tool one at a time. I could add more if enough people chime in...
How can I parse this JSON in Android? http://stackoverflow.com/questions/3605077/how-can-i-parse-this-json-in-android new JSONObject json Get the results array JSONArray users object.getJSONArray results for int i 0 i users.length i Each element in the results array is a JSONObject with a single property user which is a JSONObject that contains the user data..
Help regarding onClick() event on an item of ListView custom row layout http://stackoverflow.com/questions/4181994/help-regarding-onclick-event-on-an-item-of-listview-custom-row-layout regarding onClick event on an item of ListView custom row layout I have a ListView whose rows are formatted by me. Each row has a mix of ImageView and TextView. I have also implemented my own adapter and am able to draw each row through it...
How to change color of ListView items on focus and on click http://stackoverflow.com/questions/4247385/how-to-change-color-of-listview-items-on-focus-and-on-click fill_parent android textFilterEnabled true android scrollbars vertical android drawSelectorOnTop true ListView Each item of my list View is composed of two TextView xml version 1.0 encoding utf 8 TableLayout android layout_width fill_parent..
Simple HTTP client example in Android [closed] http://stackoverflow.com/questions/4457492/simple-http-client-example-in-android method. We iterate until the BufferedReader return null which means there's no more data to read. Each line will appended to a StringBuilder and returned as String. BufferedReader reader new BufferedReader new InputStreamReader..
Separate Back Stack for each tab in Android using Fragments http://stackoverflow.com/questions/6987334/separate-back-stack-for-each-tab-in-android-using-fragments
Save ArrayList to SharedPreferences http://stackoverflow.com/questions/7057845/save-arraylist-to-sharedpreferences ArrayList to SharedPreferences I have an ArrayList with custom objects. Each custom object contains a variety of strings and numbers. I need the array to stick around even if the user leaves the activity..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context lot of posting about what these two contexts are.. But I'm still not getting it quite right As I understand it so far Each is an instance of its class which means that some programmers recommend you to use this.getApplicationContext as often as..
|