Example usage for android.util Log w

List of usage examples for android.util Log w

Introduction

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

Prototype

public static int w(String tag, Throwable tr) 

Source Link

Usage

From source file:com.android.vending.licensing.i.java

private void b(String paramString) {
    try {/*from   w ww  . j a  v  a 2  s .c o  m*/
        Long localLong2 = Long.valueOf(Long.parseLong(paramString));
        localLong1 = localLong2;
        this.n = localLong1.longValue();
        this.s.a("retryUntil", paramString);
        return;
    } catch (NumberFormatException localNumberFormatException) {
        while (true) {
            Log.w("ServerManagedPolicy", "License retry timestamp (GT) missing, grace period disabled");
            paramString = "0";
            Long localLong1 = Long.valueOf(0L);
        }
    }
}

From source file:org.fdroid.enigtext.mms.MmsSendHelper.java

private static byte[] sendBytes(Context context, byte[] mms, String apn, boolean usingMmsRadio,
        boolean useProxyIfAvailable) throws IOException {
    Log.w("MmsSender", "Sending MMS of length: " + mms.length);
    try {/*from w w  w.  j  av  a  2 s .c  o m*/
        MmsConnectionParameters parameters = getMmsConnectionParameters(context, apn, useProxyIfAvailable);
        checkRouteToHost(context, parameters, parameters.getMmsc(), usingMmsRadio);
        return makePost(context, parameters, mms);
    } catch (ApnUnavailableException aue) {
        Log.w("MmsSender", aue);
        throw new IOException("Failed to get MMSC information...");
    }
}

From source file:ca.cmput301w14t09.elasticSearch.ElasticSearchOperations.java

/**
 * postThread posts a top comment to Elastic-Search.
 * Tested and verified.//from w  w  w.j  a  v a  2  s  . c om
 * @param ElasticSearchOperations
 * @throws InterruptedException 
 */
public static void postThread(final Comment commentThread) throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);

    if (GSON == null)
        constructGson();

    Thread thread = new Thread() {

        @Override
        public void run() {
            HttpClient client = new DefaultHttpClient();
            HttpPost request = new HttpPost(postAddress + commentThread.getUuid() + "/");

            try {
                request.setEntity(new StringEntity(GSON.toJson(commentThread)));

                HttpResponse response = client.execute(request);
                Log.w(serverName, response.getStatusLine().toString());

                response.getStatusLine().toString();
                HttpEntity entity = response.getEntity();

                BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));
                String output = reader.readLine();
                while (output != null) {
                    Log.w(serverName, output);
                    output = reader.readLine();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            latch.countDown();
        }
    };
    thread.start();
    latch.await();
}

From source file:mobisocial.socialkit.musubi.multiplayer.TurnBasedMultiplayer.java

public TurnBasedMultiplayer(DbObj objContext) {
    if (objContext == null) {
        throw new NullPointerException("ObjContext is null");
    }/*from w  ww . j av a 2 s  . co m*/
    mObjContext = objContext;
    mDbFeed = mObjContext.getSubfeed();
    String[] projection = null;
    String selection = "type = ? OR type = ?";
    String[] selectionArgs = new String[] { TYPE_APP_STATE, TYPE_INTERRUPT_REQUEST };
    String sortOrder = DbObj.COL_INT_KEY + " desc";
    mDbFeed.setQueryArgs(projection, selection, selectionArgs, sortOrder);
    mDbFeed.registerStateObserver(mInternalStateObserver);
    Obj obj = mDbFeed.getLatestObj(TYPE_APP_STATE);
    //Log.d(TAG, "The latest obj has " + obj.getIntKey());
    mLocalMember = mDbFeed.getLocalUser().getId();

    JSONArray membership = null;
    if (obj == null) {
        // No turn taken yet.
        Log.e(TAG, "App state is null.");
        try {
            membership = objContext.getJson().getJSONArray(OBJ_MEMBERSHIP);
        } catch (JSONException e) {
            Log.w(TAG, "No membership for obj context");
            membership = new JSONArray();
            membership.put(mLocalMember);
        }

        mLastTurn = 0;
        setMembershipFromJson(membership);
        if (objContext.getSender().getId().equals(mLocalMember)) {
            // Set the initial state that all members will see
            mLatestState = getInitialState();
            Log.d(TAG, "set initial state " + mLatestState);
            if (mLatestState != null) {
                takeTurn(membership, 0, mLatestState);
            }
        }
        return;
    }

    // At least one turn has been taken.
    JSONObject json = obj.getJson();
    if (json == null || !json.has(OBJ_MEMBERSHIP)) {
        Log.e(TAG, "App state has no membership.");
        mMembers = null;
        mLocalMemberIndex = -1;
        return;
    }

    JSONArray memberArr = json.optJSONArray(OBJ_MEMBERSHIP);
    setMembershipFromJson(memberArr);

    mLastTurn = (obj.getIntKey() == null) ? 0 : obj.getIntKey();
    Log.d(TAG, "Read last turn " + mLastTurn);
    mGlobalMemberCursor = (json.has(OBJ_MEMBER_CURSOR)) ? json.optInt(OBJ_MEMBER_CURSOR) : 0;
}

From source file:com.jesusla.google.BillingReceiver.java

/**
 * This is the entry point for all asynchronous messages sent from Android Market to
 * the application. This method forwards the messages on to the
 * {@link BillingService}, which handles the communication back to Android Market.
 * The {@link BillingService} also reports state changes back to the application through
 * the {@link ResponseHandler}.//  w  ww  . ja va 2 s .  c  o  m
 */
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (Consts.ACTION_PURCHASE_STATE_CHANGED.equals(action)) {
        String signedData = intent.getStringExtra(Consts.INAPP_SIGNED_DATA);
        String signature = intent.getStringExtra(Consts.INAPP_SIGNATURE);
        purchaseStateChanged(context, signedData, signature);
    } else if (Consts.ACTION_NOTIFY.equals(action)) {
        String notifyId = intent.getStringExtra(Consts.NOTIFICATION_ID);
        if (Consts.DEBUG) {
            Log.i(TAG, "notifyId: " + notifyId);
        }
        notify(context, notifyId);
    } else if (Consts.ACTION_RESPONSE_CODE.equals(action)) {
        long requestId = intent.getLongExtra(Consts.INAPP_REQUEST_ID, -1);
        int responseCodeIndex = intent.getIntExtra(Consts.INAPP_RESPONSE_CODE,
                ResponseCode.RESULT_ERROR.ordinal());
        checkResponseCode(context, requestId, responseCodeIndex);
    } else {
        Log.w(TAG, "unexpected action: " + action);
    }
}