Example usage for android.util Log v

List of usage examples for android.util Log v

Introduction

In this page you can find the example usage for android.util Log v.

Prototype

public static int v(String tag, String msg) 

Source Link

Document

Send a #VERBOSE log message.

Usage

From source file:com.sonymobile.android.media.internal.VUParser.java

public VUParser(DataSource source) {
    super(source);
    if (LOGS_ENABLED)
        Log.v(TAG, "create VUParser from source");
}

From source file:jp.mixi.android.sdk.MixiDialog.java

private WebView setUpWebView(WebView webView) {
    Log.v(TAG, "setwebview");
    webView.getSettings().setUserAgentString(Constants.USER_AGENT);
    webView.setVerticalScrollBarEnabled(false);
    webView.setHorizontalScrollBarEnabled(false);
    webView.setWebViewClient(new MixiWebviewClient());

    webView.getSettings().setJavaScriptEnabled(true);
    webView.addJavascriptInterface(new JsHandler(), "mixi");

    String token = mParams.get("oauth_token");
    int sdkInt = Integer.valueOf(Build.VERSION.SDK);
    // android2.1
    if (sdkInt < Constants.SUPPORTED_SDK_VERSION) {
        Uri uri = Uri.parse(mUrl);/*from w  ww  .  j  ava2s . co  m*/
        if (token != null) {
            Builder builder = uri.buildUpon();
            builder.appendQueryParameter("oauth_token", token);
            uri = builder.build();
        }
        webView.loadUrl(uri.toString());
    } else {
        HashMap<String, String> extraHeaders = new HashMap<String, String>();
        if (token != null) {
            extraHeaders.put("Authorization", "OAuth " + token);
        }
        webView.loadUrl(mUrl, extraHeaders);
    }

    return webView;
}

From source file:edu.umich.flowfence.service.SandboxManager.java

private static void dumpSandbox(Sandbox sb, BitSet seen) {
    int id = sb.getID();
    String result = String.format("    %s %s package=%s", sb, sb.getTaints(), sb.getAssignedPackage());
    if (seen == null) {
        Log.w(TAG, result + " [LEAKED]");
    } else if (seen.get(id)) {
        Log.w(TAG, result + " [DUPLICATE]");
    } else {//from  w  w w . j  a  va 2 s.c  o m
        Log.v(TAG, result);
        seen.set(id);
    }
}

From source file:com.etime.LoginAsyncTask.java

/**
 * Sign on to the ADP eTime site. Return true if signon was successful, false otherwise. Sign on is done through
 * hitting a series of ADP pages with basic authentication set. Sets the progress bar on the main page.
 * @return  true if signon was successful, false otherwise.
 *//*ww  w.  j a  va 2 s . c  o m*/
public boolean signon() {
    String page;
    myProgress = 0;

    publishProgress(10);
    step = 0;
    int i = 0;
    Log.v(TAG, "log in start");
    do {
        if (i >= 3) {
            return false;
        }
        i++;

        page = ETimeUtils.getHtmlPageWithProgress(httpClient, LOGIN_URL, this, 10, 30, LOGIN_URL_PAGE_SIZE);
        Log.v(TAG, "page = " + page);
        if (page == null)
            Log.v(TAG, "Login attemp failed. Retrying...");

    } while (page == null);

    if (page.contains(LOGIN_FAILED)) {
        return false;
    }

    step++;
    page = ETimeUtils.getHtmlPageWithProgress(httpClient, LOGIN_URL_STEP2, this, 30, 50, LOGIN_URL2_PAGE_SIZE);
    Log.v(TAG, "page = " + page);
    if (page == null || page.contains(LOGIN_FAILED)) {
        return false;
    }

    step++;
    if (page.equals("/wfc/applications/suitenav/navigation.do?ESS=true")) {
        return true; //already logged in
    }

    step++;
    page = ETimeUtils.getHtmlPageWithProgress(httpClient, page, this, 50, 80, LOGIN_URL_PAGE_SIZE);
    Log.v(TAG, "page = " + page);
    if (page == null || page.contains(LOGIN_FAILED)) {
        return false;
    }

    step++;
    page = ETimeUtils.getHtmlPageWithProgress(httpClient, page, this, 80, 100, LOGIN_URL_PAGE_SIZE);
    Log.v(TAG, "page = " + page);
    if (page == null || page.contains(LOGIN_FAILED)) {
        return false;
    }
    step++;
    Log.v(TAG, "log in end");
    return true;
}

From source file:com.example.fypv2.dataprocessor.OsmDataProcessor.java

@Override
public List<Marker> load(String rawData, int taskId, int colour) throws JSONException {
    Element root = convertToXmlDocument(rawData).getDocumentElement();

    List<Marker> markers = new ArrayList<Marker>();
    NodeList nodes = root.getElementsByTagName("node");

    for (int i = 0; i < nodes.getLength(); i++) {
        Node node = nodes.item(i);
        NamedNodeMap att = node.getAttributes();
        NodeList tags = node.getChildNodes();
        for (int j = 0; j < tags.getLength(); j++) {
            Node tag = tags.item(j);
            if (tag.getNodeType() != Node.TEXT_NODE) {
                String key = tag.getAttributes().getNamedItem("k").getNodeValue();
                if (key.equals("name")) {

                    String name = tag.getAttributes().getNamedItem("v").getNodeValue();
                    String id = att.getNamedItem("id").getNodeValue();
                    double lat = Double.valueOf(att.getNamedItem("lat").getNodeValue());
                    double lon = Double.valueOf(att.getNamedItem("lon").getNodeValue());

                    Log.v(MainFrame.TAG, "OSM Node: " + name + " lat " + lat + " lon " + lon + "\n");

                    Marker ma = new NavigationMarker(id, name, lat, lon, 0,
                            "http://www.openstreetmap.org/?node=" + id, taskId, colour);
                    markers.add(ma);//from w  ww  .  j  a  v a2  s . co  m

                    // skip to next node
                    continue;
                }
            }
        }
    }
    return markers;
}

From source file:com.mobiquitynetworks.cordova.mnnotifications.NotificationsManager.java

private void startMonitoring(JSONArray data, CallbackContext callbackContext) {
    Log.v(TAG, "CONFIG START");

    final Context c = this.cordova.getActivity().getApplicationContext();
    Properties p = readSDKProperties(c);

    //gets configuration

    String sConfig;/* w  w w  . j  a v  a2s .c om*/
    sConfig = "\nMobiquity Networks ProximityService configuration:\n"
            + "_________________________________________________________________\n" + "app key:\t\t"
            + p.getProperty("mobiquity.apm.appkey") + "\n" + "license:\t\t"
            + p.getProperty("mobiquity.apm.secret") + "\n" + "monitoring on period:\t"
            + p.getProperty("mobiquity.apm.monitoring.on_period") + "\n" + "monitoring off period:\t"
            + p.getProperty("mobiquity.apm.monitoring.off_period") + "\n" + "use idfa:\t\t"
            + p.getProperty("mobiquity.apm.stats.use_idfa_when_possible") + "\n" + "Endpoint:\t\t"
            + p.getProperty("mobiquity.apm.network.endpoint") + "\n" + "debug:\t\t"
            + p.getProperty("mobiquity.apm.debug") + "\n"
            + "_________________________________________________________________";
    Log.v(TAG, sConfig);
    Log.v(TAG, "CONFIG STOP");

    //data: [
    // {"tags": ["development","software"],
    //  "gender":"M","birthday":"1986-11-20","username":"matt@aimatt.com","language":"English","kids":2,"maritalStatus":"married"
    // },
    // {"battery":0.2}]

    Log.v(TAG, "data: " + data.toString());

    if (data.length() > 0) {
        try {

            JSONObject user = (JSONObject) data.get(0);
            Log.v(TAG, "user: " + user.toString());

            TrackingUser.Builder userBuilder = new TrackingUser.Builder();
            userBuilder.role(TrackingUser.Role.PRODUSER);
            TrackingAudience.Builder audienceBuilder = new TrackingAudience.Builder();

            // Username
            if (user.getString("username") != null) {
                userBuilder.username(user.getString("username"));
            }

            // Gender
            String gender = user.getString("gender");

            if (gender.equals("M")) {
                audienceBuilder.gender(TrackingAudience.Gender.MALE);
            } else if (gender.equals("F")) {
                audienceBuilder.gender(TrackingAudience.Gender.FEMALE);
            }

            // Marital Status
            String maritalStatus = user.getString("maritalStatus");

            if (maritalStatus.equals("married")) {
                audienceBuilder.maritalStatus(TrackingAudience.MaritalStatus.MARRIED);
            } else if (maritalStatus.equals("single")) {
                audienceBuilder.maritalStatus(TrackingAudience.MaritalStatus.SINGLE);
            }

            // Kids
            audienceBuilder.kids(user.getInt("kids"));

            // Tags
            JSONArray tagsJson = user.getJSONArray("tags");
            if (tagsJson != null) {
                ArrayList<String> tags = new ArrayList<String>();

                int len = tagsJson.length();
                for (int i = 0; i < len; i++) {
                    tags.add(tagsJson.get(i).toString());
                }

                audienceBuilder.tags(new HashSet<String>(tags));
            }

            // Education
            String education = user.getString("education");

            if (education.equals("CLL")) {
                audienceBuilder.education(TrackingAudience.Education.COLLEGE);
            } else if (education.equals("GS")) {
                audienceBuilder.education(TrackingAudience.Education.GRAD_SCHOOL);
            } else if (education.equals("NCLL")) {
                audienceBuilder.education(TrackingAudience.Education.NON_COLLEGE);
            }

            // Ethnicity
            String ethnicity = user.getString("ethnicity");

            if (ethnicity.equals("AA")) {
                audienceBuilder.ethnicity(TrackingAudience.Ethnicity.AFRICAN_AMERICAN);
            } else if (ethnicity.equals("AS")) {
                audienceBuilder.ethnicity(TrackingAudience.Ethnicity.ASIAN);
            } else if (ethnicity.equals("CC")) {
                audienceBuilder.ethnicity(TrackingAudience.Ethnicity.CAUSASIAN);
            } else if (ethnicity.equals("HP")) {
                audienceBuilder.ethnicity(TrackingAudience.Ethnicity.HISPANIC);
            }

            // TODO: Language

            userBuilder.audience(audienceBuilder.build());
            final TrackingUser trackingUser = userBuilder.build();

            cordova.getThreadPool().execute(new Runnable() {
                public void run() {
                    ProximityManager.getInstance().setTrackingUserInformation(trackingUser);
                    ProximityManager.getInstance().startService(c);
                }
            });

            // TODO: Custom Vars
            //                HashMap<String, String> trackingCustomVars = new HashMap<String, String>();
            //                trackingCustomVars.put("custom1", "foo");
            //                trackingCustomVars.put("custom2", "bar");
            //                ProximityManager.setTrackingCustomVars(trackingCustomVars);

            String message = "startMonitoring success";
            PluginResult result = new PluginResult(PluginResult.Status.OK, message.toString());
            result.setKeepCallback(true);
            callbackContext.sendPluginResult(result);

        } catch (JSONException e) {
            Log.e(TAG, "Exception parsing JSON", e);
        }
    }

}

From source file:com.klinker.android.twitter.utils.api_helper.TweetMarkerHelper.java

public boolean sendCurrentId(String collection, long id) {
    try {/*from   w w  w .j a  va2s  . c  o m*/
        HttpPost post = new HttpPost(postURL);
        post.addHeader("X-Auth-Service-Provider", SERVICE_PROVIDER);
        post.addHeader("X-Verify-Credentials-Authorization", getAuthrityHeader(twitter));

        JSONObject json = new JSONObject();
        json.put("id", id);
        JSONObject base = new JSONObject();
        base.put(collection, json);

        Log.v("talon_tweetmarker", "sending " + id + " to " + screenname);

        post.setEntity(new ByteArrayEntity(base.toString().getBytes("UTF8")));
        DefaultHttpClient client = new DefaultHttpClient();

        HttpResponse response = client.execute(post);
        int responseCode = response.getStatusLine().getStatusCode();
        Log.v("talon_tweetmarker", "sending response code: " + responseCode);

        if (responseCode != 200) { // there was an error, we will retry once
            // wait first
            try {
                Thread.sleep(1500);
            } catch (InterruptedException e) {

            }

            response = client.execute(post);
            responseCode = response.getStatusLine().getStatusCode();
            Log.v("talon_tweetmarker", "sending response code: " + responseCode);

            if (responseCode == 200) {
                // success, return true
                int currentVersion = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);
                sharedPrefs.edit().putInt("last_version_account_" + currentAccount, currentVersion + 1)
                        .commit();
                return true;
            }

        } else {
            int currentVersion = sharedPrefs.getInt("last_version_account_" + currentAccount, 0);
            sharedPrefs.edit().putInt("last_version_account_" + currentAccount, currentVersion + 1).commit();
            return true;
        }

    } catch (Exception e) {
        e.printStackTrace();
    }

    return false;
}

From source file:com.klinker.android.spotify.fragment.BaseOAuthFragment.java

/**
 * Process information encoded in URL once a page has finished loading to see if we are done
 *//*from   www .ja v  a2 s. c o  m*/
protected boolean processPageFinished(String url, boolean authComplete) {
    if (url.contains("?code=") && !authComplete) {
        Uri uri = Uri.parse(url);
        String authCode = uri.getQueryParameter("code");
        Log.v(TAG, "auth code: " + authCode);
        getTokenAsyncTask(authCode).execute();
        authComplete = true;
    } else if (url.contains("error=access_denied")) {
        Log.v(TAG, "ACCESS_DENIED_HERE");
        Toast.makeText(getActivity(), getString(R.string.auth_failed), Toast.LENGTH_SHORT).show();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                getActivity().finish();
            }
        }, 500);
        authComplete = true;
    }

    return authComplete;
}

From source file:com.twotoasters.android.hoot.HootResult.java

void deserializeResult(HootGlobalDeserializer globalDeserializer, Class<?> expectedType) throws IOException {
    Log.v(TAG, globalDeserializer == null ? (mDeserializer == null ? "No deserializer" : "Request deserializer")
            : "Global deserializer");
    // see if we need to read out to a string. Either we have no
    // deserializer or we do and it operates on a string.
    if (mDeserializer == null && globalDeserializer == null
            || (mDeserializer != null && !mDeserializer.isStreamDeserializer())
            || (mDeserializer == null && globalDeserializer != null && expectedType != null
                    && !globalDeserializer.isStreamDeserializer())) {
        setResponse(convertStreamToString(getResponseStream()));
    }//from   w w  w.java  2s . c  o m

    if (mDeserializer != null) {
        if (mDeserializer.isStreamDeserializer()) {
            mDeserializedResult = mDeserializer.performDeserialize(getResponseStream());
        } else {
            mDeserializedResult = mDeserializer.performDeserialize(getResponseString());
        }
    } else if (globalDeserializer != null && expectedType != null) {
        if (globalDeserializer.isStreamDeserializer()) {
            mDeserializedResult = globalDeserializer.performDeserialize(getResponseStream(), expectedType);
        } else {
            mDeserializedResult = globalDeserializer.performDeserialize(getResponseString(), expectedType);
        }
    }

}

From source file:com.example.run_tracker.MyRunsFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    Log.v(TAG, "onSaveInstanceState");

    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList("tracklist", (ArrayList<? extends Parcelable>) mTracks);
    // Save the fragment's state here
}