Using contacts (again)

by Lieuwe » Tue, 13 Jul 2010 19:33:14 GMT

Sponsored Links
 Is it possible to create a generic android application that uses
contacts (though a contentResolver) that will run on all android
versions > 1.5 ?

I have backward compatibility issues where f.i. my HTC Hero which is
upgraded to Android 2.1 is not able to use the People.CONTENT_URI even
though this is meant to be deprecated - not unsupported!

If I include the new API style ContactsContract.Contacts.CONTENT_URI
(with or without a check on the Build.SDK_VERSION to alternatively
load the old style URI - similar to the Businesscard example - )
I would still have to set up Eclipse to use the Android 2.1 libraries.
Would this application still run on an Android 1.5 device if I keep
the minsdkversion in the manifest at 3?

I would like to avoid having to branch my application, create 2
eclipse projects and release 2 different applications.

Any advice on this?



Using contacts (again)

by ionel » Mon, 19 Jul 2010 15:45:32 GMT

Other Threads

1. format for progressbar drawable xml?

Does anybody know the proper format for declaring custom horizontal  
progressbar drawables in xml? I've searched and searched, but the only  
documentation/discussions I can find are for custom button graphics,  
which seem to work via a different system.

Allan Hsu <allan at counterpop dot net>


2. GridView: how to select, programmatically?

This is driving me up a wall...

I want to have a GridView, containing four icons, and I want the first 
icon to be pre-selected when the activity is opened. This wouldn't seem 
too tough, but I'm obviously blanking on how to make it work.

Some sample code:

The layout is just a GridView in a LinearLayout. The four icons 
referenced in the Java are just some random icons. They all appear nice 
in a row...just none are selected.

I have grid.setSelection(0), but it does not seem to do anything.

I have tried various ways of augmenting the code, including:

-- calling grid.requestFocus() before grid.setSelection(0)
-- calling grid.invalidate() after grid.setSelection(0)
-- calling grid.requestLayout() after grid.setSelection(0)
-- delaying the grid.setSelection(0) via postDelayed() to ensure it gets 
called after onCreate() finishes
-- putting the grid.setSelection(0) in onResume(), which is NOT what I 
want, but I'm getting desperate

The GridView selection works fine...once somebody presses the D-pad to 
navigate the four icons. The selector (stock one from Android) shows up 
quite nicely. I just want the first icon to be pre-selected, so the UI 
is consistent -- there is *always* one icon highlighted. It is the only 
widget in the layout, so there should be no question of who has the focus.

What am I doing wrong?

Thanks in advance!

Mark Murphy (a Commons Guy)
_The Busy Coder's Guide to Android Development_ Version 1.3 Published!


3. java.lang.VerifyError in Android

4. When ever i run a mail application, ANdroid emulator say sorry (process )stops unexpectedly

5. Nokia & Visa tie up...

6. Web links without showing the URL

7. Video Review of T-Mobile G1