android-sdk-2.1

Problem when trying to get Contracts Group ~ Unknown URL content://com.android.contacts

Problem when trying to get Contracts Group Uri contacts = ContactsContract.AUTHORITY_URI; //Log.v("23",contacts.toString()); // Make the query. Cursor managedCursor = act.managedQuery(contacts, projection, // Which // columns // to // return null, // Which rows to return (all rows) null // Selection arguments (...

How to add manually contacts group to Android database?

I want to define some Contact Groups. I am wondering where and how does Android store the groups. Maybe in a Sqlite database? If so, will be able to run a insert on it? Otherwise how do you add new Contacts Group via the emulator? ...

How is advised to use the contentResolver's delete method to be injection safe?

You can delete with content resolver by URI or by passing some parameters to the where parameter. How do you make the parameters to be SQL Injection Safe? Is it possible to use Prepared Statements with ContentResolver? act.getContentResolver().delete(myuriwithid,null,null); act.getContentResolver().delete(mybaseuri," name = '"+this.nam...

Issue using Contact Group delete on Android

I have this code to delete a Contact Group public void delete(Activity act,String[] args) { try { int b=act.getContentResolver().delete(ContactsContract.Groups.CONTENT_URI,"_ID=?", args); Toast.makeText(act, "Deleted",Toast.LENGTH_SHORT).show(); //notify registered observers that a row was ...

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 to catch fire of onItemSelected of a Spinner, after the interface has been setup?

I am having an Android view with a Spinner on it. I call a populateSpinner() method to add some default values to it. I also have a onItemSelected() event which gets called before the view is completed to print. I would like to run a code inside this block only when the user changes the selected items, not when I add or the form gets cr...

How do I add contact to a group on Android?

I read about ContactsContract.CommonDataKinds.GroupMembership, but I can't figure out what URI use to insert to. I have prepared this method: public static Uri addToGroup(ContentResolver resolver, long personId, long groupId) { ContentValues values = new ContentValues(); values.put(ContactsContract.CommonD...

AvoidXferMode Tolerance

I have a problem with the following code: protected void onDraw(Canvas canvas) { Paint paint = new Paint(); // Draw a blue circle paint.setColor(Color.BLUE); canvas.drawCircle(100, 100, 50, paint); // Draw a red circle where it collides with the blue one paint.setXfermode(new AvoidXfermode(Color.BLUE, 0, Mode.T...

Are there java bindings for OpenGL ES 2.0 on the Android platform?

I know that the recently released android ndk r3 supports opengl es 2.0 on supported phones (nexus one for example), however it doesn't say whether there are java bindings for opengl es 2.0 included in the SDK yet. Are said bindings on the way, and if not, does JOGL2 support the opengl es 2.0 profile on the android? ...

Showing Live Wallpaper in a 1.6 target app by detecting if it's a 2.1 device?

We're building an Android app with target SDK 1.6, so it will run on 1.6 devices and higher. We'd like to support Live Wallpapers, which we know is 2.1+ only. Is there a way to build one app with 1.6 SDK as the target, but detect if the device it's running on is 2.1, and only in that scenario call the live wallpaper API. We're trying ...

How do I use PackageManager.addPreferredActivity()?

In SDK 1.5 I was using the PackageManager class to set the preferred home screen to be my app using PackageManager.addPackageToPreferred(). In the new SDK (using 2.1) this has been deprecated so I'm trying to use addPreferredActivity() for the same result but it's not working as expected. Some necessary background. I'm writing a lock sc...

How to make camera button of Droid skip to next track?

I want to make a tool/app where when the screen is off and music is playing via earphones or speaker and u push the camera button it skips to the next song. Hope someone can help! ...

VoiceRecognition.java gives me the error "Recognizer not present".

The sample program VoiceRecognition.java gives me the error "Recognizer not present" using the emulator. How do I fix this problem. ...

Android keyboard api

Does android expose an API or somesuch for the development of thirdparty keyboard applications? There are several existing apps which can replace the default input methods, however I cannot seem to find any information about it. ...

Conversion to Dalvik format failed error for Android Grid View

Hey Everyone, I'm on the android bandwagon and started going through google's "view" tutorials. Here is what I'm using: Eclipse Galileo Android SDK 2.1 Java SDK 6.Something I think. Everything was hunky-dory until I hit the grid view tutorial. I got errors all over the place when I started editing the "HelloGridview.java" File. I thoug...

Why would JmDNS service discovery work on a Motorola Droid running Android 2.1-update1 and not on an HTC Incredible running the same version of Android?

I have successfully gotten JmDNS working on Android 2.1 testing on a Motorola Droid by using MulticastLock, but recently got an HTC Incredible as second test device, and JmDNS discovery doesn't work at all. I should mention that broadcasting a service still works and everything appears to run normally, but serviceAdded() never gets call...

Getting really weird long Contact Group names

When looking at the Contact Groups on Google Contacts or in the People application of my HTC Legend phone, I get the groups names ok eg: Friends, Family, VIP, Favorite etc... But in my application I get really wrong names such as "Family" became "System Group: Family" "Friends" became "System Group: Friends" "Favorite" became "Favorite_...

How to get my contact card/id on Android?

How do I get my contact card/id of a Android phone? eg: the owner of the phone ...

Drawing an empty polygon given a set of points on a Map Overylay (Android 2.1)

Hi, I've set of n points and I want to draw a n-sided polygon using these points. I tried using android.graphics.path (please see below). Path path = new Path(); Vertex currVtx; for (int j = 0; j < vertices.size(); j++) { currVtx = vertices.get(j); if (!currVtx.hasLatLong()) continue; Point currentScreenPoint = getScreenPoi...

How do I get the time when the Location has been updated in Android?

As you know we can get thast Last Known Location, but how do we get the time when that has changed? ...