android

Read all contact's phone numbers in android.

Hello! I'm using this code to retrieve all contact names and phone numbers: String[] projection = new String[]{ People.NAME, People.NUMBER }; Cursor c = ctx.getContentResolver().query(People.CONTENT_URI, projection, null, null, People.NAME + " ASC"); c.moveToFirst(); ...

Android, add() function of ArrayAdapter not working

Hi, I have an ArrayAdapter (myAdapter) attached to an AutoCompleteTextView (textView)component. Once the user presses a character I would like to populate AutoCompleteTextView's drop down list with items containing this character. I retrieve the items using AsyncTask (which uses a web service). I call myAdapter.add(item) but the drop do...

How to raise a Toast on top of a AlertDialog?

I am validating an AlertDialog, and I would like to raise a Toast on top of the AlertDialog display. I have this code, but the Toast is displayed on the activity new AlertDialog.Builder(this).setTitle(R.string.contact_groups_add) .setView(addView).setPositiveButton(R.string.ok, new DialogInterfac...

How "good" is the Android Emulator?

As the title says, how "good" is the Android emulator? I don't have an Android phone but would it be possible to develop purely using the emulator as the testing environment? My initial questions about it: Is the emulator as responsive as a normal android phone (of course this depends on the exact phone but in general)? Is there a wa...

Protect my service from taskkiller-apps

I am developing an application that needs to constantly run a service unless the user consciously deactivates it. The problem is that there are taskkiller-apps with a "kill all applications"-button. These seem to become increasingly popular, and they are causing me a fuzz. When I kill my service with som task managers, onDestroy() is nev...

When to reset a callbackhandler for a Service

Hello, i have two Activities A and B and one Service C. A starts B. A and B: are binding and unbinding to the Service in onStart()/onStop(). are implementing a Handler-Object that works with Messages. The Handler is needed, so if C is doing Work and the Result is there, it will give back a result or message to A or B. are impleme...

seekbar progress customization

Hi all, Using progress_horizontal.xml as a base drawable for my seekbar i was able to customize it pretty well. But unfortunately i stuck with the following problem. I need my progress to be made from two horizontal lines with different color something like this http://picasaweb.google.com/manigoad/Other#5442553107070487330 . In this ca...

Draw a Bitmap by specifying the x,y locations of the four corners

Hi, The following message refers to the Android platform I want to draw a bitmap on the screen by specifying the x,y locations of the four corners. I.e. I have a square bitmap and I would like to draw the: Top right corner at pixel x=100,y=100 Bottom right corner at pixel x=120,y=220 Bottom left corner at pixel x=50,y=200 Top left co...

how to perform some task on exit of application(normal or abnomal) in android?

friends, i want to delete file data that i have created in android application. if my application is terminated abnomally or nomally? any help would be appriciated. ...

Programmatic sdcard mounting/unmounting

Hi all, I'm wondering how programmatic sdcard mounting/unmounting can be achieved while the handset is connected to a pc via USB. I cannot find any managed api for that and also my jni attempts failed with errno: 1, [Operation not permitted] error. Thanks ...

Why are my overlays on a mapview not shown?

I followed the instructions from the google hellomapview tutorial. I get a working mapview etc. But the two items that are added to the map are not shown. It seems they are there somewhere because tapping at the specified location shows the message that was added to the items. Edit Here is my source code. It should be very close to the...

Help with nongoogle Contact management...

I have been searching for an ACT! compatible contact management solution and have not had any luck. While I am not a programmer or developer, I have been trying to find anything I can on the subject. (very overwhelming!!!) So, that's why I decided to chance asking for help. I have a Moment and all the contact managers tend to sync with...

Custom Map markers and custom backgrounds

I am trying to get the images to have transparent backgrounds so the map is not blocked by a square marker with an image in it. What image editor and what settings should I use to get this to work? I am trying to do some custom backgrounds for buttons and the same problem comes up: I get square corners and a background that does not sca...

Accessing Unique Identifier (either user, email, or phone) for Android phone in v1.5

Look to identify the user, email, or phone identifier from Android 1.5. I've seen how to access account information from 2.0 and above but need this functionality in 1.5. ...

Downsample 16-bit pcm audio to 8-bit in android

Hello I would like to downsample 16 bit pcm audio to 8 bit and then upsample the same from 8 bit back to 16 bit in android. I am using this which seems to work: int tempint; for (int i=1, j=0; i<tempBuffer.length; i+=2, j++) { tempint = ((int) tempBuffer[i]) ^ 0x00000080; tempBuffer[j] = (byte) tempint; Log.e("test","-----...

Content Provider in Android basic questions

Hi, I am having trouble understanding content providers in Android. Do you use intents to call content providers as well as managed queries? Also, an activity has an intent filter. The intent filter has a element which has a mimeType attribute. How does Android know which content provider this mimetype is referring to? The tag in ...

How to copy a smaller bitmap into a larger one?

Hi, Hopefully this should be an easy question. I'm trying to copy a series of small bitmaps into a larger one, arranging them side by side without any gaps or overlap in their pixels. For example, if I have 3 square bitmaps, I'd like to copy them into one long and thin rectangle. I know how to do the opposite, namely creating a small bi...

On which user actions is the method onSnapToItem() called in the interface Overlay.Snappable?

What kind of interaction is needed to trigger this onSnapToItem method? And is there any more ground work to be done to make an Overlay react to this interaction other then implementing this interface? ...

Consume ado.net data service from android 2.1

I have a ado.net data service created using VS 2008 sp 1 that is hosted that I want to consume via HTTP and JSON from Android 2.1? Does anyone have sample code on how to do CRUD operations easily do this? I heard Restlet makes this very easy but can't seem to find sample Android code on doing this. If someone can post a tutorial with som...

How to manage lifecycle in a ViewGroup-derived class?

I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a GraphView class: public class GraphView extends LinearLayout { public GraphView(Context context, AttributeSet attrs) { super(context, attrs)...