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

The following are Jave code examples for showing how to use e() 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: GCSApp   File: ShoppingCartAdapter.java   View Source Code Vote up 6 votes
private void setDrawerLeftEdgeSize (Context context, DrawerLayout drawerLayout, float displayWidthPercentage) {
    if (context == null || drawerLayout == null) return;
    try {
        // 找到 ViewDragHelper 并设置 Accessible 为true
        Field leftDraggerField =
                drawerLayout.getClass().getDeclaredField("mRightDragger");//Right
        leftDraggerField.setAccessible(true);
        ViewDragHelper leftDragger = (ViewDragHelper) leftDraggerField.get(drawerLayout);

        // 找到 edgeSizeField 并设置 Accessible 为true
        Field edgeSizeField = leftDragger.getClass().getDeclaredField("mEdgeSize");
        edgeSizeField.setAccessible(true);
        int edgeSize = edgeSizeField.getInt(leftDragger);

        // 设置新的边缘大小
        int screenWidth = PixelUtil.getWidth(context);
        edgeSizeField.setInt(leftDragger, Math.max(edgeSize, (int) (screenWidth * displayWidthPercentage)));
    } catch (Exception e) {
        Log.e("aaa", "setDrawerLeftEdgeSize wrong");
    }
}
 
Example 2
Project: Ships   File: RtlSdrAisService.java   View Source Code Vote up 6 votes
@Override
  public void onRtlSdrStopped() {
  	Log.d(TAG,"NativeRtlSdrListener - onRtlSdrStopped");
  	
  	// Inform listeners
for (final RtlSdrServiceListener listener : listeners){
          listener.onRtlSdrStopped();
      }

  	releaseWakeLock();
  	    	
  	if (pendingStartRtlSdrRequest!=null){
  		// Requested to stop AIS before starting again. Now it's time to start AIS

	try {
		Thread.sleep(3000);
	} catch (InterruptedException e) {
		Log.e(TAG,"start - wait for closed device",e);
	}
  		
      	nativeRtlSdr.startAis(pendingStartRtlSdrRequest);
      	pendingStartRtlSdrRequest=null;
  	}
  }
 
Example 3
Project: MorseKnown   File: DecodeFragment.java   View Source Code Vote up 6 votes
@Override
public void onResume() {
    super.onResume();

    wakeLock.acquire();
    try {

        if (camId == 0) {
            //camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);
        }
        else {
           camera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);
        }
    } catch (Exception e) {
        Log.e(getString(R.string.app_name), "failed to open Camera");
        e.printStackTrace();
    }
    //camera = Camera.open();

    //startTime = System.currentTimeMillis();

    killme = false;
    mHandler.postDelayed(update, 20);
}
 
Example 4
Project: T0rlib4Android   File: TorClientSocks4.java   View Source Code Vote up 6 votes
public void Init() throws IOException, InterruptedException {
    if(ctx==null){
        Log.e("TorTest", "Couldn't start Tor!");
        return;
    }
    String fileLocation = "torfiles";
    // Start the Tor Onion Proxy
    AndroidTorRelay node = new  AndroidTorRelay(ctx,fileLocation);
    int hiddenServicePort = 80;
    int localPort = node.getSocksPort();
    String OnionAdress = "xl5rbgygp2wbgdbn.onion";
    String localhost="127.0.0.1";

    Socket clientSocket = Utilities.socks4aSocketConnection(OnionAdress, hiddenServicePort, "127.0.0.1", localPort);

    ObjectOutputStream out = new ObjectOutputStream(clientSocket.getOutputStream());
    out.flush();

    out.writeObject("i am workingg");
    out.flush();
}
 
Example 5
Project: Achilles_Android   File: MainActivity.java   View Source Code Vote up 6 votes
/**
 * Get local Media and add tracks to media stream.
 * @return
 */
private boolean getMediaStream() {
    // Add video stream
    mStream = mPeerConnectionFactory.createLocalMediaStream("ARDAMS");
    mVideoCapturer = createVideoCapturer();
    if(mStream.addTrack(createVideoTrack(mVideoCapturer)) &&
            mStream.addTrack(createAudioTrack(mAudioConstraints))) {
        Log.d(TAG, "Got local MediaStream.");
        return true;
    }

    // Add audio stream
    mStream.addTrack(createAudioTrack(mAudioConstraints));
    Log.e(TAG, "Can't get local MediaStream.");
    return false;
}
 
Example 6
Project: BluetoothStudy   File: DeviceListFragment.java   View Source Code Vote up 6 votes
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(action)) {
        toast("开始搜索 ...");
    } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
        toast("搜索结束");
    } else if (BluetoothDevice.ACTION_FOUND.equals(action)) {
        BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
        if (isNewDevice(device)) {
            deviceList.add(device);
            listAdapter.notifyDataSetChanged();
            Log.e(TAG, "---------------- " + device.getName());
        }
    }
}
 
Example 7
Project: Forge   File: Util.java   View Source Code Vote up 5 votes
/**
 * Checks if the Forge Auto fill accessibility service is enabled
 *
 * @param context application context
 * @return true = service enabled, false = service disabled
 */
public static boolean isAccessibilitySettingsOn(Context context) {
    int accessibilityEnabled = 0;
    final String service = context.getPackageName() + "/" + AccessibilityAutofillService.class.getCanonicalName();
    try {
        accessibilityEnabled = Settings.Secure.getInt(
                context.getApplicationContext().getContentResolver(),
                android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
    } catch (Settings.SettingNotFoundException e) {
        // If there is an error, log it
        Log.e(Forge.ERROR_LOG, e.getMessage());
    }
    TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');

    if (accessibilityEnabled == 1) {
        String settingValue = Settings.Secure.getString(
                context.getApplicationContext().getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
        if (settingValue != null) {
            mStringColonSplitter.setString(settingValue);
            while (mStringColonSplitter.hasNext()) {
                String accessibilityService = mStringColonSplitter.next();

                if (accessibilityService.equalsIgnoreCase(service)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
Example 8
Project: real_time_circle_detection_android   File: CameraGLRendererBase.java   View Source Code Vote up 5 votes
private void initFBO(int width, int height)
{
    Log.d(LOGTAG, "initFBO("+width+"x"+height+")");

    deleteFBO();

    GLES20.glGenTextures(1, texDraw, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    GLES20.glGenTextures(1, texFBO, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    //int hFBO;
    GLES20.glGenFramebuffers(1, FBO, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0);
    Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError());

    int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE)
        Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus);

    mFBOWidth  = width;
    mFBOHeight = height;
}
 
Example 9
Project: android-library   File: CallbackInterface.java   View Source Code Vote up 5 votes
public static void _stopAnimacao() {
    try {
        if (mOUL != null) {
            mOUL.OnStopAnimation();
        }
    } catch (Exception localException) {
        Log.e(TAG, "_stopAnimacao ERROR: " + localException.getMessage());
    }
}
 
Example 10
Project: react-native-node   File: RNNodeService.java   View Source Code Vote up 5 votes
@Override
public void onCreate() {
    Log.v(TAG, "Create and prepare");
    String dataDir = this.getApplicationInfo().dataDir;
    prepareNode(this, dataDir);
    File bundleTar = prepareBundle(this, dataDir);
    try {
        unTar(bundleTar, new File(dataDir + "/" + APP_NAME));
    } catch (Exception e) {
        Log.e(TAG, "Cannot uncompress the background app bundle", e);
    }
}
 
Example 11
Project: androidtools   File: DateUtils.java   View Source Code Vote up 5 votes
/**
 * Gets the input date is a few weeks
 *
 * @param date date
 * @return days of the week
 */
public static String getWeekDate(String date) {
    try {
        Date d = mDataFormat.parse(date);
        return getWeekDate(d);
    } catch (ParseException e) {
        e.printStackTrace();
        Log.e(TAG, e.getMessage());
    }
    return "The weeks are unknown.";
}
 
Example 12
Project: PXLSRT   File: Camera2.java   View Source Code Vote up 5 votes
/**
 * Locks the focus as the first step for a still image capture.
 */
private void lockFocus() {
    mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
            CaptureRequest.CONTROL_AF_TRIGGER_START);
    try {
        mCaptureCallback.setState(PictureCaptureCallback.STATE_LOCKING);
        mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, null);
    } catch (CameraAccessException e) {
        Log.e(TAG, "Failed to lock focus.", e);
    }
}
 
Example 13
Project: backup   File: ContentProviderBackupComponent.java   View Source Code Vote up 5 votes
@Override
public int sendBackupData(int numBytes) {

    if (backupState == null) {
        Log.e(TAG, "Attempted sendBackupData() before performFullBackup()");
        return TRANSPORT_ERROR;
    }

    long bytesTransferred = backupState.getBytesTransferred() + numBytes;

    if (bytesTransferred > configuration.getBackupSizeQuota()) {
        return TRANSPORT_QUOTA_EXCEEDED;
    }

    InputStream inputStream = backupState.getInputStream();
    ZipOutputStream outputStream = backupState.getOutputStream();

    try {
        outputStream.write(IOUtils.readFully(inputStream, numBytes, true));
        backupState.setBytesTransferred(bytesTransferred);

    } catch (IOException ex) {
        Log.e(TAG, "Error handling backup data for " + backupState.getPackageName() + ": ", ex);
        return TRANSPORT_ERROR;
    }
    return TRANSPORT_OK;
}
 
Example 14
Project: RoadLab-Pro   File: BumpDAO.java   View Source Code Vote up 5 votes
public long putBump(final BumpModel data) {
    long insertId = -1;
    SQLiteDatabase db = getDatabase();
    try {
        db.beginTransaction();
        final ContentValues values = getContentValues(data);
        insertId = db.insert(DataBaseHelper.TABLE_BUMPS, null, values);
        db.setTransactionSuccessful();
    } catch (Exception e) {
        Log.e(TAG, e != null && e.getMessage() != null ? e.getMessage() : "");
    } finally {
        db.endTransaction();
    }
    return insertId;
}
 
Example 15
Project: GitHub   File: FastAdapter.java   View Source Code Vote up 5 votes
/**
 * is called in onViewRecycled to unbind the data on the ViewHolder
 *
 * @param viewHolder the viewHolder for the type at this position
 * @param position   the position of this viewHolder
 */
@Override
public void unBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
    IItem item = (IItem) viewHolder.itemView.getTag();
    if (item != null) {
        item.unbindView(viewHolder);
    } else {
        Log.e("FastAdapter", "The bindView method of this item should set the `Tag` on its itemView (https://github.com/mikepenz/FastAdapter/blob/develop/library-core/src/main/java/com/mikepenz/fastadapter/items/AbstractItem.java#L189)");
    }
}
 
Example 16
Project: AI-Powered-Intelligent-Banking-Platform   File: AuthorizationManager.java   View Source Code Vote up 5 votes
/**
 * Create a new Auth Manager based on the supplied product id
 *
 * This will throw an error if our assets/api_key.txt file, our package name, and our signing key don't match the product ID, this is
 * a common sticking point for the application not working
 * @param context
 * @param productId
 */
public AuthorizationManager(@NotNull Context context, @NotNull String productId){
    mContext = context;
    mProductId = productId;

    try {
        mAuthManager = new AmazonAuthorizationManager(mContext, Bundle.EMPTY);
    }catch(IllegalArgumentException e){
        //This error will be thrown if the main project doesn't have the assets/api_key.txt file in it--this contains the security credentials from Amazon
        Util.showAuthToast(mContext, "APIKey is incorrect or does not exist.");
        Log.e(TAG, "Unable to Use Amazon Authorization Manager. APIKey is incorrect or does not exist. Does assets/api_key.txt exist in the main application?", e);
    }
}
 
Example 17
Project: Brevent   File: UILog.java   View Source Code Vote up 4 votes
static void e(String msg) {
    Log.e(TAG, msg);
}
 
Example 18
Project: MainCalendar   File: AppConstants.java   View Source Code Vote up 4 votes
public static int ELog(String str){
    Helper.RecordLog('E', str);
    return Log.e(LOG_TAG, str);
}
 
Example 19
Project: CoinPryc   File: SecondActivity.java   View Source Code Vote up 4 votes
protected void onPostExecute(String response) {

            String paxfulbuy1=null;
            Long paxfulbuy2;

            if (response == null) {
                response = "THERE WAS AN ERROR";
                paxfulbuy1 = "0";
                Toast.makeText(getApplicationContext(), "Bad Response", Toast.LENGTH_SHORT).show();
            }
            else {
                try {
                    JSONObject object = (JSONObject) new JSONTokener(response).nextValue();
                    JSONArray arr = object.getJSONArray("data");

                    for (int i = 0; i < arr.length() - 1; i++) {
                        JSONObject objects = arr.getJSONObject(i);
                        paxfulbuy1 = objects.getString("currency_code");

                        System.out.println("Found Currency " + paxfulbuy1);
                        if (paxfulbuy1.equals("INR")) {
                            paxfulbuy2 = objects.getLong("fiat_price_per_btc");
                            paxfulbuy1 = paxfulbuy2.toString();
                            System.out.println("Price in INR:" + paxfulbuy2);
                            break;

                        } else if (paxfulbuy1.equals("USD")) {

                            paxfulbuy2 = objects.getLong("fiat_price_per_btc");
                            System.out.println("Price in Currency:" + paxfulbuy2);
                            paxfulbuy2 = paxfulbuy2 * forex;
                            paxfulbuy1 = paxfulbuy2.toString();

                            System.out.println("After Forex :" + paxfulbuy1);
                            break;

                        } else {
                            paxfulbuy1 = "NA";
                        }
                        Toast.makeText(getApplicationContext(), "Retrieving Data", Toast.LENGTH_SHORT).show();

                    }

                } catch (Exception e) {
                    Log.e("Error", e.getMessage(), e);
                    // Appropriate error handling code
                }

            }
            Log.i("INFO", response);
            textView9.setText(paxfulbuy1);

            if (min==0)
            {
                min = Double.parseDouble(paxfulbuy1);
            }

            if (Double.parseDouble(paxfulbuy1)!= 0 && Double.parseDouble(paxfulbuy1)<=min)
            {
                min = Double.parseDouble(paxfulbuy1);
                flag =4;
            }
            System.out.println("The Minimum price is "+min);



        }
 
Example 20
Project: Excuser   File: MainActivity.java   View Source Code Vote up 4 votes
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
    Log.e(TAG, "onConnectionFailed(): " + connectionResult);
}