Re: [android-developers] Picking up a PhoneBook entry under Android 2.0 !!!

2009-11-01 Thread Andrew Zhang
Hi ,

Content uri is changed. Please have a try of
ContactsContract.Contacts.CONTENT_URI.

On Mon, Nov 2, 2009 at 9:57 AM, frantz lohier  wrote:

> Happy Halloween All !
>
> The party is over and Google suddenly released the much anticipated Android
> 2.0 SDK.
>
> Much improvement for sure !
>
> That said, the party is over and I came to have to deal with the following
> Ghost;
>
> I've released an app in the market (Ambu) - so far qualified under SDK 1.5
> &1.6. Using the emulator for Android 2.0, things don't work anymore.
>
> This is what I'd like to share;
>
> - my app invokes an ACTION.PICK intent as way to extract phone contact from
> the phone book and populate a database.
>
> When compiling my app using the SDK version 1.6 and a target emulator
> configured at 1.6 level, the following code WORKS:
>
> Intent pickcontact = new Intent(Intent.ACTION_PICK,
> People.CONTENT_URI);
> startActivityForResult(pickcontact, CALL_CONTACTPICKED);
>
> When running the same code (compiled with SDK 1.6) and a target emulator at
> 2.0 level, the above code never return the entries I have populated in my
> the phone book. It's as if the phonebook was always empty.
>
> A couple of additional observations;
>
> - When running the emulator in 2.0 mode, the default local input type is
> Japaneese. Any way to change this ?
>
> - Under the 2.0 emulator, and setting a "clean" AVD image, if you launch
> the dial button, press menu and select account, you'll probably immediatly
> get a "android.process.acore" error ...
>
> - In the most recent SDK document, I can read that "People.CONTENT_URI" was
> deprecated after SDK 1.6. Therefore, I've changed the above code to:
>
> Intent pickcontact = new Intent(Intent.ACTION_PICK, AUTHORITY_URI);
> StartActivityForResult(pickcontact, CALL_CONTACTPICKED);
>
> Unfortunatly, with the above, I get a crash right away when invoking
> ACTION_PICK.
>
> Question to the Google Folks (dear dianne and others, please !);
>
> How to we properly pick a phonebook contact under the 2.0 OS using 1.6 or
> 2.0 compiled apps ?
>
> Thanks !!!
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Global search always shows "More results... XXX (n)" for 3rd party application?

2009-09-15 Thread Andrew Zhang
Hi Dianne,

Works as expected. Thanks for the explanation!
On Wed, Sep 16, 2009 at 12:48 PM, Dianne Hackborn wrote:

> This is very intentional.  It prevents applications from being able to spam
> the search results without the user's consent.  If they want to see your
> app's results, they can click on it, and pick one of the items there.  As
> they do so, your results will be promoted to the top-level list.
>
>
> On Tue, Sep 15, 2009 at 7:34 PM, Andrew Zhang wrote:
>
>> Hi guys,
>> Just downloaded donut sdk and played with global search, very cool, except
>> a small issue. I integrate my application with global search functionality,
>> but global search always shows "More results... xxx (n) " even if there is
>> only 1 result from my application. I've disabled all other applications so
>> that there is enough room for displaying the results of my application for
>> sure. Any hint when it shows result directly and when it shows "More
>> results..."? Thanks a lot for your help!
>>
>> --
>> Best regards,
>> Andrew Zhang
>>
>> http://zhanghuangzhu.blogspot.com/
>>
>>
>>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>
> >
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Global search always shows "More results... XXX (n)" for 3rd party application?

2009-09-15 Thread Andrew Zhang
Hi guys,
Just downloaded donut sdk and played with global search, very cool, except a
small issue. I integrate my application with global search functionality,
but global search always shows "More results... xxx (n) " even if there is
only 1 result from my application. I've disabled all other applications so
that there is enough room for displaying the results of my application for
sure. Any hint when it shows result directly and when it shows "More
results..."? Thanks a lot for your help!

-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Query GroupMembership cannot find contacts in a specific group

2009-08-13 Thread Andrew Zhang
On Thu, Jul 30, 2009 at 10:38 PM, ZHOU Peng  wrote:

> Hi all,
>
> I try to query contacts in a specific group by GroupMembership.
> But It only works fine with system built-in group "Starred in Android".
>
> My codes is like this:
> --
> private static String[] GRP_PROJECTION = new String[] {
> GroupMembership.PERSON_ID, GroupMembership.GROUP_ID };
> Cursor groupCursor = context.getContentResolver().
>   query(GroupMembership.CONTENT_URI, GRP_PROJECTION,
> "group_id=" + filterGroup_id, null, null);
> Log.d(TAG, "number = "+ getCount());
> ---
> If filterGroup_id is system built-in group id(Starred in Android), log.d()
> shows the number of contacts in group.
>
> But if filterGroup_id is my self-defined group id, log.d() shows the
> contacts of person in my defined group is always ZERO!!!
> Even there is actually some contacts in my defined group.
>
> Anybody know about this? is this a bug for SDK1.5 R2?


It looks like a "bug" to developers, but I think it works as design. Some
groups (synced with google server) may not have id in membership table. You
may look Contacts source code for more details.


> Thanks!
> --
> Best Wishes!
> Roger (Peng Zhou)
>
> >
>


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sqlite problem, urgent request!

2008-04-09 Thread Andrew Zhang
On Thu, Apr 10, 2008 at 1:44 AM, vinh2b <[EMAIL PROTECTED]> wrote:

>
> Hi,
> With m3-rc20a SDK version, I can use:
> SELECT * FROM myTable WHERE Name like '%abc%' LIMIT 1, 10
> But with m5-rc15 SDK verion, I can't use the same query.
> I try to use:
> String[] mArgs = new String[] {"'%" + txtSearch + "%'"};
> String mSelection = "Name like ?  LIMIT 1, 10";
> Cursor c = mConn.query("Data", null, mSelection, mArgs, null, null,
> null);
> Size of the c cursor always return 0 value.
> Help me to solve my problem please!


try db4o if  there's no  workaround for you ;)

>
>
> Thanks
>
> >
>


-- 
Best regards,
Andrew Zhang

db4o - database for Android: www.db4o.com
http://zhanghuangzhu.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---