¡@

Home 

2014/10/16 ¤W¤È 08:14:40

android Programming Glossary: however

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

mContext getApplicationContext mContext getBaseContext However I can't find any decent explanation of which is preferable and..

android OCR? [closed]

http://stackoverflow.com/questions/1106202/android-ocr

so you're not going to get a drop in Android OCR library. However Tesseract is open source Google Code hosted infact so you can..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

intent filter receiver application manifest However I was wondering if you could send and receive MMS messages in.. PendingIntent extras not received by BroadcastReceiver However the extra gets passed to the SendBroadcastReceiver not the SMSReceiver.. to get this to work that I have found Receiving MMS However there is a variable mainActivity of type ServiceController ...

Android: ListView elements with multiple clickable buttons

http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons

int position long id Log.i TAG onListItemClick position However I don't want the whole item to be clickable but only the two.. Now I can click tap the button via the touch screen. However I can't manually select it with the trackball. It always selects..

How to make a nice looking ListView filter on Android [closed]

http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android

thought. You could add an OnKeyListener to your EditText . However this listener only receives some key events . For example if..

Android ACTION_IMAGE_CAPTURE Intent

http://stackoverflow.com/questions/1910608/android-action-image-capture-intent

the EXTRA_OUTPUT extra and returns the small Bitmap image. However if we putExtra EXTRA_OUTPUT ... on the intent before starting..

java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android

http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android

difficult to say why this is without looking at your code. However this article has some tips that might help http android developers.blogspot.de..

Quitting an application - is that frowned upon?

http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon

a lot of issues that exist in Windows Mobile and .NET. However the last week has been somewhat of a turnoff for me... I hope..

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

uses of it . That is pretty much the SDK APIs for this. However there is more you can do as a developer with your device. Using..

Change language programatically in Android

http://stackoverflow.com/questions/2900023/change-language-programatically-in-android

this question It's possible. You can set the locale. However i would not recommend that. We've tried it at early stages it's..

Running multiple AsyncTasks at the same time — not possible?

http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible

at the same time. Platform is Android 1.5 HTC Hero. However only the first gets executed. Here's a simple snippet to describe.. bar bar bar foo foo foo bar bar bar foo foo foo And so on. However what I get is onCreate is done. bar bar bar bar bar bar bar.. So in this case at most 5 tasks will run simultaneously. However if you start 16 your custom tasks in a row then first 5 will..

Any good graphing packages for Android? [closed]

http://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android

chart with a HTTP get which seems like a fine workaround. However our eventual expected application usage is in a poor connectivity..

Android and XMPP: Currently available solutions

http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions

here as is suggested in many other questions here in SO. However that's a patched version of the Smack API from two years ago...

ViewPager PagerAdapter not updating the View

http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view

got it displaying several views which I can page through. However I'm having a hard time figuring out how to update the ViewPager..

Android accelerometer accuracy (Inertial navigation)

http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation

should add up to 0 roughly in each direction. However this is not the case and the total acceleration over 5000 iterations..

How to get screen dimensions

http://stackoverflow.com/questions/1016896/how-to-get-screen-dimensions

deprecated For the use case you're describing however a margin padding in the layout seems more appropriate. share..

Android, How to manage start activity for result?

http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result

methods that finish this activity maybe without result however just one of them return result. For example from main activity..

android OCR? [closed]

http://stackoverflow.com/questions/1106202/android-ocr

closed I'm looking for a Java OCR that runs on Android however Asprise doesn't seem to be a platform independent OCR. is there..

Stop EditText from gaining focus at Activity startup

http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup

improve this question Excellent answers from Luc and Mark however a good code sample is missing Dummy item to prevent AutoCompleteTextView..

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

'Must Override a Superclass Method' Errors after importing a project into Eclipse

http://stackoverflow.com/questions/1678122/must-override-a-superclass-method-errors-after-importing-a-project-into-eclips

methods which in Java 1.6 can be annotated with @Override however in Java 1.5 @override could only be applied to methods overriding..

How to programmatically setting style attribute in a view

http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view

in your XML layout using themes or styles . Themes can however be applied programmatically . There is also such a thing as..

how to connect android emulator to the internet

http://stackoverflow.com/questions/2039964/how-to-connect-android-emulator-to-the-internet

I think some of the answers may have addressed this however obliquely but here's what worked for me. Assuming your problem..

Display PDF within app on Android?

http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android

of feature into my app and finally found it. The library however it's a bit tricky to use. It's not a standard Java jar library..

Focusable EditText inside ListView

http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview

Note tapping on the EditText will focus it at that point however that relies on a touchscreen which should not be a requirement...

Is AsyncTask really conceptually flawed or am I just missing something?

http://stackoverflow.com/questions/3357477/is-asynctask-really-conceptually-flawed-or-am-i-just-missing-something

showDialog method is called in onPostExecute . This however seems entirely contrived to me because showing a dialog always..

Adding a library/JAR to an Eclipse Android project

http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project

the most elegant in my humble opinion. This will not work however for Android whose Dalvik JVM cannot handle an ordinary Java..

Running multiple AsyncTasks at the same time — not possible?

http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible

Params... version of this method with THREAD_POOL_EXECUTOR however see commentary there for warnings on its use. DONUT is Android..

Enable GPS programatically like Tasker

http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker

and let the user enable disable it. I understand that however I recently bought Tasker from the market and among many other..

How to parse XML using the SAX parser

http://stackoverflow.com/questions/4827344/how-to-parse-xml-using-the-sax-parser

handler implementation over the android.sax one. I can however tell you the disadvantage which should be pretty obvious by..

Save ArrayList to SharedPreferences

http://stackoverflow.com/questions/7057845/save-arraylist-to-sharedpreferences

the activity and then wants to come back at a later time however I don't need the array available after the application has been..

Android: How to declare global variables?

http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables

is a common Java way of achieving this. I have found however that a more elegant way in Android is to associate your state..

ViewPager PagerAdapter not updating the View

http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view

I'll paste the class below. What doesn't appear to update however is the 2nd view the 'B' remains it should display 'Y' after..

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

void method mContext this since Activity extends Context mContext getApplicationContext mContext getBaseContext However I can't find any decent explanation of which is preferable and under what circumstances which should be used. Pointers to..

android OCR? [closed]

http://stackoverflow.com/questions/1106202/android-ocr

are Aspire and Tesseract . Neither are straight up Java so you're not going to get a drop in Android OCR library. However Tesseract is open source Google Code hosted infact so you can throw some time at porting the subset you need to Java. My..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

filter action android name android.provider.Telephony.SMS_RECEIVED intent filter receiver application manifest However I was wondering if you could send and receive MMS messages in a similar fashion. After doing some research many examples.. a PendingIntent to be received by a BroadcastReceiver Android PendingIntent extras not received by BroadcastReceiver However the extra gets passed to the SendBroadcastReceiver not the SMSReceiver . How can I pass an extra to the SMSReceiver Update.. allowing you to detect incoming MMS. Here is the closest example to get this to work that I have found Receiving MMS However there is a variable mainActivity of type ServiceController . Where is the ServiceController class implemented Are there..

Android: ListView elements with multiple clickable buttons

http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons

@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 element. So my question is how do I implement.. Update I found a solution as described in my answer below. Now I can click tap the button via the touch screen. However I can't manually select it with the trackball. It always selects the whole list item and from there goes directly to the..

How to make a nice looking ListView filter on Android [closed]

http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android

the input from the EditText . This actually takes a bit of thought. You could add an OnKeyListener to your EditText . However this listener only receives some key events . For example if a user enters 'wyw' the predictive text will likely recommend..

Android ACTION_IMAGE_CAPTURE Intent

http://stackoverflow.com/questions/1910608/android-action-image-capture-intent

user take a new picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small Bitmap image. However if we putExtra EXTRA_OUTPUT ... on the intent before starting it everything works until you try to hit the Ok button in..

java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android

http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android

getting deallocated when your activity is destroyed. It's difficult to say why this is without looking at your code. However this article has some tips that might help http android developers.blogspot.de 2009 01 avoiding memory leaks.html In particular..

Quitting an application - is that frowned upon?

http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon

to developing for the Android platform since it addresses a lot of issues that exist in Windows Mobile and .NET. However the last week has been somewhat of a turnoff for me... I hope I don't have to abandon Android but it doesn't look very good..

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

goes away and probably quickly subsumed into caches and other uses of it . That is pretty much the SDK APIs for this. However there is more you can do as a developer with your device. Using adb there is a lot of information you can get about the..

Change language programatically in Android

http://stackoverflow.com/questions/2900023/change-language-programatically-in-android

from the app. android localization resources share improve this question It's possible. You can set the locale. However i would not recommend that. We've tried it at early stages it's basically fighting the system. We have same requirement..

Running multiple AsyncTasks at the same time — not possible?

http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible

same time &mdash not possible I'm trying to run two AsyncTasks at the same time. Platform is Android 1.5 HTC Hero. However only the first gets executed. Here's a simple snippet to describe my problem public class AndroidJunk extends Activity class.. onCreate is done. The output I expect is onCreate is done. bar bar bar foo foo foo bar bar bar foo foo foo And so on. However what I get is onCreate is done. bar bar bar bar bar bar bar bar bar The second AsyncTask never gets executed. If I change.. a worker thread a task from the queue will start execution. So in this case at most 5 tasks will run simultaneously. However if you start 16 your custom tasks in a row then first 5 will enter their doInBackground the rest 10 will get into the queue..

Any good graphing packages for Android? [closed]

http://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android

bandied about on the web have been just pull down a Google chart with a HTTP get which seems like a fine workaround. However our eventual expected application usage is in a poor connectivity situation where network usage is expensive unlocked phones..

Android and XMPP: Currently available solutions

http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions

development. I've been using the patched Smack library from here as is suggested in many other questions here in SO. However that's a patched version of the Smack API from two years ago. And although it generally works well I'm exploring any other..

ViewPager PagerAdapter not updating the View

http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view

from the compatibility library. I have succussfully got it displaying several views which I can page through. However I'm having a hard time figuring out how to update the ViewPager with a new set of Views. I've tried all sorts of things..

Android accelerometer accuracy (Inertial navigation)

http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation

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 10 on each axis..

How to get screen dimensions

http://stackoverflow.com/questions/1016896/how-to-get-screen-dimensions

Android, How to manage start activity for result?

http://stackoverflow.com/questions/10407159/android-how-to-manage-start-activity-for-result

startActivityForResult . In my second activity there are some methods that finish this activity maybe without result however just one of them return result. For example from main activity I call second one in this activity I'm checking some features..

android OCR? [closed]

http://stackoverflow.com/questions/1106202/android-ocr

OCR closed I'm looking for a Java OCR that runs on Android however Asprise doesn't seem to be a platform independent OCR. is there any opensource free Java OCR I can use for android application..

Stop EditText from gaining focus at Activity startup

http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup

when the Activity starts android listview edittext share improve this question Excellent answers from Luc and Mark however a good code sample is missing Dummy item to prevent AutoCompleteTextView from receiving focus LinearLayout android focusable..

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

'Must Override a Superclass Method' Errors after importing a project into Eclipse

http://stackoverflow.com/questions/1678122/must-override-a-superclass-method-errors-after-importing-a-project-into-eclips

it to use Java 1.6. You have classes implementing interface methods which in Java 1.6 can be annotated with @Override however in Java 1.5 @override could only be applied to methods overriding a superclass method. Go to your project ide preferences..

How to programmatically setting style attribute in a view

http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view

the look of a screen or part of a layout or individual button in your XML layout using themes or styles . Themes can however be applied programmatically . There is also such a thing as a StateListDrawable which lets you define different drawables..

how to connect android emulator to the internet

http://stackoverflow.com/questions/2039964/how-to-connect-android-emulator-to-the-internet

android internet android emulator share improve this question I think some of the answers may have addressed this however obliquely but here's what worked for me. Assuming your problem is occurring when you're on a wireless network and you have..

Display PDF within app on Android?

http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android

and searched for the reliable libraries to support that kind of feature into 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..

Focusable EditText inside ListView

http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview

and no way to focus into the EditText using the jogball. Note tapping on the EditText will focus it at that point however that relies on a touchscreen which should not be a requirement. ListView apparently has two modes in this regard 1. setItemsCanFocus..

Is AsyncTask really conceptually flawed or am I just missing something?

http://stackoverflow.com/questions/3357477/is-asynctask-really-conceptually-flawed-or-am-i-just-missing-something

or handlers. The example then continues to show how some exemplary showDialog method is called in onPostExecute . This however seems entirely contrived to me because showing a dialog always needs a reference to a valid Context and an AsyncTask must..

Adding a library/JAR to an Eclipse Android project

http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project

least 3 ways to add a third party library the one I use is the most elegant in my humble opinion. This will not work however for Android whose Dalvik JVM cannot handle an ordinary Java compiled class but must have it converted to a special format...

Running multiple AsyncTasks at the same time — not possible?

http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible

execution you can use the executeOnExecutor Executor Params... version of this method with THREAD_POOL_EXECUTOR however see commentary there for warnings on its use. DONUT is Android 1.6 HONEYCOMB is Android 3.0. UPDATE 2 See the comment by..

Enable GPS programatically like Tasker

http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker

reasons you have to forward to location preferences screen and let the user enable disable it. I understand that however I recently bought Tasker from the market and among many other things that you can accomplish with it you can set rules to..

How to parse XML using the SAX parser

http://stackoverflow.com/questions/4827344/how-to-parse-xml-using-the-sax-parser

to be honest I can't really tell you any real advantage of this handler implementation over the android.sax one. I can however tell you the disadvantage which should be pretty obvious by now. Take a look at the else if statement in the startElement..

Save ArrayList to SharedPreferences

http://stackoverflow.com/questions/7057845/save-arraylist-to-sharedpreferences

I need the array to stick around even if the user leaves the activity and then wants to come back at a later time however I don't need the array available after the application has been closed completely. I save a lot of other objects this way..

Android: How to declare global variables?

http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables

of your application. A static variable for instance a singleton is a common Java way of achieving this. I have found however that a more elegant way in Android is to associate your state with the Application context. As you know each Activity is..

ViewPager PagerAdapter not updating the View

http://stackoverflow.com/questions/7263291/viewpager-pageradapter-not-updating-the-view

test project and I've almost been able to update the views. I'll paste the class below. What doesn't appear to update however is the 2nd view the 'B' remains it should display 'Y' after pressing the update button. public class ViewPagerBugActivity..

WebView fails to render until touched Android 4.2.2 [duplicate]

http://stackoverflow.com/questions/15127762/webview-fails-to-render-until-touched-android-4-2-2

Android WebView renders blank white view doesn't update on css changes or HTML changes animations are choppy . HOWEVER setting the WebView's RenderPriority to high alone does not solve it... the only way to get it to render without being touched..

Android - reference a string in a string array resource with xml

http://stackoverflow.com/questions/4161256/android-reference-a-string-in-a-string-array-resource-with-xml

you will get the first item. But that is of no practical use if you want to use let's say... the second of course. HOWEVER there is a trick you can do. See here Referencing an XML string in an XML Array Android You can cheat not really the array..

Display fragment viewpager within a fragment

http://stackoverflow.com/questions/7700226/display-fragment-viewpager-within-a-fragment

. Some research has led me to the conclusion that the system is unable display fragments within another fragment HOWEVER there seems to be some indication that it is possible to do exactly this with the use of a ViewPager A bug in ViewPager..

Fragments, DialogFragment, and Screen Rotation

http://stackoverflow.com/questions/8235080/fragments-dialogfragment-and-screen-rotation

Fragment and all is well there. However I show a DialogFragment from within GroupFragment. This shows correctly HOWEVER when the screen rotates I get a Force Close. What's the proper way to display a DialogFragment from within another Fragment..

Auto playing vimeo videos in Android webview

http://stackoverflow.com/questions/9030524/auto-playing-vimeo-videos-in-android-webview

'EVENT Finish' And in the Activity I put a bit to watch for this see above in the onConsoleMessage override. HOWEVER as of this writing I still have not sorted one nagging problem. The MediaPlayer lives on after the WebView and all its progeny..

MediaPlayer setDataSource, better to use path or FileDescriptor?

http://stackoverflow.com/questions/9625680/mediaplayer-setdatasource-better-to-use-path-or-filedescriptor

you to resolve this issue by setting ownerOnly to false...but that doesn't help you if you need to support older SDKs. HOWEVER mediaPlayer.setDataSource FileDescriptor fd does NOT have this problem and mediaplayer will successfully prepare the same..