android Programming Glossary: rather
Android - what's the difference between the various methods to get a Context? http://stackoverflow.com/questions/1026973/android-whats-the-difference-between-the-various-methods-to-get-a-context the application Context Activity.getApplicationContext rather than using the Activity context this . Basically the Application..
How to check internet access on Android? InetAddress never timeouts http://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-timeouts in time then it might be better to use netInfo.isConnected rather than netInfo.isConnectedOrConnecting . I guess this is up to..
Libraries do not get added to APK anymore after upgrade to ADT 22 http://stackoverflow.com/questions/16596969/libraries-do-not-get-added-to-apk-anymore-after-upgrade-to-adt-22 get added to APK anymore after upgrade to ADT 22 I have a rather big Android App project that is referencing several library..
java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk [duplicate] http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra to ADT 22 7 answers Some time ago I developed a rather simple app with a target of 4.2.2. I had it working normally..
Android: Override back button to act like home button http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button I'd like my application to go into the stopped state rather than the destroyed state. In the Android docs it states ...not.. about putting the Activity into the stopped state rather than the destroyed state on pressing the back button. android..
Quitting an application - is that frowned upon? http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon of this writing. I have no intention of changing your mind rather these are here for others who come to read this post in the.. Usually it is because they hold onto logon credentials rather than forcing users to log in every time manually. For example.. an app. Most Web apps don't force the user to log out but rather implicitly log the user out after a period of inactivity. Same..
How can I open a URL in Android's web browser from my application? http://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application How to open an URL from code in the built in web browser rather than within my application I tried this try Intent myIntent..
Display PDF within app on Android? http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android tricky to use. It's not a standard Java jar library but rather it's JNI library C language for Android and you need to compile..
Focusable EditText inside ListView http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview What I'm envisioning is basically a hybrid of 1 2 where rather than the list setting if all items are focusable or not I want..
Sending and Parsing JSON in Android http://stackoverflow.com/questions/2818697/sending-and-parsing-json-in-android have not been mentioned but instead of using bare bones rather manual process with json.org's little package GSon and Jackson..
How to call SOAP web service in Android http://stackoverflow.com/questions/297586/how-to-call-soap-web-service-in-android library to Android. My suspicion for this is that they'd rather support the current trends in Web Services toward REST based..
What is the simplest and most robust way to get the user's current location in Android? http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a that seems to only give you the best theoretical provider rather than the provider that's actually going to give you the best..
WebView and HTML5 <video> http://stackoverflow.com/questions/3815090/webview-and-html5-video elements... nor does shouldOverrideUrlLoading.. I would rather not get into pull xml from the server reformat it in the app..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables I have with those who encourage the use of Singletons rather than subclassing Application. Read it at your own risk. ORIGINAL..
Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro supports streaming media 1 . I would recommend doing that rather than using this double buffering technique to get around the..
Samsung Galaxy S II AVD (Android Virtual Device) Basic Settings? http://stackoverflow.com/questions/10641744/samsung-galaxy-s-ii-avd-android-virtual-device-basic-settings has changed. So there are changes needed to the process. Rather than a single file there's now both a device definition and..
Determine if running on a rooted device http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device that will only work on a device where root is available. Rather than having this feature fail when it is used and then show..
android GCM doesn't work http://stackoverflow.com/questions/11409119/android-gcm-doesnt-work mean that the message was already delivered to the device. Rather it means that it was accepted for delivery. What happens to..
Validation on Edit Text http://stackoverflow.com/questions/1151664/validation-on-edit-text validation edittext share improve this question Rather than make a pop up I would integrate a hint into the EditText..
Implications of Android multiple user support (new in 4.2) for server side data model (e.g. android_id) http://stackoverflow.com/questions/13408349/implications-of-android-multiple-user-support-new-in-4-2-for-server-side-data represented sequential OS installations on that device. Rather perversely it will be safer to be wrong. share improve this..
NoClassDefFoundError when using proguard http://stackoverflow.com/questions/13624503/noclassdeffounderror-when-using-proguard viewpagerindicator share improve this question Rather than being as specific with the package names keep public class..
User is not eligible for this purchase - in app billing http://stackoverflow.com/questions/13747736/user-is-not-eligible-for-this-purchase-in-app-billing app store. So you can not expect the changes immediately. Rather you should wait in my case it took average 2 3 hours. Still..
Android - configure Spinner to use array http://stackoverflow.com/questions/1587028/android-configure-spinner-to-use-array android arrays spinner share improve this question Rather than the dual array method why not fill your ArrayAdapter programmatically..
How to check visibility of software keyboard in Android? http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android APIs which have been lurking in the SDK since version 1. Rather than requiring a custom Layout type a much simpler solution..
EditText items in a scrolling list lose their changes when scrolled off the screen http://stackoverflow.com/questions/3036296/edittext-items-in-a-scrolling-list-lose-their-changes-when-scrolled-off-the-scre EditText widgets created if you scroll through the list. Rather there will be 10 or so depending on how many rows are simultaneously..
How can I refresh MediaStore on Android? http://stackoverflow.com/questions/3300137/how-can-i-refresh-mediastore-on-android share improve this question Ok I've done it. Rather than rescan the card the app iterates through all the playlists..
Should I learn Java before learning Android [closed] http://stackoverflow.com/questions/3496191/should-i-learn-java-before-learning-android good way to test your understand is via unit tests. Rather than a normal test first approach write a method and predict..
startActivity() from BroadcastReceiver http://stackoverflow.com/questions/3849868/startactivity-from-broadcastreceiver is fine. However do not register it from an activity. Rather register it in the manifest receiver android name .OnPowerReceiver..
Prevent Activity Stack from being Restored? http://stackoverflow.com/questions/5423571/prevent-activity-stack-from-being-restored all my activities resume and run into null pointers. Rather than modify every activity to accommodate this event I would..
Why does TextView in single line elipsized with “end” show boxes? http://stackoverflow.com/questions/6492074/why-does-textview-in-single-line-elipsized-with-end-show-boxes text. The ellipsis that Android uses is not three periods. Rather it uses an actual ellipsis character where the three dots are..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context for a Button in an Activity and need a Context . Rather than using MyActivity.this to get at the outer class' this they..
Android project using httpclient --> http.client (apache), post/get method http://stackoverflow.com/questions/874227/android-project-using-httpclient-http-client-apache-post-get-method you do not want to create the client over and over again. Rather as the tutorials for HttpClient note create the client once..
Android - How to filter specific apps for ACTION_SEND intent http://stackoverflow.com/questions/9730243/android-how-to-filter-specific-apps-for-action-send-intent between the PackageManager and the ACTION_SEND intent. OR Rather than filter the sharing apps my problem could also be solved..
Android - what's the difference between the various methods to get a Context? http://stackoverflow.com/questions/1026973/android-whats-the-difference-between-the-various-methods-to-get-a-context between the two and when you might want to consider using the application Context Activity.getApplicationContext rather than using the Activity context this . Basically the Application context is associated with the Application and will always..
How to check internet access on Android? InetAddress never timeouts http://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-timeouts you absolutely need a network connection at the given point in time then it might be better to use netInfo.isConnected rather than netInfo.isConnectedOrConnecting . I guess this is up to the indivudal use case however. share improve this answer..
Libraries do not get added to APK anymore after upgrade to ADT 22 http://stackoverflow.com/questions/16596969/libraries-do-not-get-added-to-apk-anymore-after-upgrade-to-adt-22 do not get added to APK anymore after upgrade to ADT 22 I have a rather big Android App project that is referencing several library projects. Everything was fine until i upgraded the eclipse ADT..
java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk [duplicate] http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra here Libraries do not get added to APK anymore after upgrade to ADT 22 7 answers Some time ago I developed a rather simple app with a target of 4.2.2. I had it working normally in my device. Then I stopped development for about 1 month...
Android: Override back button to act like home button http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button back button to act like home button On pressing the back button I'd like my application to go into the stopped state rather than the destroyed state. In the Android docs it states ...not all activities have the behavior that they are destroyed.. to which this problem is related. This question is specifically about putting the Activity into the stopped state rather than the destroyed state on pressing the back button. android button override back share improve this question Most..
Quitting an application - is that frowned upon? http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon comments to the various answers already given at the time of this writing. I have no intention of changing your mind rather these are here for others who come to read this post in the future. The point is that I cannot allow for Android to determine.. are many iPhone and Android applications that deal with this. Usually it is because they hold onto logon credentials rather than forcing users to log in every time manually. For example we want to check updates when exiting the application That.. movement to try to eliminate the notion of terminating an app. Most Web apps don't force the user to log out but rather implicitly log the user out after a period of inactivity. Same thing with Android and to a lesser extent iPhone and possibly..
How can I open a URL in Android's web browser from my application? http://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application I open a URL in Android's web browser from my application How to open an URL from code in the built in web browser rather than within my application I tried this try Intent myIntent new Intent Intent.ACTION_VIEW Uri.parse download_link startActivity..
Display PDF within app on Android? http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android my app and finally found it. The library however it's a bit tricky to use. It's not a standard Java jar library but rather it's JNI library C language for Android and you need to compile it yourself if you decide to use it within your application...
Focusable EditText inside ListView http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview returns true but in fact does not give the EditText focus. What I'm envisioning is basically a hybrid of 1 2 where rather than the list setting if all items are focusable or not I want to set focusability for a single item in the list so that..
Sending and Parsing JSON in Android http://stackoverflow.com/questions/2818697/sending-and-parsing-json-in-android parsing share improve this question I am surprised these have not been mentioned but instead of using bare bones rather manual process with json.org's little package GSon and Jackson are much more convenient to use. So GSON Jackson So you can..
How to call SOAP web service in Android http://stackoverflow.com/questions/297586/how-to-call-soap-web-service-in-android to. Google has shown to date little interest in adding a SOAP library to Android. My suspicion for this is that they'd rather support the current trends in Web Services toward REST based services and using JSON as a data encapsulation format. Or..
What is the simplest and most robust way to get the user's current location in Android? http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a the solution down to just using one location provider but that seems to only give you the best theoretical provider rather than the provider that's actually going to give you the best results. Is there a simpler way to accomplish this android..
WebView and HTML5 <video> http://stackoverflow.com/questions/3815090/webview-and-html5-video onShowCustomView but that seems to not get called on video elements... nor does shouldOverrideUrlLoading.. I would rather not get into pull xml from the server reformat it in the app .. by keeping the story layout on the server I can control..
Android: How to declare global variables? http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables some criticism and detailing a large philosophical disagreement I have with those who encourage the use of Singletons rather than subclassing Application. Read it at your own risk. ORIGINAL ANSWER The more general problem you are encountering is..
Android MediaPlayer works fine in Custom audio Streaming application up to Android 2.1 but not in higher versions http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro releases of Android OS have included a MediaPlayer that supports streaming media 1 . I would recommend doing that rather than using this double buffering technique to get around the problem. Android OS 2.2 replaced the old media player code..
Samsung Galaxy S II AVD (Android Virtual Device) Basic Settings? http://stackoverflow.com/questions/10641744/samsung-galaxy-s-ii-avd-android-virtual-device-basic-settings improve this question The interface to the AVD manager has changed. So there are changes needed to the process. Rather than a single file there's now both a device definition and a virtual device definition. Unfortunately the UI doesn't give..
Determine if running on a rooted device http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device a rooted device My app has a certain piece of functionality that will only work on a device where root is available. Rather than having this feature fail when it is used and then show an appropriate error message to the user I'd prefer an ability..
android GCM doesn't work http://stackoverflow.com/questions/11409119/android-gcm-doesnt-work a message to GCM and receives a message ID back it does not mean that the message was already delivered to the device. Rather it means that it was accepted for delivery. What happens to the message after it is accepted depends on many factors. In..
Validation on Edit Text http://stackoverflow.com/questions/1151664/validation-on-edit-text type If possible please include a code snippet. android validation edittext share improve this question Rather than make a pop up I would integrate a hint into the EditText and I would make it so the user could only type numbers into..
Implications of Android multiple user support (new in 4.2) for server side data model (e.g. android_id) http://stackoverflow.com/questions/13408349/implications-of-android-multiple-user-support-new-in-4-2-for-server-side-data
NoClassDefFoundError when using proguard http://stackoverflow.com/questions/13624503/noclassdeffounderror-when-using-proguard me know thank you in advance. android actionbarsherlock proguard viewpagerindicator share improve this question Rather than being as specific with the package names keep public class extends android.support.v4.app.FragmentActivity keep public..
User is not eligible for this purchase - in app billing http://stackoverflow.com/questions/13747736/user-is-not-eligible-for-this-purchase-in-app-billing that Google play takes time to update the changes in app store. So you can not expect the changes immediately. Rather you should wait in my case it took average 2 3 hours. Still there may be some unknown error which I could not figure. My..
Android - configure Spinner to use array http://stackoverflow.com/questions/1587028/android-configure-spinner-to-use-array only or do I need to create adapter and do it programmatically android arrays spinner share improve this question Rather than the dual array method why not fill your ArrayAdapter programmatically with objects of a known type and use that. I've..
How to check visibility of software keyboard in Android? http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android clued me in to the existence of ViewTreeObserver and friends APIs which have been lurking in the SDK since version 1. Rather than requiring a custom Layout type a much simpler solution is to give your activity's root view a known ID say '@ id activityRoot'..
EditText items in a scrolling list lose their changes when scrolled off the screen http://stackoverflow.com/questions/3036296/edittext-items-in-a-scrolling-list-lose-their-changes-when-scrolled-off-the-scre may have 1 000 records but there are not going to be 1 000 EditText widgets created if you scroll through the list. Rather there will be 10 or so depending on how many rows are simultaneously visible. Rows get recycled and the binding operation..
How can I refresh MediaStore on Android? http://stackoverflow.com/questions/3300137/how-can-i-refresh-mediastore-on-android file Environment.getExternalStorageDirectory android mediastore share improve this question Ok I've done it. Rather than rescan the card the app iterates through all the playlists in mediastore and checks the length of the _data field...
Should I learn Java before learning Android [closed] http://stackoverflow.com/questions/3496191/should-i-learn-java-before-learning-android worry about threading permissions graphics resources etc. Another good way to test your understand is via unit tests. Rather than a normal test first approach write a method and predict its output with unit tests until you run out of interesting..
startActivity() from BroadcastReceiver http://stackoverflow.com/questions/3849868/startactivity-from-broadcastreceiver broadcast is sent your approach of using a BroadcastReceiver is fine. However do not register it from an activity. Rather register it in the manifest receiver android name .OnPowerReceiver intent filter action android name android.intent.action.POWER_CONNECTED..
Prevent Activity Stack from being Restored? http://stackoverflow.com/questions/5423571/prevent-activity-stack-from-being-restored activity stack is saved. Then when the application is restarted all my activities resume and run into null pointers. Rather than modify every activity to accommodate this event I would rather just have my application start with the base activity..
Why does TextView in single line elipsized with “end” show boxes? http://stackoverflow.com/questions/6492074/why-does-textview-in-single-line-elipsized-with-end-show-boxes example. This works fairly well at least for single line text. The ellipsis that Android uses is not three periods. Rather it uses an actual ellipsis character where the three dots are contained in a single glyph. Hence any font that you use that..
When to call activity context OR application context? http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context is limited. They implement an inner class e.g. an OnClickListener for a Button in an Activity and need a Context . Rather than using MyActivity.this to get at the outer class' this they use getApplicationContext or getBaseContext to get a Context..
Android project using httpclient --> http.client (apache), post/get method http://stackoverflow.com/questions/874227/android-project-using-httpclient-http-client-apache-post-get-method up at the 3.x stuff . Also if you do any number of requests you do not want to create the client over and over again. Rather as the tutorials for HttpClient note create the client once and keep it around. From there use the ThreadSafeConnectionManager..
Android - How to filter specific apps for ACTION_SEND intent http://stackoverflow.com/questions/9730243/android-how-to-filter-specific-apps-for-action-send-intent but haven't been able to figure out the connection between the PackageManager and the ACTION_SEND intent. OR Rather than filter the sharing apps my problem could also be solved if I could use the ACTION_SEND intent to go directly to facebook..
|