call flow, events, notifications

by Rob Shortt » Thu, 16 Apr 2009 00:56:14 GMT


Sponsored Links
 Hi all,

I'm looking for any documentation on the call flow including any
notifications and intents fired.  So far I haven't found much.  I have
some ideas for call related apps but need to know where I can hook
into the system.  For example I want to know whenever a call ends and
if I can get some data associated with the call (phone number,
length).  Hopefully there's something build in that I can use and not
do a hack with the call log.

Thanks for any tips,
-Rob

--~--~---------~--~----~------------~-------~--~----~



call flow, events, notifications

by Rob Shortt » Thu, 16 Apr 2009 00:56:36 GMT


 Hi all,

I'm looking for any documentation on the call flow including any
notifications and intents fired.  So far I haven't found much.  I have
some ideas for call related apps but need to know where I can hook
into the system.  For example I want to know whenever a call ends and
if I can get some data associated with the call (phone number,
length).  Hopefully there's something build in that I can use and not
do a hack with the call log.

Thanks for any tips,
-Rob

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


call flow, events, notifications

by jseghers » Thu, 16 Apr 2009 03:48:26 GMT


 


Look at android.telephony.PhoneStateListener

- John


--~--~---------~--~----~------------~-------~--~----~



call flow, events, notifications

by Rob Shortt » Thu, 16 Apr 2009 05:01:49 GMT


 Thanks, checking it out.

-Rob

--~--~---------~--~----~------------~-------~--~----~



call flow, events, notifications

by swarup » Thu, 16 Apr 2009 07:53:02 GMT


 check android.telephony.PhoneStateListener
onCallStateChanged(int state, String incomingNumber) might help you
partially.
but from above method, you can't get the length.





--~--~---------~--~----~------------~-------~--~----~



call flow, events, notifications

by Rob Shortt » Thu, 16 Apr 2009 08:07:02 GMT


 I have a feeling I'l have to use this listener then dig into the call log
but I'll have to be carefull of a race condition.  Either that or find some
way to watch the call log directly.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. SQLite DB, Cursors, CursorIndexOutOfBoundsException problems!! Help!

Hi all,

I just wrote my own DbAdapter by modifying the example DbAdapter in
Notepad tutorial. The problem came when I tried to fetch data from the
Database using my DbAdapter. I got :
"android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1." Below is a snippet of my code that I was trying to
play around with the DB:

                        //rep,index are both some random integers that
I'm trying to store in a row
                        ex_rowId = mDbHelper.createExSet(rep, index,
1);
                        if(D)   Log.d(TAG, "rowid that was used for insertion:
" + ex_rowId);

                        Cursor c = mDbHelper.fetchExRow(ex_rowId);
                        if(c == null)
                                Log.d(TAG, "HOLY-cursor null");
                        //a cursor's lifecycle is automatically taken care of
                        startManagingCursor(c);
                        int repIndex =
c.getColumnIndex(BtDbAdapter.KEY_EX_REP);
                        if(D)
                        {
                                Log.d(TAG,"HOLY-column rep index: "+repIndex);
                                Log.d(TAG,"HOLY_column count: 
"+c.getColumnCount()+
"row count: "+c.getCount());
                        }
                        int i=0;
                        for(;i<c.getColumnCount();i++)
                        {
                                Log.d(TAG,"Column names:
"+c.getColumnName(i).toString());
                        }

                        int repCount = c.getInt(repIndex);
                        if(D)   Log.d(TAG, "HOLY-rep count: "+repCount);


In summary, the code above first creates a new row, which stores some
values into a row. Then it fetches the same row by using the returned
row id. At last I am trying to retrieve the values from the cursor.
Below is the debug print log:


04-14 19:14:11.896: DEBUG/BluetoothChat(710): rowid that was used for
insertion: 3
04-14 19:14:11.906: DEBUG/BluetoothChat(710): HOLY-column rep index: 1
04-14 19:14:11.906: DEBUG/BluetoothChat(710): HOLY_column count: 4 row
count: 1

04-14 19:14:11.906: DEBUG/BluetoothChat(710): Column names: _id
04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names: repetition
04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names:
ex_timestamp
04-14 19:14:11.916: DEBUG/BluetoothChat(710): Column names: ex_unique

04-14 19:14:11.916: DEBUG/AndroidRuntime(710): Shutting down VM
04-14 19:14:11.916: WARN/dalvikvm(710): threadid=3: thread exiting
with uncaught exception (group=0x4001da28)
04-14 19:14:11.916: ERROR/AndroidRuntime(710): Uncaught handler:
thread main exiting due to uncaught exception
04-14 19:14:11.926: ERROR/AndroidRuntime(710):
android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:
172)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:
84)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
com.example.android.BluetoothChat.BluetoothChat
$1.handleMessage(BluetoothChat.java:325)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.os.Handler.dispatchMessage(Handler.java:99)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.os.Looper.loop(Looper.java:123)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
java.lang.reflect.Method.invokeNative(Native Method)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
java.lang.reflect.Method.invoke(Method.java:521)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
04-14 19:14:11.926: ERROR/AndroidRuntime(710):     at
dalvik.system.NativeStart.main(Native Method)
04-14 19:14:11.936: INFO/Process(76): Sending signal. PID: 710 SIG: 3
04-14 19:14:11.936: INFO/dalvikvm(710): threadid=7: reacting to signal
3
04-14 19:14:11.966: INFO/dalvikvm(710): Wrote stack trace to '/data/
anr/traces.txt'
04-14 19:14:15.696: DEBUG/dalvikvm(370): GC freed 43 objects / 2112
bytes in 94ms
04-14 19:14:20.766: DEBUG/dalvikvm(150): GC freed 4543 objects /
253432 bytes in 161ms
04-14 19:14:24.676: INFO/Process(710): Sending signal. PID: 710 SIG: 9
04-14 19:14:24.706: ERROR/JavaBinder(76): !!! FAILED BINDER
TRANSACTION !!!

As anyone can see, the row count is 1 !!!!! Therefore I am not exactly
sure what the bug is. Part of my DB code is also shown below:


        public static final String KEY_EX_ROWID = "_id";
        public static final String KEY_EX_REP = "repetition";
        public static final String KEY_EX_TIMESTAMP = "ex_timestamp";
        //this identifies the particular set of exercise the user was doing
        public static final String KEY_EX_UNIQUE_ID = "ex_unique";

        private static final String DATABASE_CREATE_EX =
            "create table exsetTable (_id integer primary key
autoincrement, "
            + "repetition integer not null, ex_timestamp integer not
null, ex_unique integer not null);";
        private static final String DATABASE_TABLE_EXSET =
"exsetTable";
        @Override
        public void onCreate(SQLiteDatabase db) {
                //create tables-exec can only take one query at a time.
Creating 2 different tables

            db.execSQL(DATABASE_CREATE_EX);
            db.execSQL(DATABASE_CREATE_HR);
            Log.d(TAG,"DB CREATION DONE");
        }
    public long createExSet(int rep, int timestamp, int ex_uniqueId) {
        ContentValues initialValues = new ContentValues();
        initialValues.put(KEY_EX_REP, rep);
        initialValues.put(KEY_EX_TIMESTAMP, timestamp);
        initialValues.put(KEY_EX_UNIQUE_ID, ex_uniqueId);

        return mDb.insert(DATABASE_TABLE_EXSET, null, initialValues);
    }
    public Cursor fetchExRow(long ex_rowId) {
        Cursor mCursor = mDb.query(DATABASE_TABLE_EXSET,
                        new String[]
{KEY_EX_ROWID,KEY_EX_REP,KEY_EX_TIMESTAMP,KEY_EX_UNIQUE_ID},
                        KEY_EX_ROWID + "=" + ex_rowId, null, null, null, null);
        return mCursor;
    }

I am not sure if the cursor returned from fetchExRow is valid. Would
it still give me row count 1 if it's invalid(empty)? The bug is either
in the way I am trying to retrieve data using getInt or my
databaseadapter's code. Is there a way to view the databases and
tables I created using some tools?
Thank you so much!

-- 

2. Android time synchronization?

Hi all.  I am working on developing an application which requires
high precision time synchronization between handsets.  I'm looking for
under 100 microseconds of skew between phones.  I wondered if anyone
had tried this before.  In theory the GPS receivers could be used to
pretty accurately synchronize timing, but I'm not sure if Android is
setup to use them that way.  My first cut plan is to port a PTP
(precision time protocol aka IEEE-1588) client to Android.

  Anyone have comments/suggestions?  If anyone has tried something
like this before I'd love to hear about it.  Thanks!


James

-- 

3. How to use the lib(.jar) which android sdk didn't contain

4. DRM & RTC control

5. Orientation changes and layout

6. Menu button unlocks the phone

7. Device Seeding Program for Top Android Market Developers