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.example.iotapptest.DeviceTest.java

/**
 * Run the device/*from  w ww.  j  a v  a2  s .c o m*/
 */
public void doDevice(Context context) {
    //Read properties from the conf file
    Properties props = MqttUtil.readProperties("/sdcard/device.conf");

    String org = props.getProperty("org");
    String id = props.getProperty("deviceid");
    String authmethod = "use-token-auth";
    String authtoken = props.getProperty("token");
    //isSSL property
    String sslStr = props.getProperty("isSSL");
    boolean isSSL = false;
    if (sslStr.equals("T")) {
        isSSL = true;
    }

    String tag = "IOTTestApp";
    Log.v(tag, "org: " + org);
    Log.v(tag, "id: " + id);
    Log.v(tag, "authmethod: " + authmethod);
    Log.v(tag, "authtoken: " + authtoken);
    Log.v(tag, "isSSL: " + isSSL);

    String serverHost = org + MqttUtil.SERVER_SUFFIX;

    //Format: d:<orgid>:<type-id>:<divice-id>
    String clientId = "d:" + org + ":" + MqttUtil.DEFAULT_DEVICE_TYPE + ":" + id;
    handler = new DeviceMqttHandler(context);
    handler.connect(serverHost, clientId, authmethod, authtoken, isSSL);

    //Subscribe the Command events
    //iot-2/cmd/<cmd-type>/fmt/<format-id>
    handler.subscribe("iot-2/cmd/" + MqttUtil.DEFAULT_CMD_ID + "/fmt/json", 0);

    while (totalcount < 20) {

        //Format the Json String
        JSONObject contObj = new JSONObject();
        JSONObject jsonObj = new JSONObject();
        try {
            contObj.put("Rice", count);
            contObj.put("Sugar", count);
            contObj.put("Wheat", count);
            //contObj.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
            //.format(new Date()));
            jsonObj.put("d", contObj);

        } catch (JSONException e1) {
            e1.printStackTrace();
        }

        Log.v(tag, "Send count as " + count);
        Log.v(tag, "Payload is " + jsonObj.toString());
        //Publish device events to the app
        //iot-2/evt/<event-id>/fmt/<format> 
        handler.publish("iot-2/evt/" + MqttUtil.DEFAULT_EVENT_ID + "/fmt/json", jsonObj.toString(), false, 0);

        count++;
        totalcount++;

        try {
            Thread.sleep(15 * 1000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    Log.v(tag, "Max Count reached, try to disconnect");
    //handler.disconnect();
}

From source file:com.vst.android.demo.mensajeria.GCMIntentService.java

/**
 * Registra el regID(ID que google asigna al dispositivo movil)
 *//*w  w w. ja va  2 s  .  co  m*/
@Override
protected void onRegistered(Context context, String registrationId) {
    Log.v(GCMIntentService.class.getName(),
            "onRegistered seguridadService.registrarEnServidor :" + registrationId);
    Constantes.instance.regId = registrationId;
    try {
        int r = seguridadService.registrarEnServidor(registrationId, null, null,
                Constantes.tipo_registro_mobile.DESDE_CLASE_GCMINTENT_SERVICE);
        Log.v(GCMIntentService.class.getName(), "onRegistered r :" + r);
        GCMRegistrar.setRegisteredOnServer(context, true);
        switch (r) {
        case Constantes.respuestas_servidor.DISPOSITIVO_REGISTRADO:
            System.out.println("DISPOSITIVO_REGISTRADO");
            break;
        case Constantes.respuestas_servidor.NUEVO_DISPOSITIVO_POR_USUARIO_REGISTRADO:
            System.out.println("NUEVO_DISPOSITIVO_POR_USUARIO_REGISTRADO");

            break;
        case Constantes.respuestas_servidor.NUEVO_DISPOSITIVO_POR_NUEVO_USUARIO_REGISTRADO:
            System.out.println("NUEVO_DISPOSITIVO_POR_NUEVO_USUARIO_REGISTRADO");

            break;
        case Constantes.respuestas_servidor.NUEVO_USUARIO_POR_DISPOSITIVO_REGISTRADO:
            System.out.println("NUEVO_USUARIO_POR_DISPOSITIVO_REGISTRADO");

            break;
        }
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (JSONException e) {
        e.printStackTrace();
    }
}

From source file:com.jeffreyawest.weblogic.rest.WebLogicHTTPRestAdapter.java

protected void init(String host, int port, String username, String password) {

    httpAdapter = new HTTPAdapterImpl();
    this.username = username;
    this.password = password;
    baseURL = "http://" + host + ":" + port + "/management/tenant-monitoring";

    Log.v(LOG_TAG, "Initializing WebLogicRestAdapter: host=" + host + " port=" + port + " user=" + username);
    Log.v(LOG_TAG, "Initializing WebLogicRestAdapter: Base URL: " + baseURL);
}

From source file:com.phonegap.bossbolo.plugin.statusbar.StatusBar.java

/**
 * Sets the context of the Command. This can then be used to do things like
 * get file paths associated with the Activity.
 *
 * @param cordova The context of the main Activity.
 * @param webView The CordovaWebView Cordova is running in.
 *//*from  ww w.java2 s .c  om*/
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
    Log.v(TAG, "StatusBar: initialization");
    super.initialize(cordova, webView);

    this.cordova.getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
            // by the Cordova.
            Window window = cordova.getActivity().getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
            window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

            // Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
            setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#46bff7"));
        }
    });
}

From source file:br.com.calangodev.aacdecoder.AacDecoder.java

@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    if (this.cordova.getActivity().isFinishing())
        return true;
    /*(if (action.equals("mediaPlayer")) {
    Log.v(TAG,"ESTAMOS NA ACTION mediaPlayer");
    return true;/*  w w w .j a va  2s  .c om*/
    }
    else {
    return false;
    }*/
    if (action.equals("mediaPlayer")) {
        Log.v(TAG, "ESTAMOS AQUI em MEdia player: URL: " + args.getString(0));
        //            try{
        //                multiPlayer = new MultiPlayer();
        //                multiPlayer.playAsync(args.getString(0));
        //            } catch (Throwable t){
        //                Log.w(TAG, "Cannot play url - " + t );
        //            }
        startMediaPlayer(args.getString(0));

    } else if (action.equals("stopMediaPlayer")) {
        stop();
    } else if (action.equals("readyState")) {
        // verificar se tem um buffer maior que 2

        //if (multiPlayer == null){
        //    callbackContext.error(0);
        //} else {
        //    callbackContext.success();
        //}
    } else {
        return false;
    }
    callbackContext.success();
    return true;
}

From source file:com.teunsteenbekkers.cordova.cookiemanager.CookieManager.java

public void clear() {
    Log.v(TAG, "Clearing cookies...");
    webView.getCookieManager().clearCookies();
}

From source file:br.com.hotforms.StatusBarManager.java

/**
 * Sets the context of the Command. This can then be used to do things like
 * get file paths associated with the Activity.
 *
 * @param cordova The context of the main Activity.
 * @param webView The CordovaWebView Cordova is running in.
 *///w  w  w  . ja  v a 2s . c o  m
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
    Log.v(TAG, "StatusBarManager: initialization");
    super.initialize(cordova, webView);

    this.cordova.getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Window window = cordova.getActivity().getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        }
    });
}

From source file:com.allegrorom.ota.GCMIntentService.java

@Override
protected void onMessage(Context ctx, Intent payload) {
    final Config cfg = Config.getInstance(getApplicationContext());
    RomInfo info = RomInfo.fromIntent(payload);

    if (!Utils.isUpdate(info)) {
        Log.v("OTA::GCM", "got GCM message, not update");
        cfg.clearStoredUpdate();/*w  ww.  j  av  a 2 s .  c  o m*/
        return;
    }

    cfg.storeUpdate(info);
    if (cfg.getShowNotif()) {
        Log.v("OTA::GCM", "got GCM message");
        Utils.showUpdateNotif(ctx, info);
    } else {
        Log.v("OTA::GCM", "got GCM message, notif not shown");
    }
}

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

@Override
public boolean execute(String action, JSONArray data, CallbackContext callbackContext) throws JSONException {
    if (action.equals(EVENT_START_MONITORING)) {

        Log.v(TAG, "EVENT_START_MONITORING");
        this.startMonitoring(data, callbackContext);

        return true;
    } else if (action.equals(EVENT_REGISTER_CALLBACK)) {
        Log.v(TAG, "EVENT_REGISTER_CALLBACK");
        String event = data.getString(0);
        Log.v(TAG, event);//from www .j av a2  s.c  o  m

        IntentProxy.setBtListener(this);
        IntentProxy.setgeoListener(this);

        PluginResult result = new PluginResult(PluginResult.Status.OK, "Set callback for " + event);
        result.setKeepCallback(true);
        this.contexts.put(event, callbackContext);
        callbackContext.sendPluginResult(result);
        return true;
    }

    return false;
}

From source file:br.com.hotforms.FacebookHash.java

/**
 * Sets the context of the Command. This can then be used to do things like
 * get file paths associated with the Activity.
 *
 * @param cordova The context of the main Activity.
 * @param webView The CordovaWebView Cordova is running in.
 *///from w  w w  . ja v a2s.c  o  m
@Override
public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
    Log.v(TAG, "FacebookHash: initialization");
    super.initialize(cordova, webView);
}