install apk files programatically

by honey » Tue, 21 Sep 2010 18:39:30 GMT


Sponsored Links
 Hello i have built vista shell for the android phone. now i want to
install the apk programatically.and add their relevant icons to the
start menu and the desktop of my  activity:any ideass???????? if some
one has done some work on it.

--



Other Threads

1. Need Samsung Moment user to help troubleshoot problems

what game is this ? can you give the class name of your app for me to search

-Dan





> 

2. spreadsheets.google.com using raw http/xml

It looks like my example refuses to work with spreadsheets.google.com list
worksheet feed.

Here is the code snippet
authenticate() succeeds and I get the proper auth token.
However getWorksheetContents() fails with 404 Not found error.

I have double check the URL (worksheetsheetURL) using curl (it works fine on
curl), I have checked the tcpdump of both curl and my sample program -
nothing seems out of the place - but i am at loss to understand, why I am
getting 404 error.

Any Gdata gurus here who can help?? I am using this raw approach since there
is no gdata apis for android yet.

public void authenticate() {
        HttpClient hClient = new DefaultHttpClient();
        HttpPost hPost = new HttpPost("
https://www.google.com/accounts/ClientLogin");

        List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(5);
        nameValuePairs.add(new BasicNameValuePair("Email","
xxxxxx...@gmail.com"));
        nameValuePairs.add(new BasicNameValuePair("Passwd","xxxxxx"));
        nameValuePairs.add(new BasicNameValuePair("accountType","GOOGLE"));
        nameValuePairs.add(new BasicNameValuePair("source","ExampleTest"));
        nameValuePairs.add(new BasicNameValuePair("service","wise"));
        try {
            hPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

            HttpResponse response = hClient.execute(hPost);

            int status = response.getStatusLine().getStatusCode();
            if(status == HttpStatus.SC_OK) {
                String temp = EntityUtils.toString(response.getEntity());
                authToken=getAuthString(temp);
            }

        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    public void getWorksheetContents() {
        HttpClient hClient = new DefaultHttpClient();
        HttpResponse response;

        HttpGet hGet = new HttpGet(worksheetsheetURL);
        hGet.addHeader("Authorization","GoogleLogin auth="+authToken);


        try {
            response = hClient.execute(hGet);

            int status = response.getStatusLine().getStatusCode();
            Log.d(TAG,"getWorksheetContents : "+response.getStatusLine());
            if(status == HttpStatus.SC_OK) {
                String temp = EntityUtils.toString(response.getEntity());
                Log.d(TAG, "getWorksheetContents"+temp);
            }
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public String getAuthString(String content) {
        int index=content.indexOf("Auth=");
        Log.d(TAG, "index = "+index);
        return content.substring(index+5);
    }

-Dan

-- 

3. Google Buzz 'breaks' privacy law

4. Sony Ericsson CEO: Google asked us to build the Nexus One, we refused

5. Can't show ProgressDialog during listview update

6. Can't show ProgressDialog during listview update

7. Restarting a MediaPlayer