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.klinker.android.spotify.fragment.BaseOAuthFragment.java

/**
 * Set up the webview client that information should be displayed in
 *///from  w  w  w. ja  v  a  2 s . com
public WebViewClient getWebViewClient() {
    return new WebViewClient() {
        private boolean authComplete = false;

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            Log.v(TAG, "callback url: " + url);
            if (shouldRedirect(url)) {
                view.stopLoading();
                authComplete = processPageFinished(url, authComplete);
            }
        }
    };
}

From source file:com.pushnotificationsapp.app.GcmIntentService.java

@Override
protected void onHandleIntent(Intent intent) {
    Bundle extras = intent.getExtras();// w  ww .  ja v  a 2  s  . c  o  m
    GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
    // The getMessageType() intent parameter must be the intent you received
    // in your BroadcastReceiver.
    String messageType = gcm.getMessageType(intent);

    if (!extras.isEmpty()) { // has effect of unparcelling Bundle

        Log.d("RECEIVED MESSAGE", String.valueOf(extras));

        try {

            String data = extras.getString("data");

            JSONObject obj = new JSONObject(data);
            the_message = obj.getString("the_message");

            String other_parameters = obj.getString("param2");

            Log.v("other parameters found", other_parameters);

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

        if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
            sendNotification("Send error: " + extras.toString());
        } else if (GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) {
            sendNotification("Deleted messages on server: " + extras.toString());
            // If it's a regular GCM message, do some work.
        } else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
            // This loop represents the service doing some work.
            for (int i = 0; i < 5; i++) {
                Log.i(TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime());
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
            }
            Log.i(TAG, "Completed work @ " + SystemClock.elapsedRealtime());
            // Post notification of received message.
            sendNotification(the_message);
            Log.i(TAG, "Received: " + extras.toString());
        }
    }
    // Release the wake lock provided by the WakefulBroadcastReceiver.
    GcmBroadcastReceiver.completeWakefulIntent(intent);
}

From source file:com.daiv.android.twitter.services.TrimDataService.java

public void setNextTrim(Context context) {
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    long now = new Date().getTime();
    long alarm = now + AlarmManager.INTERVAL_DAY;

    Log.v("alarm_date", "auto trim " + new Date(alarm).toString());

    PendingIntent pendingIntent = PendingIntent.getService(context, TRIM_ID,
            new Intent(context, TrimDataService.class), 0);

    am.set(AlarmManager.RTC_WAKEUP, alarm, pendingIntent);
}

From source file:com.vendsy.bartsy.venue.GCMIntentService.java

@Override
protected void onUnregistered(Context context, String registrationId) {
    Log.v(TAG, "Device unregistered");
    // displayMessage(context, getString(R.string.gcm_unregistered));
    if (GCMRegistrar.isRegisteredOnServer(getApplicationContext())) {
        // ServerUtilities.unregister(context, registrationId);
    } else {/* w  w w. j  a va  2 s.  c om*/
        // This callback results from the call to unregister made on ServerUtilities when the registration to the server failed.
        Log.v(TAG, "Ignoring unregister callback");
    }
}

From source file:edu.csh.coursebrowser.SectionInfoActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_section_info);
    Bundle args = this.getIntent().getExtras();

    this.args = args.getString("args");
    this.setTitle(args.getString("title"));
    Log.v("Sections", args.getString("args"));

    // Set up the action bar to show tabs.
    final ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // For each of the sections in the app, add a tab to the action bar.

    actionBar.addTab(actionBar.newTab().setText("All").setTabListener(this));
    actionBar.addTab(actionBar.newTab().setText("Non-Full").setTabListener(this));
    actionBar.addTab(actionBar.newTab().setText("Full").setTabListener(this));

}

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

@Override
public List<Marker> load(String rawData, int taskId, int colour) throws JSONException {
    List<Marker> markers = new ArrayList<Marker>();
    JSONObject root = convertToJSON(rawData);
    JSONArray dataArray = root.getJSONArray("geonames");
    int top = Math.min(MAX_JSON_OBJECTS, dataArray.length());

    for (int i = 0; i < top; i++) {
        JSONObject jo = dataArray.getJSONObject(i);

        Marker ma = null;/*  w w  w . j  av a 2s .com*/
        if (jo.has("title") && jo.has("lat") && jo.has("lng") && jo.has("elevation")
                && jo.has("wikipediaUrl")) {

            Log.v(MainFrame.TAG, "processing Wikipedia JSON object");

            //no unique ID is provided by the web service according to http://www.geonames.org/export/wikipedia-webservice.html
            ma = new POIMarker("", HtmlUnescape.unescapeHTML(jo.getString("title"), 0), jo.getDouble("lat"),
                    jo.getDouble("lng"), jo.getDouble("elevation"), "http://" + jo.getString("wikipediaUrl"),
                    taskId, colour);
            markers.add(ma);
        }
    }
    return markers;
}

From source file:com.example.iotapptest.AppTest.java

/**
 * Run the app/*from  w  w w . j  av  a 2s .c o  m*/
 */
public void doApp(Context context, LinearLayout tLayout) {

    m_tableLayout = tLayout;
    m_context = context;

    //Read properties from the conf file
    /*Properties props = MqttUtil.readProperties("/sdcard/app_SmartcityPlugin.conf");
            
    MqttUtil.ORG = props.getProperty("org");
    MqttUtil.ID  = props.getProperty("appid");
    MqttUtil.AUTHMETHOD  = props.getProperty("key");
    MqttUtil.AUTHTOKEN = props.getProperty("token");
    //isSSL property
    MqttUtil.SSLSTR = props.getProperty("isSSL");*/

    boolean isSSL = false;
    if (MqttUtil.SSLSTR.equals("T")) {
        MqttUtil.ISSSL = true;
    }

    Log.v(MqttUtil.LOGTAG, "org: " + MqttUtil.ORG);
    Log.v(MqttUtil.LOGTAG, "id: " + MqttUtil.ID);
    Log.v(MqttUtil.LOGTAG, "authmethod: " + MqttUtil.AUTHMETHOD);
    Log.v(MqttUtil.LOGTAG, "authtoken" + MqttUtil.AUTHTOKEN);
    Log.v(MqttUtil.LOGTAG, "isSSL: " + isSSL);

    //Format: a:<orgid>:<app-id>
    MqttUtil.CLIENTID = "a:" + MqttUtil.ORG + ":" + MqttUtil.ID;
    MqttUtil.SERVER_HOST = MqttUtil.ORG + MqttUtil.SERVER_SUFFIX;

    handler = new AppMqttHandler(context);
    handler.connect(MqttUtil.SERVER_HOST, MqttUtil.CLIENTID, MqttUtil.AUTHMETHOD, MqttUtil.AUTHTOKEN,
            MqttUtil.ISSSL);

    /*Button button = (Button)m_tableLayout.findViewById(R.id.Refresh_button);
    button.setOnClickListener(new OnClickListener() {
               
       @Override
       public void onClick(View v) {
    // TODO Auto-generated method stub
    handler.reconnect(MqttUtil.SERVER_HOST, MqttUtil.CLIENTID, MqttUtil.AUTHMETHOD,  MqttUtil.AUTHTOKEN, MqttUtil.ISSSL);      
            
       }
    });*/
}

From source file:com.github.hobbe.android.openkarotz.fragment.RadioFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    Log.v(LOG_TAG, "onActivityCreated");
    super.onActivityCreated(savedInstanceState);
}

From source file:com.android.settings.cyanogenmod.LtoService.java

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (!LongTermOrbits.isSupported()) {
        if (ALOGV)
            Log.v(TAG, "LTO is not supported by this device");
        return START_NOT_STICKY;
    }//from  www. j  av  a 2 s  .c  o  m
    if (!LocationSettings.isLocationModeEnabled(this)) {
        if (ALOGV)
            Log.v(TAG, "Location mode not enabled in this device");
        return START_NOT_STICKY;
    }

    if (mTask != null && mTask.getStatus() != AsyncTask.Status.FINISHED) {
        if (ALOGV)
            Log.v(TAG, "LTO download is still active, not starting new download");
        return START_REDELIVER_INTENT;
    }

    if (!shouldDownload()) {
        Log.d(TAG, "Service started, but shouldn't download ... stopping");
        stopSelf();
        return START_NOT_STICKY;
    }

    mTask = new LtoDownloadTask(LongTermOrbits.getSourceLocation(), LongTermOrbits.getDestinationLocation());
    mTask.execute();

    return START_REDELIVER_INTENT;
}

From source file:org.mythtv.service.myth.v25.HostHelperV25.java

public List<String> process(final Context context, final LocationProfile locationProfile) {
    Log.v(TAG, "process : enter");

    if (!NetworkHelper.getInstance().isMasterBackendConnected(context, locationProfile)) {
        Log.w(TAG, "process : Master Backend '" + locationProfile.getHostname() + "' is unreachable");

        return null;
    }//from  w ww  .j  a v  a 2s  . c  om

    mMythServicesTemplate = (MythServicesTemplate) MythAccessFactory.getServiceTemplateApiByVersion(mApiVersion,
            locationProfile.getUrl());
    if (null == mMythServicesTemplate) {
        Log.w(TAG, "process : Master Backend '" + locationProfile.getHostname() + "' is unreachable");

        return null;
    }

    List<String> hosts = null;

    try {

        hosts = downloadHosts(locationProfile);

    } catch (Exception e) {
        Log.e(TAG, "process : error", e);

        hosts = null;
    }

    Log.v(TAG, "process : exit");
    return hosts;
}