hangup outgoing call programmatically - is this even possible?

by choon » Tue, 30 Mar 2010 03:09:13 GMT


Sponsored Links
 Hi,

I am new to Android. I would like to create an application that will
hang up an outgoing call after it has been ringing for several
seconds.

Based on what I have read in the discussions so far, we can abort a
call that has just been initiated by using setResultData(null) on the
BroadcastReceiver. This just means we can effectively censor calls
only. Not exactly what I am trying to achieve.

If the ability to abort a call after it has started ringing is not
supported by the SDK, what other means is there for me to achieve
this? Are there any internal functions that I can use?

Thank you in advance.

Kind regards,
choon

--



Other Threads

1. Help: Signing App!

Hi All,

I have some problem when signing app, i'm very new to things like public
key, private key, etc....

I try to build my project using ant, but always failed in signing part
(debug.keystore), when i try to build using 'ant release' command, it was
successfull but we still need jarsigner to sign our app.

Can anyone give some simple example from start to finish, the signing
process. I really appreciate that.

Thanks.

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

2. Null Pointer Exception while creating table

hi,
    I have implement this example. but i got an error.

    I have write the code just for create database, create table,
insert values in it.

    When I run application it displays nothing.

    But when i tried to open my database from command prompt Like:

    ls data/data/MyPackageNm

    Then it gives only a Lib folder rather than database and Lib both.

    So, i tried to found error via Log cat and put my code in try and
catch.

    I got an error while creating table.

    its gave Null Pointer exception.

    Please any one help me.

    My Log cat is like that and i have use this sample example as my
code.

    Thanks.

Log Cat:-

uid=10032 gids={}
09-29 15:36:09.727: DEBUG/dalvikvm(813): LinearAlloc 0x0 used 538516
of 4194304 (12%)
09-29 15:36:09.837: INFO/jdwp(822): received file descriptor 10 from
ADB
09-29 15:36:10.128: INFO/Niketa(822): database created
09-29 15:36:10.137: INFO/Niketa(822): database opened
09-29 15:36:10.137: INFO/Niketa(822): ------null
09-29 15:36:10.147: INFO/Niketa(822): +++++
+java.lang.NullPointerException
09-29 15:36:10.337: INFO/ActivityManager(52): Displayed activity
com.db/.DataBaseWork: 754 ms
09-29 15:36:15.507: DEBUG/dalvikvm(675): GC freed 44 objects / 1800
bytes in 151ms
09-29 15:36:15.507: DEBUG/dalvikvm(118): GC freed 3 objects / 72 bytes
in 143ms
09-29 15:36:15.527: DEBUG/dalvikvm(92): GC freed 1539 objects / 70560
bytes in


-----------------------------------------------------------------------------------------------------------------------------------------


My java code is:

package com.db;

//import java.io.FileNotFoundException;
import java.util.ArrayList;

import android.app.Activity;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;

public class DataBaseWork extends Activity {
        private final String MY_DATABASE_NAME = "LoginDB";
    private final String MY_DATABASE_TABLE = "Login1";
    private final String tag="Niketa";


    @Override
    public void onCreate(Bundle icicle) {
         super.onCreate(icicle);

         ArrayList<String> results = new ArrayList<String>();
         SQLiteDatabase myDB = null;
         try {

              /* Create the Database (no Errors if it already exists)
*/
              this.createDatabase(MY_DATABASE_NAME, 1, MODE_PRIVATE,
null);
              Log.i(tag,"database created");

              /* Open the DB and remember it */

              myDB = this.openDatabase(MY_DATABASE_NAME, null);
              Log.i(tag,"database opened ");

              /* Create a Table in the Database. */
              try
              {
              myDB.execSQL("CREATE TABLE IF NOT EXISTS "
                                  + "LoginDB.Login1"
                                  + " (UserNm TEXT, PassWd TEXT)"
                                  +";");
              Log.i(tag,"table created ");
              }
          /*    catch(SQLException e1)
              {
                  Log.i(tag,"SQL EXception"+e1);
              }*/


              catch(Exception e)
              {
                  Log.i(tag,"------"+e.getMessage());
                  Log.i(tag,"++++++"+e);
              }

            /*  catch(SQLiteException se)
              {
                  Log.i(tag,"SQLite Error--------"+se);
              }*/
              /* Add two DataSets to the Table. */
              myDB.execSQL("INSERT INTO "
                                  + MY_DATABASE_TABLE
                                  + " (UserNm, PassWd)"
                                  + " VALUES ('abc', 'def');");
              Log.i(tag,"value inserted ");


              /* Query for some results with Selection and Projection.
*/
              Cursor c = myDB.rawQuery("SELECT UserNm,PassWd" +
                                       " FROM " + MY_DATABASE_TABLE
                                       + ";",
                                       null);
              Log.i(tag,"value seleted ");

              /* Get the indices of the Columns we will need */
              int firstNameColumn = c.getColumnIndex("UserNm");
              int ageColumn = c.getColumnIndex("PassWd");

              /* Check if our result was valid. */
              if (c != null) {
                   /* Check if at least one Result was returned. */
                  if (c.isFirst()) {
                        int i = 0;

                        do {
                             i++;

                             String firstName =
c.getString(firstNameColumn);
                             int age = c.getInt(ageColumn);
                             String ageColumName =
c.getColumnName(ageColumn);

                             results.add("" + i + ": " + firstName
                                            + " (" + ageColumName + ":
" + age + ")");
                        } while (c!=null);
                   }
              }
         }
         catch (Exception e)
         {
                 Log.i(tag,"Error----->"+e);
         }
         finally
         {
              if (myDB != null)
                   myDB.close();
         }
         this.setListAdapter(new ArrayAdapter<String>(this,
                 android.R.layout.simple_list_item_1, results));
  }


        private void setListAdapter(ArrayAdapter<String> arrayAdapter)
        {
        }

        private SQLiteDatabase openDatabase(String my_database_name2, Object
object)
        {
                return null;
        }

        private void createDatabase(String my_database_name2, int i,
                        int modePrivate, Object object)
        {


        }
}

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

3. Customizing preferences editor

4. How to use mock location in sdk 1.0????

5. ocr for andrion??

6. Log Reading Problem in sdk 0.9

7. Phone Listner API in Android?