How to get reference of (SQLiteDatabase) to use android contact database

by Bassel Kh » Wed, 17 Feb 2010 05:12:32 GMT


Sponsored Links
 Hello guys,
I'm new to Android technology, so I need your help please.

I'm familiar with SQL quires, so I need to use
(SQLiteDatabase.rawQuery) in order to query (android contact
database), but the question is:

How to get reference to (SQLiteDatabase) in order to deal with android
contacts database (ready made DB from another application) ?
 I passed "\data\date\com.android.contacts\contacts" and didn't work

In case of private database created by my application; it is easy to
do that, but in case of ready made applications like
(contacts,SMS,call logs) what should I pass to the following method as
path?

SQLiteDatabase.openDatabase(path, factory, flags)


And if I give permission to read the database; will it work?


Thanks

--



Other Threads

1. destruction and creation of android activity happens TWICE upon changing the screen orientation

*Scenario 1 - NORMAL*
*###################### application activity started 
###########################*
03-31 17:52:18.413: INFO/System.out(589): onCreate()
03-31 17:52:18.974: INFO/System.out(589): onWindowFocusChanged() -> 
hasFocus:true
03-31 17:52:18.974: INFO/System.out(589): mySoundPlaybackMethods()
*########## back button pressed to remove activity from the task 
###############*
03-31 17:54:54.113: INFO/System.out(589): onWindowFocusChanged() -> 
hasFocus:false
03-31 17:54:54.514: INFO/System.out(589): onDestroy()
*###################### application activity finished 
##########################*


*Scenario 2 - ABNORMAL*
*######################## application activity started 
##########################*
03-31 17:52:18.413: INFO/System.out(589): onCreate()
03-31 17:52:18.974: INFO/System.out(589): onWindowFocusChanged() -> 
hasFocus:true
03-31 17:52:18.974: INFO/System.out(589): mySoundPlaybackMethods()
*########################### screen orientation changed 
#########################*
03-31 17:52:38.393: INFO/System.out(589): onSaveInstanceState() -> state 
saved
03-31 17:52:38.403: INFO/System.out(589): onDestroy()
03-31 17:52:38.514: INFO/System.out(589): onCreate()
03-31 17:52:39.464: INFO/System.out(589): onRestoreInstanceState() -> state 
restored from old bundle
*
---------------------------------------------------------------------------------------------------------------
*
*?????? in the following output, why should the same steps of 
destruction/creation of activity happen ONCE AGAIN ??????*
*
---------------------------------------------------------------------------------------------------------------
*
03-31 17:52:39.504: INFO/System.out(589): onSaveInstanceState() -> state 
saved
03-31 17:52:39.504: INFO/System.out(589): onDestroy()
03-31 17:52:39.524: INFO/System.out(589): onCreate()
03-31 17:52:40.024: INFO/System.out(589): onRestoreInstanceState -> state 
restored from old bundle
03-31 17:52:40.104: INFO/System.out(589): onWindowFocusChanged() -> 
hasFocus:true
*
---------------------------------------------------------------------------------------------------------------
*
*???? the last call to onWindowFocusChanged() occured with hasFocus=TRUE; *
*???? this call to to onWindowFocusChanged() also occured with 
hasFocus=TRUE;*
*???? when did the windowFocus even change to FALSE?*
*
---------------------------------------------------------------------------------------------------------------
*
03-31 17:52:40.104: INFO/System.out(589): mySoundPlaybackMethods()
*############## back button pressed to remove activity from the task 
################*
03-31 17:54:54.113: INFO/System.out(589): onWindowFocusChanged() -> 
hasFocus:false
03-31 17:54:54.514: INFO/System.out(589): onDestroy()
*######################### application activity finished 
############################*

-- 

2. galaxy S II

eh, galaxy S II udah dijual belum sih ? ada temen disini yang tertarik
mau beli ..

-- 
--
Best Regards
Arianto C Nugroho
http://id.linkedin.com/in/ariantonugroho
YM-i : arianto.nugroho
skype-id : nugroho.arianto
(+254) 728 002 390
(+62) 817 9050 530

-- 
===============

3. Help.. Market Xperia X10 ilang setelah install app2sd

4. Sony Ericsson EDK for Timescape

5. Time.class in Android an locales...

6. What exactly is the obtainBuffer in an AudioTrack?

7. Is there any porting guide?