Android :: How To Query Multiple Number Of Contact

Jun 16, 2009

I have the following code which queries 1 number of a contact. It works. But how can I change it so that I can query multiple numbers (work, mobile, home) for the same contact and the type of each number?int phoneColumnIndex = cursor.getColumnIndex(People.NUMBER); if (phoneColumnIndex != -1) {String phone Number = cursor.getString (phone ColumnIndex); System.out.println (" phoneNumber:" + phoneNumber);

Android :: How to query multiple number of contact


Android :: How Can I Query Contact Based On A Phone Number?

Jul 8, 2010

How can I query Android contact (in android 2.1) based on a phone number? I used to use People.CONTENT_URI (before android 2.1) but that is now deprecated.

View 1 Replies View Related

Android :: How To Query Number Of Unread SMS?

Jul 14, 2009

Can you please tell me how can i query the number of unread SMS in android programmically? i.e. How can I implement the SMS unread count like this link: http://android.kanokgems.com/sms-unread-count/.

View 2 Replies View Related

Android :: How To Query Contacts That Have Both A Phone Number And Name

Nov 12, 2010

I have following code in pre-Android2.0 API:

CODE:..................

What kind of selection should I do to retrieve contacts that have both name and phone number?

View 1 Replies View Related

Android :: How Do I Query Across Multiple Accounts?

Feb 25, 2010

My Android app has a ContactsList activity in which I simply display a list of contacts that are on the phone. Only recently I noticed that my activity only displays contacts synced with my main Google account. I have two Google accounts on my test phone and ideally I want my activity to display the contacts for both accounts (or multiple accounts). How do I query across multiple accounts?

View 2 Replies View Related

Android :: How Can I Query Number Of Unread SMS In Phone Programmically

Jul 14, 2009

Can you please tell me how can i query the number of unread SMS in android programmically?

How can I implement the SMS unread count like this link: http://android.kanokgems.com/sms-unread-count/

View 3 Replies View Related

Android : Query MMS - SMS Message ID Based On A Phone Number?

Sep 18, 2009

How can I query all the MMS/SMS messages from the same phone number?

View 2 Replies View Related

Android : Way To Structure URI Query For Multiple Values For Same Key?

Jul 22, 2010

I'm trying to structure a URI that accesses my data by id. Currently my URIs are query based like so: How could I structure a similar URI so that I could query for notes in multiple lists?

View 2 Replies View Related

Android :: Combination Of Multiple Values In Managed Query

May 20, 2010

I've got a database. In its "tags" column, rows can have a combination of multiple values "A, B, C"--such that: row 1 has "A" row 2 has "A, C" row 3 has "B, A" and so on, in various permutations. I am trying to implement search using a managedQuery such that I can return a cursor that contains rows with one or more values in the query. For example, if the user enters "C, A" for a search, s/he should get all rows that have A, C, or A and C. I'm splitting the user query on the comma (",") character, and the final call is as follows (parameters replaced by actual values):

mActivity.managedQuery("content_uri", [id, title, tags], "title LIKE ? OR tags LIKE ?", [%A% OR %C%, %A% OR %C%], "title ASC")

Even though there are rows in the database that contain A, C, or A and C--the managedQuery returns nothing. Thankfully, if the query is for "A", or for "C", the appropriate rows with "A" or "C" or "A and C" are returned. It's just that a query with more than one search term returns nothing. What am I doing wrong here? My guess is that %A% OR %C% is incorrect logic, but why?

View 2 Replies View Related

Android :: SQLite Query And Using Cursor To Deal With Multiple Rows

Jun 24, 2010

I've got a query, (I'm using rawQuery())

SELECT * FROM <table>

I'm then storing what it returns using a cursor. From their what I want to do is, start at the first row so.. cursor.moveToFirst() then take each column , column by column and store its particular value in a variable. I then want to move onto the next row and do the same. So I guess my question is How would I get cursor to deal with multiple columns?

View 2 Replies View Related

Android :: How To Query Contact History In Phone?

Nov 24, 2010

I'm using a Motorola Backflip running Android 2.1. Every contact in my phone has a History tab which shows recent history such as recent texts, calls, and facebook messages for that person (facebook is linked through motoblur). My questions are:
1) Is the history tab on every Android Device or is it only from Motoblur?
2) If it is an Android entity, is it possible to query this information using the new ContactsContract and SQLite calls, if so, how?
If it's only a motoblur entity, how does motoblur query that information to provide? (ie. how would you pull all contact history from calls, texts, and facebook because a linear search would be far inefficient.
Thanks in advance.

View 1 Replies View Related

Android :: Query And Delete Contact On SIM Failed

Jul 17, 2009

We are writing the application about accessing the contacts on SIM, including add, query, and delete. The operation "add" works well, while the query operation will return all records on SIM although I have added the selection condition, such as "name=xxx", and the delete operation doesn't work at all. The code is list as following.

CODE:..................

View 3 Replies View Related

Android :: Android ContentProvider Database Query Multiple Tables

May 7, 2010

I'm writing an RSS reader for Android. I've faced a certain difficulty which the problem I can't resolve since databases aren't my expertise.. So i figured out maybe one of you could help me out! I currently have 3 tables (Categories, links and feeds). My goal is too link a feed to multiple categories. Therefor I'm using a Link table. My databases is an Android ContentProvider (sqlite) and looks like the following:

| Categories | | Links | | Feeds |
|------------| |---------| |-------|
| _ID | | Category| | _ID |
| Title | | Feed | | Title |
| URL |

I currently wrote the following code in my FeedListActivity to retrieve a list of links and their feeds.

CODE:.................

Now my question:

I was wondering how I could optimize this database layout, code or query so I would get my entries in a more efficient way. Because i believe this link table or the query to retrieve links isn't needed! Or am i doing this the correct way?

View 2 Replies View Related

Android :: SQLite Query - Select Query With Between Clause

Sep 29, 2010

I want to run this query in Android Application :

code:.......

My DB schema

code:..........

Here is the function -

code:...........

View 2 Replies View Related

Android :: Want To Add Number To Contact On 2.0

Feb 5, 2010

Im trying to add a phone number to an already existing contact on a Droid-phone. Doing it at the same time as I create a contact is trivial, as the backreference I supply simply is 0 when creating a ContentProviderOperation. But trying to find the backreference through querying for a display name like this does not work: The big challenge is a huge lack of good documentation. I would be very satisfied to just get my hands on some working copypasta to study. Code...

View 4 Replies View Related

Android :: Getting Contact Name From Phone Number?

Dec 4, 2009

The semi-standard way of getting a contact name from a phone number is to use Contacts.Phones.CONTENT_FILTER_URL and append the phone number, as in the following sample code. This works fine on Android 1.6, but not on 2.0 -- is there a way to perform this function that works in all versions of the Android API? private String getContactNameFromNumber(String number) {// define the columns I want the query to return String[] projection = new String[] { Contacts.Phones.DISPLAY_NAME, // encode the phone number and build the filter URI Uri contact Uri = Uri.withAppendedPath (Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(number)); // query timeCursor c = getContentResolver().query(contact Uri, projection, null,null, null);// if the query returns 1 or more results}

View 2 Replies View Related

Android :: Looking Up Contact By Phone Number

Jul 29, 2010

I am getting contact details for a given phone number using the following code:

Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNum));
Cursor cursor = context.getContentResolver().query(uri,null,null,null,null);

There is a case though when the cursor contains 3 records with the same phone number and display name. Can you please suggest an explanation or possible reason for that?

View 1 Replies View Related

Android :: Look Up Contact's Name From Their Phone Number?

Feb 1, 2010

I am trying to get the sender's name from the contacts database using a content provider. The problem is I don't know how to implement it. Like now I can only pull the phone number from the smsMessage. I need to check to see if the phone number that is calling is in the users contacts first and if it is display the name if it is not then display the number.

View 1 Replies View Related

Android :: Contact From Phone Number - Old Vs New URI?

Aug 5, 2010

I have an Android 2.1 device (HTC Incredible). My app, however, must be compatible with early (pre SDK 5) devices, so I am using the deprecated format of filter URI:

Uri contactUri = Uri.withAppendedPath(Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(number));
Cursor C = context.getContentResolver().query(contactUri , null, null, null, null));


The number is of the form 15555551212. This fails to find the Contact, at least on my device. However, changing to the new (SDK 5 and later) ContactsContract format URI

Uri contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
Cursor C = context.getContentResolver().query(contactUri , null, null, null, null));

results in success. Originally, the corresponding number in the Contact was in the format +1 555 555 5555, but I changed it to exactly match the input number 15555555555 and the old format URI still fails. In both cases, the new format URI succeeds. Does anyone have any thoughts as to why this is the case?

View 1 Replies View Related

Android :: How To Read Contact Number?

Jul 27, 2010

I want to read the phone number and name using Android. I used the following code. It can only read phone name. How can I read phone number. I am very new in Android. Code...

View 1 Replies View Related

HTC Desire :: Increasing Number Of Multiple Exchange Accounts In Android Devices?

Sep 19, 2010

Is there any plan to increase the number of Exchange type accounts on HTC Android devices. Maybe in the new Sense Updates? Why did HTC not implement the code included in the stock Androind mail app (since at least 2.1), or at lease leave it alone! Since Hotmail has improved it's service to offer an Exchange style connection option there is a real day to day need to have at least two Exchange accounts on one device. I have been using the stock 2.2 android email client for some time and although it feeds into the unified calender app it does not feed into the Sense contacts ribon etc., I also goes high CPU at times (file conflict?) so is not a suitable workaround. And no I do not wish to use a third party app such as countdown, I like that with HTC's Sense system all things feed into a common thread - third party apps I have found have their own databases for email & calender etc. which I do not want.

View 6 Replies View Related

Android :: Lookup Corresponding Contact To A Phone Number?

Jul 6, 2009

What I'm trying to do, is to get the corresponding contact to a phone number. It works perfect if the number is stored in the contacts in the following format: +<country code><area code><number> But not all numbers are stored this way. Most are without the country code or with "00" instead of "+". Do I have to parse the number by myself and set up a corresponding WHERE clause for the query, or is there anything I can't find in the internet to get this one done by the framework?

View 4 Replies View Related

Android :: Set A Default Contact Number - How To Undo

Jan 10, 2010

So, I selected "remember this" when I was sending a text to a contact, because it was the mobile number. Turns out, that set the number as "default" for the contact and now I no longer get to choose which number to use when calling. How can I got back to not having a "default" number?

View 4 Replies View Related

Android :: Search Contact By Phone Number

Sep 14, 2010

In my app, user writes a phone number, and I want to find the contact name with that phone number? I usually search the contacts like this:Cursor cur = getContentResolver().query (ContactsContract.Contacts.CONTENT_URI, null, null, null, null); But I do this to access all contacts. In this app I only want to get the contact name of the given phone number. How can I restrict the query? Or do I have to go trough all contacts and see if any has the given phone number? But I believe that this can be very slow this way.

View 1 Replies View Related

Android :: Get All Contact's Name Phone Number - Email For 2.0?

Nov 8, 2009

For android 2.0, how to get a list of all contact's phone number and email? I have an app which works fine for 1.6. Now it is broken for 2.0 Droid. If you could point me an example to get all contact info, I really appreciate it. Previously, I used People.Contect_URI. now it is deprecated and return me nothing. I went through samples but failed to find how to do it in 2.0.

View 18 Replies View Related

Android :: Phone Number Contact Format

Apr 25, 2010

In Android I can get phone numbers of all the contacts without any problem. Tha problem is that for most users some numbers are stored as 'local' numbers, meaning that they dont have the country code included. For example, if the user lives in US and he has 2 contacts:

1) John - 555-123-1234 (local) (starting 1 not showing)

2) Jane - 44-123456787 (england phone number)

The question is: How do I get all the numbers in an international format, when some of the numbers doesnt include the country code?

View 2 Replies View Related

Android :: Retrieve Contact Name From Phone Number

Jun 20, 2010

I would like to retrieve the name of a contact associated with an incoming telephone number. As I process the incoming number in the broascastreceiver having a String with the name of the incoming caller would help my project greatly. I would think this involves a query using the sql WHERE clause as a filter, but do I need to sort the contacts? An example or hint would be of great assistance.

View 1 Replies View Related

Android :: Retrieve Contact Phone Number From URI

Jul 30, 2010

I am trying to get the contact's phone number after I have retrieved their ID number from the built-in activity. However, whenever I query the database using the cursor in my code below -- I get zero rows returned even though there is a mobile number for the contact I have selected. Can anyone point me in a better direction or show an example of how to get the contact's phone number AFTER getting their userID?

My code:

private Runnable getSMSRunnable() {
return new Runnable() {
public void run() {
Intent i = new Intent(Intent.ACTION_PICK,
ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
startActivityForResult(i, CONTACTS_REQUEST_CODE);......................

View 2 Replies View Related

Android :: Finding Name Of Phone Contact From Number

Jul 20, 2010

In my app, I get the name of the person calling from the contacts database and read it out. A user contacted me about a number in the format 123-456-7890 which doesn't work. I've tested this myself and can't see why it wouldn't work. The full code I'm using is available here, but the relevant part is below: Code...

View 2 Replies View Related

Android :: How To Update Contact Number Using Phone?

Jul 28, 2010

I am learning android. I am trying to upadate contact number pro grammatically. Could anyone help me please how can I do that.My effort is: String lNumber = pCur.getString( pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); Content Values values = new Content Values(); Uri lPhoneUri = Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, ContactsContract.CommonDataKinds.Phone.NUMBER);values.put(ContactsContract.CommonDataKinds.Phone.NUMBER, "45323333"));
getContentResover().update(lPhoneUri, values, ContactsContract.CommonDataKinds.Phone.NUMBER+"=?", new String[] { lNumber });

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved