Java Code Examples for android.util.Log.w()

The following are Jave code examples for showing how to use w() of the android.util.Log class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SpaceRace   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ButterKnife.bind(this);

    NetworkingUtility.registerListener(this);
    disablePlayButtons();

    mGoogleSignInClient = GoogleSignIn.getClient(this, GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);

    if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) {
        Log.w("SIGNIN", "*** Warning: setup problems detected. Sign in may not work!");
    }

    // start the sign-in flow
    Log.d("SIGNIN", "Sign-in button clicked");
    startActivityForResult(mGoogleSignInClient.getSignInIntent(), RC_SIGN_IN);

    LanguageManager.languageManagement(this);
}
 
Example 2
Project: PeSanKita-android   File: WebRtcCallService.java   View Source Code Vote up 6 votes
private void handleAnswerCall(Intent intent) {
  if (callState != CallState.STATE_LOCAL_RINGING) {
    Log.w(TAG, "Can only answer from ringing!");
    return;
  }

  if (peerConnection == null || dataChannel == null || recipient == null || callId == null) {
    throw new AssertionError("assert");
  }

  DatabaseFactory.getSmsDatabase(this).insertReceivedCall(recipient.getNumber());

  this.peerConnection.setAudioEnabled(true);
  this.peerConnection.setVideoEnabled(true);
  this.dataChannel.send(new DataChannel.Buffer(ByteBuffer.wrap(Data.newBuilder().setConnected(Connected.newBuilder().setId(this.callId)).build().toByteArray()), false));

  intent.putExtra(EXTRA_CALL_ID, callId);
  intent.putExtra(EXTRA_REMOTE_NUMBER, recipient.getNumber());
  handleCallConnected(intent);
}
 
Example 3
Project: AAVT   File: ConsoleLogger.java   View Source Code Vote up 6 votes
@Override
public void log(int level, String key, String value) {
    switch (level){
        case DEBUG:
            Log.d(key,value);
            break;
        case INFO:
            Log.i(key,value);
            break;
        case ERROR:
            Log.e(key,value);
            break;
        default:
            Log.w(key,value);
            break;
    }
}
 
Example 4
Project: AC2RD   File: Replayer.java   View Source Code Vote up 6 votes
@Override
public boolean onTouchEvent(MotionEvent event) 
{
	try
	{
		if ((mediaPlayer != null) && (mediaController != null) && (isPrepared == true))
		{
			mediaController.show();
			return true;
		}
		else
		{
			return false;
		}
	}
	catch (Exception e)
	{
		Log.w("Replayer", "onTouchEvent : " + getApplicationContext().getString(R.string.log_replayer_echec_touch_event) + " : " + e);
		databaseManager.insertLog(getApplicationContext(), "" + getApplicationContext().getString(R.string.log_replayer_echec_touch_event), new Date().getTime(), 2, false);
		return false;
	}
}
 
Example 5
Project: SimpleUILauncher   File: DefaultLayoutParser.java   View Source Code Vote up 6 votes
@Override
protected Intent parseIntent(XmlResourceParser parser) {
    String uri = null;
    try {
        uri = getAttributeValue(parser, ATTR_URI);
        return Intent.parseUri(uri, 0);
    } catch (URISyntaxException e) {
        Log.w(TAG, "Shortcut has malformed uri: " + uri);
        return null; // Oh well
    }
}
 
Example 6
Project: GitHub   File: HermesEventBus.java   View Source Code Vote up 6 votes
private <T> T calculateInternal(final Function<IMainService, ? extends T> function) {
    if (mMainProcess) {
        return function.call(mMainApis);
    } else {
        if (mState == STATE_DISCONNECTED) {
            Log.w(TAG, HERMES_SERVICE_DISCONNECTED);
            return null;
        } else {
            return mRemoteApis.calculate(new Function<IMainService, T>() {
                @Override
                public T call(IMainService o) {
                    return function.call(o);
                }
            });
        }
    }
}
 
Example 7
Project: tvConnect_android   File: GingerbreadOpenCameraInterface.java   View Source Code Vote up 5 votes
/**
 * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists, or opens camera 0.
 */
@Override
public Camera open() {
  
  int numCameras = Camera.getNumberOfCameras();
  if (numCameras == 0) {
    Log.w(TAG, "No cameras!");
    return null;
  }

  int index = 0;
  while (index < numCameras) {
    Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
    Camera.getCameraInfo(index, cameraInfo);
    if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
      break;
    }
    index++;
  }
  
  Camera camera;
  if (index < numCameras) {
    Log.i(TAG, "Opening camera #" + index);
    camera = Camera.open(index);
  } else {
    Log.i(TAG, "No camera facing back; returning camera #0");
    camera = Camera.open(0);
  }

  return camera;
}
 
Example 8
Project: container   File: VUserManager.java   View Source Code Vote up 5 votes
/**
 * Returns the UserInfo object describing a specific user.
 * @param handle the user handle of the user whose information is being requested.
 * @return the UserInfo object for a specific user.
 * @hide
 */
public VUserInfo getUserInfo(int handle) {
    try {
        return mService.getUserInfo(handle);
    } catch (RemoteException re) {
        Log.w(TAG, "Could not get user info", re);
        return null;
    }
}
 
Example 9
Project: PeSanKita-android   File: WebRtcCallActivity.java   View Source Code Vote up 5 votes
@Override
public void onResume() {
  Log.w(TAG, "onResume()");
  super.onResume();
  if (!networkAccess.isCensored(this)) MessageRetrievalService.registerActivityStarted(this);
  initializeScreenshotSecurity();
  EventBus.getDefault().register(this);
}
 
Example 10
Project: Cable-Android   File: LollipopMmsConnection.java   View Source Code Vote up 5 votes
@Override
public synchronized void onReceive(Context context, Intent intent) {
  Log.w(TAG, "onReceive()");
  if (!action.equals(intent.getAction())) {
    Log.w(TAG, "received broadcast with unexpected action " + intent.getAction());
    return;
  }

  onResult(context, intent);

  resultAvailable = true;
  notifyAll();
}
 
Example 11
Project: AndroidSDK2.0   File: NLog.java   View Source Code Vote up 5 votes
/**
 * W.
 *
 * @param text the text
 */
public static void w(String text)
{
	if (W)
	{
		if ( UseExternalLogger ) 
		{
			//Microlog4android.info(text);
		}
		Log.w(TAG, text);
		
	}
}
 
Example 12
Project: AndroidSoftKeyboardListener   File: SoftKeyboardListener.java   View Source Code Vote up 5 votes
private void onBackPressedOnKeyboard() {
    Log.d("SoftKeyboardListener", "onBackPressedOnKeyboard");

    View focusedView = findFocusedView();
    if (focusedView == null) {
        Log.w("SoftKeyboardListener", "wut focusedView==null? how is this possible?");
        return;
    }

    setImeVisibility(false);
    mDefaultFocusView.requestFocus();
}
 
Example 13
Project: Cable-Android   File: IncomingLollipopMmsConnection.java   View Source Code Vote up 5 votes
@TargetApi(VERSION_CODES.LOLLIPOP)
@Override
public synchronized void onResult(Context context, Intent intent) {
  if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) {
    Log.w(TAG, "HTTP status: " + intent.getIntExtra(SmsManager.EXTRA_MMS_HTTP_STATUS, -1));
  }
  Log.w(TAG, "code: " + getResultCode() + ", result string: " + getResultData());
}
 
Example 14
Project: PlusGram   File: TsExtractor.java   View Source Code Vote up 5 votes
private boolean parseHeader() {
  // Note: see ISO/IEC 13818-1, section 2.4.3.6 for detailed information on the format of
  // the header.
  pesScratch.setPosition(0);
  int startCodePrefix = pesScratch.readBits(24);
  if (startCodePrefix != 0x000001) {
    Log.w(TAG, "Unexpected start code prefix: " + startCodePrefix);
    payloadSize = -1;
    return false;
  }

  pesScratch.skipBits(8); // stream_id.
  int packetLength = pesScratch.readBits(16);
  pesScratch.skipBits(5); // '10' (2), PES_scrambling_control (2), PES_priority (1)
  dataAlignmentIndicator = pesScratch.readBit();
  pesScratch.skipBits(2); // copyright (1), original_or_copy (1)
  ptsFlag = pesScratch.readBit();
  dtsFlag = pesScratch.readBit();
  // ESCR_flag (1), ES_rate_flag (1), DSM_trick_mode_flag (1),
  // additional_copy_info_flag (1), PES_CRC_flag (1), PES_extension_flag (1)
  pesScratch.skipBits(6);
  extendedHeaderLength = pesScratch.readBits(8);

  if (packetLength == 0) {
    payloadSize = -1;
  } else {
    payloadSize = packetLength + 6 /* packetLength does not include the first 6 bytes */
        - HEADER_SIZE - extendedHeaderLength;
  }
  return true;
}
 
Example 15
Project: PeSanKita-android   File: MmsReceiveJob.java   View Source Code Vote up 5 votes
@Override
public void onRun() {
  if (data == null) {
    Log.w(TAG, "Received NULL pdu, ignoring...");
    return;
  }

  PduParser  parser = new PduParser(data);
  GenericPdu pdu    = null;

  try {
    pdu = parser.parse();
  } catch (RuntimeException e) {
    Log.w(TAG, e);
  }

  if (isNotification(pdu) && !isBlocked(pdu)) {
    MmsDatabase database                = DatabaseFactory.getMmsDatabase(context);
    Pair<Long, Long> messageAndThreadId = database.insertMessageInbox((NotificationInd)pdu, subscriptionId);

    Log.w(TAG, "Inserted received MMS notification...");

    ApplicationContext.getInstance(context)
                      .getJobManager()
                      .add(new MmsDownloadJob(context,
                                              messageAndThreadId.first,
                                              messageAndThreadId.second,
                                              true));
  } else if (isNotification(pdu)) {
    Log.w(TAG, "*** Received blocked MMS, ignoring...");
  }
}
 
Example 16
Project: justintrain-client-android   File: SQLiteAssetHelper.java   View Source Code Vote up 5 votes
private InputStream getUpgradeSQLStream(int oldVersion, int newVersion) {
    String path = String.format(mUpgradePathFormat, oldVersion, newVersion);
    try {
        return mContext.getAssets().open(path);
    } catch (IOException e) {
        Log.w(TAG, "missing database upgrade script: " + path);
        return null;
    }
}
 
Example 17
Project: jazz-android   File: MainActivity.java   View Source Code Vote up 4 votes
@Override
public void onChatWindowVisibilityChanged(boolean b) {
    Log.w("Chat", "Chat window visibility changed.");
}
 
Example 18
Project: LuaViewPlayground   File: CameraManager.java   View Source Code Vote up 4 votes
/**
 * Opens the camera driver and initializes the hardware parameters.
 *
 * @param holder The surface object which the camera will draw preview frames
 *               into.
 * @throws IOException Indicates the camera driver failed to open.
 */
public synchronized void openDriver(SurfaceHolder holder) throws IOException {
    Camera theCamera = camera;
    if (theCamera == null) {

        if (requestedCameraId >= 0) {
            theCamera = OpenCameraInterface.open(requestedCameraId);
        } else {
            theCamera = OpenCameraInterface.open();
        }

        if (theCamera == null) {
            throw new IOException();
        }
        camera = theCamera;
    }
    theCamera.setPreviewDisplay(holder);

    if (!initialized) {
        initialized = true;
        configManager.initFromCameraParameters(theCamera);
    }

    Camera.Parameters parameters = theCamera.getParameters();
    String parametersFlattened = parameters == null ? null : parameters.flatten(); // Save
    // these,
    // temporarily
    try {
        configManager.setDesiredCameraParameters(theCamera, false);
    } catch (RuntimeException re) {
        // Driver failed
        Log.w(TAG, "Camera rejected parameters. Setting only minimal safe-mode parameters");
        Log.i(TAG, "Resetting to saved camera params: " + parametersFlattened);
        // Reset:
        if (parametersFlattened != null) {
            parameters = theCamera.getParameters();
            parameters.unflatten(parametersFlattened);
            try {
                theCamera.setParameters(parameters);
                configManager.setDesiredCameraParameters(theCamera, true);
            } catch (RuntimeException re2) {
                // Well, darn. Give up
                Log.w(TAG, "Camera rejected even safe-mode parameters! No configuration");
            }
        }
    }

}
 
Example 19
Project: rapid-io-android   File: Logcat.java   View Source Code Vote up 4 votes
public static void w(@NonNull String msg, Object... args) {
	if(IS_ENABLED) Log.w(TAG, getCodeLocation().toString() + formatMessage(msg, args));
}
 
Example 20
Project: androidscan   File: CameraManager.java   View Source Code Vote up 4 votes
/**
 * Opens the camera driver and initializes the hardware parameters.
 *
 * @param holder The surface object which the camera will draw preview frames into.
 * @throws IOException Indicates the camera driver failed to open.
 */
public synchronized void openDriver(SurfaceHolder holder) throws IOException {
    Camera theCamera = camera;
    if (theCamera == null) {

        theCamera = OpenCameraInterface.open(requestedCameraId);
        if (theCamera == null) {
            throw new IOException();
        }
        camera = theCamera;
    }
    theCamera.setPreviewDisplay(holder);

    if (!initialized) {
        initialized = true;
        configManager.initFromCameraParameters(theCamera);
    }

    Camera.Parameters parameters = theCamera.getParameters();
    String parametersFlattened = parameters == null ? null : parameters.flatten(); // Save these, temporarily
    try {
        configManager.setDesiredCameraParameters(theCamera, false);
    } catch (RuntimeException re) {
        // Driver failed
        Log.w(TAG, "Camera rejected parameters. Setting only minimal safe-mode parameters");
        Log.i(TAG, "Resetting to saved camera params: " + parametersFlattened);
        // Reset:
        if (parametersFlattened != null) {
            parameters = theCamera.getParameters();
            parameters.unflatten(parametersFlattened);
            try {
                theCamera.setParameters(parameters);
                configManager.setDesiredCameraParameters(theCamera, true);
            } catch (RuntimeException re2) {
                // Well, darn. Give up
                Log.w(TAG, "Camera rejected even safe-mode parameters! No configuration");
            }
        }
    }

}