ACTION_CALL how to get the called time in Activity Result

by GPU » Fri, 20 Feb 2009 13:21:52 GMT


Sponsored Links
 Hi ,
 I want to get the last call time.I am starting the activity for
result like this

                       Intent intent = new Intent(Intent.ACTION_CALL);
                        intent.setData(Uri.parse("tel://988"));
                        startActivityForResult(intent, REQUEST_CODE);

After i end the call i am getting the  resultcode = RESULT_CANCELED

So How to get the call time after the call is ended

If its not by the activty resul directly,what is the contect Uri for
the call log?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. a plea for a market change!

The market app in 1.6 sure does look spiffy but you guys missed
something huge.  Please for the love of god add a filter by developer
type.  I know I am not the only person who is sick of developers like
M STAR LLC who spam the market daily with 20+ 'updates'   We all know
they haven't changed their code and only update the version number for
the purpose of getting moved up to the top of the list.  I am sick of
this crap, who agrees?
--~--~---------~--~----~------------~-------~--~----~

2. HttpConnection forWifi

Hi Friends....

I have written my HttpConnection code for Android.I have also set
Network preferences. Should I change the code so that it would be able
to work for Wifi?or I dont need any change.Does the same code work for
Wifi correctly?Here is my code:

public static String http_get(String urlParameters)
          {
                    String msg = "",uid = "";
                    int ch;


                    url = url + urlParameters ;

                    int BUFFER_SIZE = 2000;
                    InputStream in = null;
                    try {
                        in = OpenHttpConnection(url);
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();

                    }

                    try
                    {
                         InputStreamReader isr = new InputStreamReader
(in);
                         int charRead;
                           String str = "";
                           char[] inputBuffer = new char
[BUFFER_SIZE];
                         try {
                             while ((charRead = isr.read(inputBuffer))
                             {
                                 //---convert the chars to a String---
                                 String readString =
                                     String.copyValueOf(inputBuffer,
0, charRead);
                                 str += readString;
                                 inputBuffer = new char[BUFFER_SIZE];
                             }
                             in.close();
                         } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();

                         }
                         Log.i("Server",str);

                              if(str.indexOf("1_")!=-1)
                              {

                                    uid = str.substring(2);


                              }
                              else
                              {

                                 uid="0";

                              }


                    }
                    catch (Exception e)
                    {
                              msg = e.toString();
                    }
                    return uid;
          }

  public static String postData(String user,String file, String
Contents){

              // Create a new HttpClient and Post Header
              HttpClient httpclient = new DefaultHttpClient();
              HttpPost httppost = new HttpPost(url+file);
              String result="";

          try {
               // Add your data
               List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(1);
               Log.i("POSTDATA",user);
               nameValuePairs.add(new BasicNameValuePair("sID",
user));
               nameValuePairs.add(new BasicNameValuePair("content",
Contents));
               httppost.setEntity(new UrlEncodedFormEntity
(nameValuePairs));

               // Execute HTTP Post Request
               HttpResponse response = httpclient.execute(httppost);

               InputStream is = response.getEntity().getContent();
               BufferedInputStream bis = new BufferedInputStream(is);
               ByteArrayBuffer baf = new ByteArrayBuffer(20);

                int current = 0;
                while((current = bis.read()) != -1){
                    baf.append((byte)current);
                }
                  Log.d("GETANDPOST",new String(baf.toByteArray()));
                  result=new String(baf.toByteArray());
               /* Convert the Bytes read to a String. */
          //     text = new String(baf.toByteArray());
             //  tv.setText(text);

          } catch (ClientProtocolException e) {
               // TODO Auto-generated catch block
          } catch (IOException e) {
               // TODO Auto-generated catch block
          }
          return result;
     }

public String SetPreference() {
        ConnectivityManager
connMgr=(ConnectivityManager)getSystemService
(this.CONNECTIVITY_SERVICE);
        NetworkInfo info=connMgr.getActiveNetworkInfo();
        connMgr.setNetworkPreference(ConnectivityManager.TYPE_WIFI);
                   return (connMgr.getActiveNetworkInfo().getTypeName
());





}
--~--~---------~--~----~------------~-------~--~----~

3. How to compile a module to Android Dev Phone 1

4. How to connect through HttpConnection using WiFi for Android?

5. Setting Drawable/ClipDrawable level from XML

6. Free, OpenSource Android project for all: AnCal

7. Strange Exception