android Programming Glossary: shouldn't
Do fragments really need an empty constructor? http://stackoverflow.com/questions/10450348/do-fragments-really-need-an-empty-constructor fragments share improve this question Yes they do. You shouldn't really be overriding the constructor anyway. You should have..
Rotating a bitmap using JNI & NDK http://stackoverflow.com/questions/14398670/rotating-a-bitmap-using-jni-ndk . br notes br the input bitmap will be recycled and shouldn't be used anymore br returns the rotated bitmap . br could take..
Inner class can access but not update values - AsyncTask http://stackoverflow.com/questions/18517400/inner-class-can-access-but-not-update-values-asynctask new thread will be lost once that thread returns No they shouldn't be lost . They probably just haven't been changed in the AsyncTask..
Calling hidden API in android to turn screen off http://stackoverflow.com/questions/1875669/calling-hidden-api-in-android-to-turn-screen-off does what I want but its a hidden API. Does that mean I shouldn't use it I would think its a fairly stable api. Currently I'm..
Overriding the Home button - how do I get rid of the choice? http://stackoverflow.com/questions/2079691/overriding-the-home-button-how-do-i-get-rid-of-the-choice easy for a user to get back to somewhere they know. You shouldn't really be overriding this unless you're producing a full Home..
Permission to write to the SD card http://stackoverflow.com/questions/2121833/permission-to-write-to-the-sd-card You're right that the SD Card directory is sdcard but you shouldn't be hard coding it. Instead make a call to Environment.getExternalStorageDirectory..
How to layout text to flow around an image http://stackoverflow.com/questions/2248759/how-to-layout-text-to-flow-around-an-image You could write your own version of TextView to do this it shouldn't be hard. android share improve this question Now it is..
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog doInBackground runs always on a background thread. You shouldn't do any UI tasks there. On the other hand the onProgressUpdate..
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 a GPS or a Network Location provider. It seems like it shouldn't be that hard but it appears to me that I have to spin up two..
Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName) http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername certificates chain and build a new one. Theoretically we shouldn't have to do this but various web servers in practice are mis..
Android: Want to set custom fonts for whole application not runtime http://stackoverflow.com/questions/4395309/android-want-to-set-custom-fonts-for-whole-application-not-runtime R.styleable.CustomButton The value 0 is a default but shouldn't ever be used since the attr is an enum int typeface values.getInt..
getApplication() vs. getApplicationContext() http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext more thing the documentation says that it most cases you shouldn't need to subclass Application There is normally no need to subclass..
Android take screenshot via code http://stackoverflow.com/questions/5939987/android-take-screenshot-via-code take screenshot via code This shouldn't be too tough of a question. I want the ability to take a screenshot..
Good way of getting the user's location in Android http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android google hasn't a normalized API for location the developer shouldn't have to care where the location is from you should just specify..
Android onConfigurationChanged not being called http://stackoverflow.com/questions/6457659/android-onconfigurationchanged-not-being-called using android screenOrientation in your manifest. Also it shouldn't make a difference but you can try using android configChanges..
Getting an issue while checking the dynamically generated checkbox through list view http://stackoverflow.com/questions/7738527/getting-an-issue-while-checking-the-dynamically-generated-checkbox-through-list instead probably 10 which could be reused easily . That shouldn't matter that much if you have only 20 items or so but if you..
ViewPager and fragments ??what's the right way to store fragment's state? http://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state getFragment. But I still have a string feeling that things shouldn't work like thant... See code below @Override protected void onSaveInstanceState..
Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or is saved in the android default folder even though it shouldn't be .. Now what I do is i record the time when I'm starting the..
support FragmentPagerAdapter holds reference to old fragments http://stackoverflow.com/questions/9727173/support-fragmentpageradapter-holds-reference-to-old-fragments navigates to the last known page. This seems strange shouldn't the app just load to the default fragment android android fragments..
android app with service only http://stackoverflow.com/questions/990217/android-app-with-service-only in your service onCreate to tell Android that your service shouldn't be stopped this was added mainly for mp3 player type services..
Android out of memory when assigning variables http://stackoverflow.com/questions/14116757/android-out-of-memory-when-assigning-variables spins my head is that it works on the S2 but not the S3. Shouldn't the S3 exceed the S2 in every way I am using a global BitmapFactory.Options..
Google Places API request denied for Android autocomplete, even with the right api key http://stackoverflow.com/questions/14654758/google-places-api-request-denied-for-android-autocomplete-even-with-the-right-a is that I have O2Auth activated does that change anything Shouldn't it be as simple as putting the API key in the app Thanks android..
progress bar remains empty using asynctask - EDIT - dialog never stops loading http://stackoverflow.com/questions/16582484/progress-bar-remains-empty-using-asynctask-edit-dialog-never-stops-loading message I have in onPostExecute.Is this normal behavior Shouldn't the icon be flashing until finds the signal and then show me..
How to clear stack back to root activity when user leaves application? http://stackoverflow.com/questions/2131123/how-to-clear-stack-back-to-root-activity-when-user-leaves-application Back MainAct Why is it bringing me back to MainAct Shouldn't that activity haven been closed since LogonAct has android clearTaskOnLaunch..
Accessing android:installLocation manifest attribute http://stackoverflow.com/questions/3065219/accessing-androidinstalllocation-manifest-attribute break case preferExternal Do stuff break default Shouldn't happen Do stuff break break attrloop break eventType..
getApplication() vs. getApplicationContext() http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext defined on Activity and Service but not on Context Shouldn't there always be a valid application instance available from..
How to make route drawing more efficient? http://stackoverflow.com/questions/6666723/how-to-make-route-drawing-more-efficient Bitmap bitmap Rect src RectF dst Paint paint Shouldn't be too difficult you've done most of the important calculations..
OpenCV on Android Using Eclipse http://stackoverflow.com/questions/7991621/opencv-on-android-using-eclipse the calls to import different classes result in errors. Shouldn't there be a opencv.jar somewhere I've seen various posts that..
Do fragments really need an empty constructor? http://stackoverflow.com/questions/10450348/do-fragments-really-need-an-empty-constructor and in the end everything worked fine. android android fragments share improve this question Yes they do. You shouldn't really be overriding the constructor anyway. You should have a newInstance static method defined and pass any parameters..
Rotating a bitmap using JNI & NDK http://stackoverflow.com/questions/14398670/rotating-a-bitmap-using-jni-ndk JniTest rotates a bitmap by 90 degrees counter clockwise . br notes br the input bitmap will be recycled and shouldn't be used anymore br returns the rotated bitmap . br could take some time so do the operation in a new thread public native..
Inner class can access but not update values - AsyncTask http://stackoverflow.com/questions/18517400/inner-class-can-access-but-not-update-values-asynctask how to do this Does that mean that any values updated in the new thread will be lost once that thread returns No they shouldn't be lost . They probably just haven't been changed in the AsyncTask when you check them. Since this isn't your actual code..
Calling hidden API in android to turn screen off http://stackoverflow.com/questions/1875669/calling-hidden-api-in-android-to-turn-screen-off frameworks base.git a blob f core java android os Power.java does what I want but its a hidden API. Does that mean I shouldn't use it I would think its a fairly stable api. Currently I'm setting the screen timeout to 1 millisecond and then resetting..
Overriding the Home button - how do I get rid of the choice? http://stackoverflow.com/questions/2079691/overriding-the-home-button-how-do-i-get-rid-of-the-choice
Permission to write to the SD card http://stackoverflow.com/questions/2121833/permission-to-write-to-the-sd-card thanks patrick java android share improve this question You're right that the SD Card directory is sdcard but you shouldn't be hard coding it. Instead make a call to Environment.getExternalStorageDirectory to get the directory File sdDir Environment.getExternalStorageDirectory..
How to layout text to flow around an image http://stackoverflow.com/questions/2248759/how-to-layout-text-to-flow-around-an-image not possible using only the supplied widgets and layouts. You could write your own version of TextView to do this it shouldn't be hard. android share improve this question Now it is possible but only for phones with version higher or equal 2.2..
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog finally wl.release return null The method above doInBackground runs always on a background thread. You shouldn't do any UI tasks there. On the other hand the onProgressUpdate and onPreExecute run on the UI thread so there you can change..
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 a huge priority. Work for any device as long as it has either a GPS or a Network Location provider. It seems like it shouldn't be that hard but it appears to me that I have to spin up two different location providers GPS and NETWORK and manage each's..
Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName) http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername String authType throws CertificateException Clean up the certificates chain and build a new one. Theoretically we shouldn't have to do this but various web servers in practice are mis configured to have out of order certificates or expired self..
Android: Want to set custom fonts for whole application not runtime http://stackoverflow.com/questions/4395309/android-want-to-set-custom-fonts-for-whole-application-not-runtime attrs TypedArray values context.obtainStyledAttributes attrs R.styleable.CustomButton The value 0 is a default but shouldn't ever be used since the attr is an enum int typeface values.getInt R.styleable.CustomButton_typeface 0 switch typeface case..
getApplication() vs. getApplicationContext() http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext it's call to baseContext.getApplicationContext . One more thing the documentation says that it most cases you shouldn't need to subclass Application There is normally no need to subclass Application . In most situation static singletons can..
Android take screenshot via code http://stackoverflow.com/questions/5939987/android-take-screenshot-via-code take screenshot via code This shouldn't be too tough of a question. I want the ability to take a screenshot of my layout view and send it via sms. Can someone walk..
Good way of getting the user's location in Android http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android near as good as it should could be. I'm kind of confused why google hasn't a normalized API for location the developer shouldn't have to care where the location is from you should just specify what you want and the phone should choose for you. What..
Android onConfigurationChanged not being called http://stackoverflow.com/questions/6457659/android-onconfigurationchanged-not-being-called onConfigurationChange to not fire. Check that you are not using android screenOrientation in your manifest. Also it shouldn't make a difference but you can try using android configChanges orientation keyboardHidden rather than android configChanges..
Getting an issue while checking the dynamically generated checkbox through list view http://stackoverflow.com/questions/7738527/getting-an-issue-while-checking-the-dynamically-generated-checkbox-through-list the view type hack then you're creating 1000 views hierarchies instead probably 10 which could be reused easily . That shouldn't matter that much if you have only 20 items or so but if you use that technique for big lists you're just wasting precious..
ViewPager and fragments ??what's the right way to store fragment's state? http://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state Activity with putFragment and get 'em inside onCreate via getFragment. But I still have a string feeling that things shouldn't work like thant... See code below @Override protected void onSaveInstanceState Bundle outState super.onSaveInstanceState..
Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or folder without proper exif tags while a properly rotated image is saved in the android default folder even though it shouldn't be .. Now what I do is i record the time when I'm starting the camera app from my app. THen on activity result I query the..
support FragmentPagerAdapter holds reference to old fragments http://stackoverflow.com/questions/9727173/support-fragmentpageradapter-holds-reference-to-old-fragments up to the default fragment the app starts up and then viewpager navigates to the last known page. This seems strange shouldn't the app just load to the default fragment android android fragments share improve this question You are running into..
android app with service only http://stackoverflow.com/questions/990217/android-app-with-service-only be shut down automatically is to call Service.setForeground in your service onCreate to tell Android that your service shouldn't be stopped this was added mainly for mp3 player type services that have to keep running but can be used by any service...
Android out of memory when assigning variables http://stackoverflow.com/questions/14116757/android-out-of-memory-when-assigning-variables Bitmaps Efficiently thing but nothing seems to help. What spins my head is that it works on the S2 but not the S3. Shouldn't the S3 exceed the S2 in every way I am using a global BitmapFactory.Options to draw all my bitmaps I set the options as..
Google Places API request denied for Android autocomplete, even with the right api key http://stackoverflow.com/questions/14654758/google-places-api-request-denied-for-android-autocomplete-even-with-the-right-a and it still gives me REQUEST_DENIED What I didn't mention is that I have O2Auth activated does that change anything Shouldn't it be as simple as putting the API key in the app Thanks android google places api share improve this question The..
progress bar remains empty using asynctask - EDIT - dialog never stops loading http://stackoverflow.com/questions/16582484/progress-bar-remains-empty-using-asynctask-edit-dialog-never-stops-loading for signal and when I press it again it gives me the Toast message I have in onPostExecute.Is this normal behavior Shouldn't the icon be flashing until finds the signal and then show me the message without the user having to press again the button..
How to clear stack back to root activity when user leaves application? http://stackoverflow.com/questions/2131123/how-to-clear-stack-back-to-root-activity-when-user-leaves-application Home LogonAct MainAct Home I then follow this sequence LogonAct Back MainAct Why is it bringing me back to MainAct Shouldn't that activity haven been closed since LogonAct has android clearTaskOnLaunch true . I expected to be brought back to Home..
Accessing android:installLocation manifest attribute http://stackoverflow.com/questions/3065219/accessing-androidinstalllocation-manifest-attribute case auto Do stuff break case internalOnly Do stuff break case preferExternal Do stuff break default Shouldn't happen Do stuff break break attrloop break eventType xml.nextToken Uh I guess there's a switch in there with..
getApplication() vs. getApplicationContext() http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext with different objects When and why Moreover why is getApplication defined on Activity and Service but not on Context Shouldn't there always be a valid application instance available from anywhere android android activity android service android context..
How to make route drawing more efficient? http://stackoverflow.com/questions/6666723/how-to-make-route-drawing-more-efficient of the path on the Overlay 's canvas. You'll be using Canvas.drawBitmap Bitmap bitmap Rect src RectF dst Paint paint Shouldn't be too difficult you've done most of the important calculations in your transformPath method. Added You can actually do..
OpenCV on Android Using Eclipse http://stackoverflow.com/questions/7991621/opencv-on-android-using-eclipse the problem is that there are no OpenCV library files. So all the calls to import different classes result in errors. Shouldn't there be a opencv.jar somewhere I've seen various posts that mention having to build the library but unfortunately I don't..
|