当前位置: 首页>>代码示例>>Java>>正文


Java Logger.logE方法代码示例

本文整理汇总了Java中locus.api.utils.Logger.logE方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.logE方法的具体用法?Java Logger.logE怎么用?Java Logger.logE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在locus.api.utils.Logger的用法示例。


在下文中一共展示了Logger.logE方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readObject

import locus.api.utils.Logger; //导入方法依赖的package包/类
@Override
protected void readObject(int version, DataReaderBigEndian dr) throws IOException {
	super.readObject(version, dr);
	mGuideType = dr.readBytes(1)[0];
	mNavPointAction1Id = dr.readInt();
	mNavPointAction2Id = dr.readInt();
	mNavPoint1Dist = dr.readDouble();
	mUnitsFormatLength = dr.readBytes(1)[0];
	mZoomDevice = dr.readBytes(1)[0];
	mZoomWear = dr.readBytes(1)[0];
	mStatus = dr.readBytes(1)[0];
	boolean isMap = dr.readBoolean();
	try {
		mLoadedMap = isMap ? (ActionTools.BitmapLoadResult) dr.readStorable(ActionTools.BitmapLoadResult.class) : null;
	} catch (Exception e) {
		mLoadedMap = null;
		Logger.logE(TAG, "Could not read map image.", e);
	}
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:20,代码来源:MapContainer.java

示例2: setBreaksData

import locus.api.utils.Logger; //导入方法依赖的package包/类
public void setBreaksData(byte[] data) {
	// check data
	if (data == null || data.length == 0) {
		return;
	}

       // read indexes from data
	try {
		DataReaderBigEndian dr = new DataReaderBigEndian(data);
		breaks.clear();
		while (dr.available() > 0) {
			breaks.add(dr.readInt());
		}
	} catch (Exception e) {
		Logger.logE(TAG, "setBreaksData()", e);
		breaks.clear();
	}
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:19,代码来源:Track.java

示例3: getBitmap

import locus.api.utils.Logger; //导入方法依赖的package包/类
public static byte[] getBitmap(Bitmap bitmap, Bitmap.CompressFormat format) {
    ByteArrayOutputStream baos = null;
    try {
        baos = new ByteArrayOutputStream();
        // create compressed byte array. Value 80 is used for JPEG. PNG format ignore this value
        if (bitmap.compress(format, 80, baos)) {
            return baos.toByteArray();
        } else {
            Logger.logW(TAG, "Problem with converting image to byte[]");
            return null;
        }
    } catch (Exception e) {
        Logger.logE(TAG, "getBitmap(" + bitmap + ")", e);
        return null;
    } finally {
        locus.api.utils.Utils.closeStream(baos);
    }
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:19,代码来源:UtilsBitmap.java

示例4: onActivityResult

import locus.api.utils.Logger; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
	super.onActivityResult(requestCode, resultCode, data);
	if (requestCode == TrackRecordProfileSelectLayout.PICK_PROFILE_REQUEST && resultCode == Activity.RESULT_OK) {
		byte[] profileBytes = data.getByteArrayExtra(ProfileListActivity.RESULT_PROFILES);
		try {
			mProfileSelect.setParameters(new TrackProfileInfoValue(profileBytes));
			AppPreferencesManager.persistLastTrackRecProfile(this, mProfileSelect.getProfile());
		} catch (IOException e) {
			Logger.logE("TAG", "empty profile bytes", e);

		}
	} else {
		// refresh profile select even after canceled -> force refresh icon
		mProfileSelect.setParameters(mProfileSelect.getProfile());
	}
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:18,代码来源:TrackRecordActivity.java

示例5: createLocusVersion

import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
 * Get LocusVersion for specific, known packageName. This method should not be used
 * in common work-flow. Better is receive list of versions and pick correct, or create
 * LocusVersion from received intent.
 * @param ctx current context
 * @param packageName Locus package name
 * @return generated Locus version
 */
public static LocusVersion createLocusVersion(Context ctx, String packageName) {
	try {
		// check package name
		if (packageName == null || packageName.length() == 0 ||
				!packageName.startsWith("menion.android.locus")) {
			return null;
		}
		
		// get information about version			
		PackageManager pm = ctx.getPackageManager();
		PackageInfo info = pm.getPackageInfo(packageName, 0);
		if (info == null) {
			return null;
		}
		
		// finally add item to list
		return new LocusVersion(packageName, info.versionName, info.versionCode);
	} catch (Exception e) {
		Logger.logE(TAG, "getLocusVersion(" + ctx + ", " + packageName + ")", e);
		return null;
	}
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:31,代码来源:LocusUtils.java

示例6: onStart

import locus.api.utils.Logger; //导入方法依赖的package包/类
@Override
public void onStart() {
	super.onStart();
	
	// register update handler
	try {
		PeriodicUpdateReceiver.setOnUpdateListener(this, updateHandler);
	} catch (RequiredVersionMissingException e) {
		Logger.logE(TAG, "onStart()", e);
	}

	// set info text
	handleUpdate(null);
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:15,代码来源:ActivityDashboard.java

示例7: createStorableForPath

import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
 * Transforms DataItem object to custom data container which type depends on given path type
 *
 * @param p
 * @param item
 * @param <E>
 * @return
 */
public <E extends TimeStampStorable> E createStorableForPath(DataPath p, DataItem item) {
	Class<? extends TimeStampStorable> clazz = p.getContainerClass();
	if (clazz.getSimpleName().equals(EmptyCommand.class.getSimpleName())) {
		return null;
	}
	try {
		Map<String, DataItemAsset> assets = item.getAssets();
		DataItemAsset asset = assets == null ? null : assets.get(DataPath.DEFAULT_ASSET_KEY);
		if (asset == null) {
			return (E) clazz.getConstructor(byte[].class).newInstance(item.getData());
		} else {
			// blocking call - asset receive
			InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
					mGoogleApiClient, asset).await().getInputStream();
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			int nRead;
			byte[] buffer = new byte[0x1000];
			while ((nRead = assetInputStream.read(buffer, 0, buffer.length)) != -1) {
				baos.write(buffer, 0, nRead);
			}
			return (E) clazz.getConstructor(byte[].class).newInstance(baos.toByteArray());
		}
	} catch (Exception e) {
		Logger.logE("DataPath", "Constructor failed for " + p.name(), e);
		return null;
	}
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:36,代码来源:LocusWearCommService.java

示例8: trackRecordStart

import locus.api.utils.Logger; //导入方法依赖的package包/类
private void trackRecordStart(String profileName) {
  	try {
	ActionTools.actionTrackRecordStart(mContext, mLocusVersion, profileName);
} catch (RequiredVersionMissingException e) {
	Logger.logE(TAG, "trackRecordStart()", e);
}
  }
 
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:8,代码来源:ControlSmartWatch2.java

示例9: trackRecordPause

import locus.api.utils.Logger; //导入方法依赖的package包/类
private void trackRecordPause() {
  	try {
	ActionTools.actionTrackRecordPause(mContext, mLocusVersion);
} catch (RequiredVersionMissingException e) {
	Logger.logE(TAG, "trackRecordPause()", e);
}
  }
 
开发者ID:asamm,项目名称:locus-addon-smartwatch2,代码行数:8,代码来源:ControlSmartWatch2.java

示例10: getItemPurchaseState

import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
 * Allows to check if item with known ID is already purchased by user.
 * @param ctx current context
 * @param lv version of Locus that's asked
 * @param itemId know ID of item
 * @return ItemPurchaseState state of purcahse
 * @throws RequiredVersionMissingException if Locus in required version is missing
 */
public static int getItemPurchaseState(Context ctx, LocusVersion lv, long itemId)
		throws RequiredVersionMissingException {
	// get scheme if valid Locus is available
	Uri scheme = getProviderUriData(lv, VersionCode.UPDATE_06,
			LocusConst.CONTENT_PROVIDER_PATH_ITEM_PURCHASE_STATE);
	scheme = ContentUris.withAppendedId(scheme, itemId);

	// get data
	Cursor cursor = null;
	try {
		cursor = queryData(ctx, scheme, null);
		if (cursor == null || !cursor.moveToFirst()) {
			return LocusConst.PURCHASE_STATE_UNKNOWN;
		}

		// search for a valid key
		for (int i = 0; i < cursor.getCount(); i++)  {
			cursor.moveToPosition(i);
			String key = cursor.getString(0);
			if (key.equals("purchaseState")) {
				return cursor.getInt(1);
			}
		}
	} catch (Exception e) {
		Logger.logE(TAG, "getItemPurchaseState(" + ctx + ", " + lv + ")", e);
	} finally {
		Utils.closeQuietly(cursor);
	}

	// return 'unknown' state
	return LocusConst.PURCHASE_STATE_UNKNOWN;
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:41,代码来源:ActionTools.java

示例11: persistIcon

import locus.api.utils.Logger; //导入方法依赖的package包/类
public static void persistIcon(Context ctx, TrackProfileIconValue value) {
	if (value == null || value.getIcon() == null)
		return;
	try (FileOutputStream fos = new FileOutputStream(new File(ctx.getCacheDir(), ICON_PREFIX + value.getId()))){
		fos.write(value.getIcon());
	} catch (IOException e) {
		Logger.logE(TAG, "Cache write failed", e);
	}
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:10,代码来源:AppStorageManager.java

示例12: setStyles

import locus.api.utils.Logger; //导入方法依赖的package包/类
public void setStyles(byte[] data) {
	try {
		readStyles(new DataReaderBigEndian(data));
	} catch (Exception e) {
		Logger.logE(TAG, "setExtraStyle(" + data + ")", e);
		extraData = null;
	}
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:9,代码来源:GeoData.java

示例13: getLocusTrack

import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
   * Get full track from Locus database with all possible information, like
   * {@link GeoDataExtra} object
   *  or {@link GeoDataStyle} and others
   * @param ctx current context
   * @param trackId unique ID of track in Locus database
   * @return {@link locus.api.objects.extra.Track} or <i>null</i> in case of problem
   * @throws RequiredVersionMissingException if Locus in required version is missing
   */
  public static Track getLocusTrack(Context ctx, LocusVersion lv, long trackId)
          throws RequiredVersionMissingException {
      // check version
      int minVersion = VersionCode.UPDATE_10.vcFree;
      if (!LocusUtils.isLocusFreePro(lv, minVersion)) {
          throw new RequiredVersionMissingException(minVersion);
      }

      // generate cursor
      Cursor cursor;
      Uri scheme = getProviderUriData(lv, VersionCode.UPDATE_10,
              LocusConst.CONTENT_PROVIDER_PATH_TRACK);
scheme = ContentUris.withAppendedId(scheme, trackId);
cursor = ctx.getContentResolver().query(scheme,
		null, null, null, null);

      // check cursor
      if (cursor == null || !cursor.moveToFirst()) {
          Logger.logW(TAG, "getLocusTrack(" + ctx + ", " + trackId + "), " +
                  "'cursor' in not valid");
          return null;
      }

      // handle result
      try {
          return new Track(cursor.getBlob(1));
      } catch (Exception e) {
          Logger.logE(TAG, "getLocusTrack(" + ctx + ", " + trackId + ")", e);
      } finally {
          Utils.closeQuietly(cursor);
      }
      return null;
  }
 
开发者ID:asamm,项目名称:locus-api,代码行数:43,代码来源:ActionTools.java

示例14: onCreate

import locus.api.utils.Logger; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_profile_list);
	TextView header = findViewById(R.id.text_view_screen_header);
	if (header != null) {
		header.setText(getText(R.string.title_activity_profile_list));
	}
	mRecyclerView = findViewById(R.id.profile_list);
	mRecyclerView.setEdgeItemsCenteringEnabled(true);
	mRecyclerView.setLayoutManager(
			new WearableLinearLayoutManager(this));
	mRecyclerView.setHasFixedSize(true);

	mSelectedProfileName = getIntent().getExtras().getString(ARG_SELECTED_PROFILE_NAME, "");
	byte[] arr = getIntent().getExtras().getByteArray(ARG_PROFILES);
	if (arr != null && arr.length > 0) {
		try {
			mProfiles = new TrackProfileInfoValue.ValueList(arr);
		} catch (IOException e) {
			Logger.logE(TAG, "profile info constructor failed", e);
			finish();
		}
	}

	mAdapter = new ProfileListAdapter(mProfiles.getStorables().toArray(new TrackProfileInfoValue[0]));
	mRecyclerView.setAdapter(mAdapter);

	// Enables Always-on
	//setAmbientEnabled();
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:32,代码来源:ProfileListActivity.java

示例15: setGeocachingData

import locus.api.utils.Logger; //导入方法依赖的package包/类
public void setGeocachingData(byte[] data) {
	try {
		gcData = readGeocachingData(new DataReaderBigEndian(data));
	} catch (Exception e) {
		Logger.logE(TAG, "setGeocachingData(" + data + ")", e);
		gcData = null;
	}
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:9,代码来源:Waypoint.java


注:本文中的locus.api.utils.Logger.logE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。