android

Android drawing cache

Please explain how does the drawing cache work in Android. I'm implementing a custom View subclass. I want my drawing to be cached by the system. In the View constructor, I call setDrawingCacheEnabled(true); Then in the draw(Canvas c), I do: Bitmap cac = getDrawingCache(); if(cac != null) { c.drawBitmap(cac, 0, 0,...

Android ConnectivityManager information

I am trying to get a better grip on Android's ConnectivityManager and how it really works under the hood. Using the API is simple enough but I am looking for something lower level such as when it starts and the dirty details of what its doing in the background. I can't seem to find a good resource about it. Everything is just about us...

BluetoothChat problems send message

Hello Can you help me I want to create application ,which can connect Droid and another device with bluetooth I use BluetoothChat as for example to connect Motorola Droid and Nokia N97 They were paired and connect. But when I send message ,connection lost immediatly How can I solve this problem? ...

pass values from one screen to another?

I need to pass data's (String) from one screen to another screen. At the time of button click i need to pass values from first screen to the next screen. ...

Android OnTabChangingListener

The TabHost widget has a setOnTabChangedListener() method to run code when the tab changes, but I need to run code before the tab changes, in order to validate the data entered. Is this possible? I was thinking about using a click listener but it seems like it would be fiddly to get it to detect clicks on items, and I'm still not sure ho...

Android AudioHardware pcm playback is going to standby

Occasionally when I have a lot going on in my app, and I am playing a number of sounds using SoundPool, my app just completely freezes. Looking at the logs, I see this: I/AudioHardwareMSM72XX( 56): AudioHardware pcm playback is going to standby. My app must then be force closed and restarted. Does anyone know what may be causing t...

Can't get Dialog hosting a WebView to layout properly

Hi, I'm trying to host a webview on a dialog, without a titlebar, but I'm getting odd layout results. Example test: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); WindowManager wm = (WindowManager)getContext().getSystemServic...

Drawing bitmaps faster on Android canvas or OpenGL

I currently have a game written using the Android canvas. It is completely 2D, and I draw bitmaps as sprites on the canvas, and it technically works, but I have a few features that I need to add that will require drawing many more bitmaps on the screen, and there will be a lot more movement. The app needs more power. What is the best ...

call setListAdapter() from inside a thread

Hi, I have a problem with my ListActivity, i use a thread to show a ProgressDialog where get a list of all installed applications. I turn it into a list adapter and than i want to set the listadapter of the activity but i can't do that from the thread. I get the following error: ERROR/AndroidRuntime(14429): android.view.ViewRoot$Called...

Android - Showing Dialog from custom component

Hi! I am writing a custom component (derived from a relative layout) which has to show a dialog, Is there a way to do this using callbacks like oncreatedialog or onpreparedialog? if not: if i have to create the dialog outside oncreatedialog, i have to "attach it to an Activity with setOwnerActivity(Activity)". How can the custom compon...

What happens to thread as onDestroy is called when device is rotated

I would like to know as to what will happen to the thread which has been created by an activity and the device is rotated. I have observed that the onDestroy method is called when this happens. Will the thread be killed too? If the thread is not killed, how can I reassociate the thread with the activity as a new instance of the activity...

Imageview ontop of another imageview

I have a listlayout with items in it that looks like this: There is first an ImageView (the light) and then two textViews. All of this inside a TableLayout. (source here: http://code.google.com/p/switchctrl/source/browse/trunk/android/res/layout/device_switch.xml) I want to have a rotating animation of a loading indicator Ontop of th...

Does anyone have an example of how to stream the camera to a server on android?

I find plenty of examples of downstreaming a video from a server to an android, but I actually want to stream live images from my droid to a server. ...

Performance of the Android Virtual Device

The Android virtual device (a simulated Android environment) doesn't run very smoothly on my machine. Scrolling and animations in general are quite sluggish. Is that normal? EDIT: Just noticed that a AVD running Android 1.6 has a significantly better performance than the AVDs running on 2.1 and 2.2. ...

Memory Issues When DOM Parsing A Large XML File on Android Devices

Hey awesome SO users, I have an Android application that parses an XML file for users and displays results in a much more mobile friendly format. The app works great for most users, but some users have lots and lots of data and the app crashes on them because it runs out of memory. Is there any way I have a DOM style XML parser quit pa...

Howto get Autocomplete for the Propertys in Eclipse

Is it possible to get Autocomplete or Something when i work with the eclipse form editor? I write a color in the strings.xml and then i want to select it by the propertys for the text color, but there is no autocomplete or something equal ...

Android ScrollView jumps around when resized

I have a ScrollView that contains an number of other views (TextViews, ImageViews, etc.). The ScrollView is taller than the screen. I have an AsyncTask that updates the children of the ScrollView based on an http response. I've discovered an interesting behavior that I can't figure out how to work around. If I set any of the children...

Why do I get so many errors building my Android project with Ant?

Now that I sort of know my way around the SDK/API, I've switched from Eclipse back to my favorite text editor, which means I have to use ant to build my project, however: It seems every other time I compile the project, a lot of drawables get corrupted, resources lose their ids (resulting in NPEs in the code), or classes throw "Verify E...

Android Dictionary

Is there a dictionary API for Android. I am mainly looking for simple features like: -- Given a word, look up its meaning -- Look up all words that begin with "cat" Thanks Chris ...

Adding multiple views to a listview.

Hey guys, I tried to add these views to list view using this kind of factory but everytime I try and add the view to a ListActivity, it comes up with nothing. What am I doing wrong? I set my list views like so: List<View> views = new ArrayList<View>(); for(int x =0;x<tagg_views.size();x++){ lv.addHeaderView(views.get(x)); } ...