com.android.phone.InCallScreen activity

by Ruben » Fri, 03 Apr 2009 00:16:22 GMT


Sponsored Links
 Is it possible to intercept the intent of calling and answering and by
doing that replacing the calling/answering screen. I see from the
logcat that right now com.android.phone.InCallScreen activity is been
started. Anyway to overwrite that to have my own activity to show up?

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



com.android.phone.InCallScreen activity

by Ruben » Fri, 03 Apr 2009 00:16:35 GMT


 Is it possible to intercept the intent of calling and answering and by
doing that replacing the calling/answering screen. I see from the
logcat that right now com.android.phone.InCallScreen activity is been
started. Anyway to overwrite that to have my own activity to show up?

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


Sponsored Links


Other Threads

1. How to unsign the signed apk file?

HI All,
I want to know How to unsign the signed apk file?
Please help.
Thnkx

-- 

2. SSLContext.getInstance("SSL") throws java.security.NosuchAlgorithmException: SSLContext SSL implementation not found

Hi list,

i want to implement a client for https, all in my localhost (in my apache,
it is configured to ask authentication), with a resource "
https://localhost:443/resources/resource1.xml"
the server works fine.

I have a client for desktop, and it works fine, the resources are consumed
using httpcomponents-client-4.0.3), i have readed that Android uses that
version.

This is the code of my client in Android (practically is the same of desktop
mapped to android) ,

in the line of   SSLContext sc = SSLContext.getInstance("TSL"); the next
exception is thrown :

java.security.NosuchAlgorithmException: SSLContext SSL implementation not
found

Please does anybody know how to solve this issue?

i have tried with TSL and the exception continue.

import java.io.IOException;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class androidNativeRest extends Activity {


    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        TextView tv = new TextView(this);

        String res="nada";

        DefaultHttpClient httpclient = new DefaultHttpClient();

        httpclient.getCredentialsProvider().setCredentials(
                new AuthScope("10.0.2.2", 443),
                new UsernamePasswordCredentials("user", "pass"));

        BasicHttpContext localcontext = new BasicHttpContext();

        // Generate BASIC scheme object and stick it to the local
        // execution context
        BasicScheme basicAuth = new BasicScheme();
        localcontext.setAttribute("preemptive-auth", basicAuth);

        // Add as the first request interceptor
        httpclient.addRequestInterceptor(new PreemptiveAuth(), 0);

        HttpHost targetHost = new HttpHost("10.0.2.2", 443, "https");

        HttpGet httpget = new HttpGet("/resources/resource1.xml");

        res+="executing request: " + httpget.getRequestLine()+"/ln";
        res+="to target: " + targetHost+"/ln";
        //----------------------TRUST MANAGER---------------------------
        //Create a trust manager that does not validate certificate chains
        TrustManager[] trustAllCerts = new TrustManager[]{
                new X509TrustManager() {
                    public java.security.cert.X509Certificate[]
getAcceptedIssuers() {
                        return null;
                    }
                    public void checkClientTrusted(
                        java.security.cert.X509Certificate[] certs, String
authType) {
                    }
                    public void checkServerTrusted(
                        java.security.cert.X509Certificate[] certs, String
authType) {
                    }
                }
            };
        //install trust manager
        try {

            SSLContext sc = SSLContext.getInstance("TSL");

            sc.init(null, trustAllCerts, new java.security.SecureRandom());


HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        } catch (Exception e) {
            res+="error en trustmanage"+e.toString()+" /ln";
        }
        //now we can access an https URL without having the certificate in
the truststore
        //----------------------------FINISH TRUST MANAGER
INSTALLATION---------

         for (int i = 0; i < 3; i++) {
                try{
                HttpResponse response = httpclient.execute(targetHost,
httpget, localcontext);
                HttpEntity entity = response.getEntity();

                res+="---------------------------------------- /ln";
                res+=response.getStatusLine()+"/ln";
                if (entity != null) {
                    res+="Response content length: " +
entity.getContentLength()+"/ln";
                    res+=EntityUtils.toString(entity)+"/ln";
                    res = EntityUtils.toString(entity);
                    entity.consumeContent();

                }
                }catch(Exception e1){
                    res+="errores che";
                }

            }


        httpclient.getConnectionManager().shutdown();

       tv.setText(res);

       setContentView(tv);

    }
    static class PreemptiveAuth implements HttpRequestInterceptor {

        public void process(
                final HttpRequest request,
                final HttpContext context) throws HttpException, IOException
{

            AuthState authState = (AuthState) context.getAttribute(
                    ClientContext.TARGET_AUTH_STATE);

            // If no auth scheme avaialble yet, try to initialize it
preemptively
            if (authState.getAuthScheme() == null) {
                AuthScheme authScheme = (AuthScheme) context.getAttribute(
                        "preemptive-auth");
                CredentialsProvider credsProvider = (CredentialsProvider)
context.getAttribute(
                        ClientContext.CREDS_PROVIDER);
                HttpHost targetHost = (HttpHost) context.getAttribute(
                        ExecutionContext.HTTP_TARGET_HOST);

                if (authScheme != null) {
                    Credentials creds = credsProvider.getCredentials(
                            new AuthScope(
                                    targetHost.getHostName(),
                                    targetHost.getPort()));
                    if (creds == null) {
                        throw new HttpException("No credentials for
preemptive authentication");
                    }
                    authState.setAuthScheme(authScheme);
                    authState.setCredentials(creds);
                }
            }

        }

    }

}

thanks for the answers.

-- 

3. best reasonable practice for locally storing a password?

4. Version Restriction for Market Update

5. Intent is not sending the id of the suggestion to content provider

6. Programmatically loading kernel module

7. Registering Sync Service Programmatically