android

Android: How to text filter a listview based on a simplecursoradapter?

I have a ListView that is backed by a SimpleCursorAdapter. I'd like to be able to filter the list like you would a contacts list, just by typing, and I came across the textFilterEnabled() Problem is, I couldn't see how to get it to work with a SimpleCursorAdapter. Is this even possible? If so, how is it done? ...

Android / layout: how to create a header-content layout

How do I go about creating the following layout in Android? I want a "header", that is, a header that stays the same at all times. The only thing that should change is the area below the header. Think of it as a webpage, where the content-area is where its all happening =) +--------------------+ | H E A D E R | +---------------...

Intercepting clicks from subview in Android

My application has a custom view which contains other custom views of a different type. The subviews have their own click listeners (which I can't change, as these are in 3rd party libraries). How can I intercept a user's click at the level of my view to do some processing, and then pass the click on to the proper subview? ...

How can i determine when my application is running?

I have an application that uses a Service to fetch data in the background both while the application is running and when it's not. When it is not running i would like to show a notification when there is new data, but not when the app is running. How do i determine in my service whether the app is running or not? ...

Best Way to Cache Data in Android

I have an ArrayList of custom, simple Serializable objects I would like to cache to disk and read on re-launch. My data is very small, about 25 objects and at most 5 lists so I think SQLite would be overkill. In the iPhone world I would use NSKeyedArchiver and NSKeyedUnarchiver which works great. On Android I've attempted to do this w...

hi is there an alternative way to download android SDK at present

my local network is so unstable that the file being downloaded is corrupted and missed when my connection is broken. i have tried several times on using "android-sdk_r04-windows.zip" to download the SDKs. In addition, there are so many 3rd-party tools which support resume broken downloading and support multi-thread and multi-site or P2P...

Android EditText ImeOptions "Done" track finish typing.

I am having edittext field i am setting following property so that i display done button on the kayboard when user click on textfield. editText.setImeOptions(EditorInfo.IME_ACTION_DONE); When user click done button on the screen keyboard(finish typing) i want to change radio button sate, how can i track done done button is hit from sc...

including "SkCanvas.h" native C/C++ code in Android

dose Anybody know how to incluede "SkCanvas.h" into native C/C++ code? I had include LOCAL_LDLIBS like below, but it didn't work. LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -L$(SYSROOT)/lib/ -lskiagl ...

Eclipse for android on Debian Lenny

Hello, I have installed Eclipse on Debian Lenny after having installed java (apt-get install sun-java6-jre sun-java6-plugin sun-java6-jdk). When I run Eclipse, I have the following message when it comes to selet the folder that will be used as the workspace: GCJ has been detected as the current Java virtual machine. Use of GCJ is unte...

how to structure my app to run in background

Hello, I am new to Android, and I need some advices for start up. I want to build an application, which will show up, when the user gets into some hot situation. By hot situation I mean: the GPS/cell coordinates are in known zone; known Bluetooth device detected; known Wi-Fi network detected; weather info has change; I se...

how to minimize battery drain in a heavy service

I will create a service to do something when some hot situation occurs. By hot situation I mean: the GPS/cell coordinates are in known zone; known Bluetooth device detected; known Wi-Fi network detected; weather info has change; considerable movement speed change detected: eg. from walking to travel by car. As you see these tasks a...

android timer swing

I need to create a Timer to update the UI at regular intervals. But the Swing Timer class is not available on Android. How can I work around this problem ? (I would avoid creating threads and then use the Timer class from java.util package) ...

memory of drawables, is it better to have resources inside APK, outside APK or is it the same for memory?

Hi I have an application that draws a lot of graphics and change them. Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder. But I started to get outOfMemory exceptions. The question is: Does android handle memory different if I l...

Android performance testing using "android.test.PerformanceTestCase" interface

I am trying to test performance of an android application using "android.test.PerformanceTestCase" interface , can anyone tell me how to make use of it... I know i can use Traceview tool to test performance but i want learn to use "android.test.PerformanceTestCase" interface provided by android. If i get any example code it will be ver...

play video using opengles, android

how to play video using opengl es in android? ...

Is it possible to set custom HTTP headers in the WebView

Hi all, I have to access a web page from within my application and, in order to have access to it, I need to set some custom HTTP headers. I want to use the WebViewclass in my activity but, as far as I can tell, it's not possible to set custom HTTP headers. So is there a way of using the existing web browser (or WebView) with custom H...

Android: How to have a shared menu in each (List) Activity without re-writing the overridden methods?

I know that Android provides some useful methods to be overridden in order to define a menu: @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(0, AIS, 0, "Activity Inventory Sheet").setIcon(android.R.drawable.ic_menu_upload); // ... return true; } public boolean onOptionsItemSelected(MenuItem...

Push my apk to /system/app

Hi! How can I push my application package to Android emulator "/system/app" folder? I've already tried to use: "adb push myApk.apk /system/app" and it gives me this: "failed to copy: ... No space left on device" Although from settings -> sdCard & Phone Storage, I get 37Mb of internal free space. The whole point of this need is ...

Inspect intents at runtime?

I'm interested in inspecting an Intent (namely it's extras) that gets logged like this: 01-05 13:00:29.192: INFO/ActivityManager(74): Starting activity: Intent { dat=content://media/external/images/media/29 cmp=com.android.camera/.ViewImage (has extras) } Is there any standard way to do it? The only option I can think so far is writin...

How to send HTML email

Hi, i found a way to send plain text email using intent: final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("text/plain"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"[email protected]"}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject"); ...