Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Basic Http Authentication

Posted on by Kim


    public void sovGodt() throws ClientProtocolException, IOException, AuthenticationException {
        Log.d(TAG, "sovGodt...");
        // Instantiate the custom HttpClient
        HttpGet get = new HttpGet(UURRL);

        get.setHeader("Content-type", "application/json");
        get.setHeader("Accept", "application/json");
        get.setHeader("X-Requested-With", "json");

        // String source = "Erna:Erna";
        // String ret = "Basic " + Base64.encodeToString(source.getBytes(), Base64.URL_SAFE | Base64.NO_WRAP);
        // get.setHeader("Authorization", ret);

        UsernamePasswordCredentials creds = new UsernamePasswordCredentials("Erna", "Erna");
        // get.setHeader(new BasicScheme().authenticate(creds, get));
        get.setHeader(BasicScheme.authenticate(creds, "UTF-8", false));

        // String x = "Erna:Erna";
        // String encoding = Base64.encode(x.getBytes(), Base64.DEFAULT).toString();
        // get.setHeader("Authorization", "Basic " + encoding);

        // CredentialsProvider credProvider = new BasicCredentialsProvider();
        // credProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
        // new UsernamePasswordCredentials("Erna", "Erna"));
        // client.setCredentialsProvider(credProvider);

        // client.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
        // new UsernamePasswordCredentials("Erna", "Erna"));

        // Execute the GET call and obtain the response
        Long s1 = System.currentTimeMillis();
        HttpResponse getResponse = client.execute(get);
        Log.d(TAG, "Time..:" + (System.currentTimeMillis() - s1) + " ms");
        HttpEntity entity = getResponse.getEntity();
        InputStream is = entity.getContent();
        Log.d(TAG, "response...:" + convertStreamToString(is));
    }

Boot Samsung Galaxy Tab 10.1 in recovery mode

Posted on by Kim


power - vol down - vol up

Reboot your tablet into recovery mode, as follows:
  1. Hold 'vol down' and 'power' buttons on tablet
  2. Release 'power' when samsung image is shown
  3. Release 'vol down' when the two icons are shown
  4. Use the 'vol down' to navigate between the icons
  5. Highlight the left icon (box)
  6. Press the 'vol up' to select it and boot into recovery mode

Android Compatibility JAR not found

Posted on by Kim


cd [eclipse install dir]/Eclipse.app/Contents/MacOS/
ln -s [android sdk install dir]/extras/android/support/v4
ln -s [android sdk install dir]/extras/android/support/v13

First app on market

Posted on by Kim

I got my first app on the market today :)

https://market.android.com/details?id=dk.zeed.names