本文整理汇总了Java中locus.api.utils.Logger.logW方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.logW方法的具体用法?Java Logger.logW怎么用?Java Logger.logW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类locus.api.utils.Logger
的用法示例。
在下文中一共展示了Logger.logW方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadTrackRecordingValue
import locus.api.utils.Logger; //导入方法依赖的package包/类
private TrackRecordingValue loadTrackRecordingValue(Context ctx) {
boolean infoAvailable = mLastUpdate != null;
boolean myLocAvailable = infoAvailable && mLastUpdate.getLocMyLocation() != null;
boolean trackRec = infoAvailable && mLastUpdate.isTrackRecRecording();
boolean trackRecPause = infoAvailable && mLastUpdate.isTrackRecPaused();
String profileName = infoAvailable ? mLastUpdate.getTrackRecProfileName() : "";
Float speed = myLocAvailable ? mLastUpdate.getLocMyLocation().getSpeed() : null;
TrackStats stats = infoAvailable ? mLastUpdate.getTrackRecStats() : null;
LocusInfo locusInfo = null;
try {
locusInfo = ActionTools.getLocusInfo(ctx, lv);
} catch (RequiredVersionMissingException e) {
Logger.logW(TAG, "Missing required version, current version " + lv);
}
TrackRecordingValue trv = new TrackRecordingValue(infoAvailable, trackRec, trackRecPause,
profileName, stats, locusInfo, new TrackRecordingValue.ExtendedTrackInfo(speed));
return trv;
}
示例2: isValid
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Check if container contains valid data.
* @return <code>true</code> if data are valid, otherwise returns
* <code>false</code>
*/
public boolean isValid(int requestedType) {
// check types
if (mDataType != requestedType) {
Logger.logW(TAG, "isValid(" + requestedType + "), " +
"invalid type:" + mDataType);
return false;
}
// check by types
if (mDataType == DATA_TYPE_CONFIGURATION) {
return mMapConfigs != null && mMapConfigs.size() > 0;
} else if (mDataType == DATA_TYPE_TILE_REQUEST) {
return mMapTileRequest != null;
} else if (mDataType == DATA_TYPE_TILE_RESPONSE) {
return mMapTileResponse != null;
}
return false;
}
示例3: setTag
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Set new tag/object defined by key.
* @param key key that define object
* @param value object itself or 'null' if we wants to remove it
*/
public void setTag(String key, Object value) {
// check key
if (key == null || key.length() == 0) {
Logger.logW(TAG, "setTag(" + key + "), " +
"invalid key");
return;
}
// set tag
if (value == null) {
if (mTags != null) {
mTags.remove(key);
}
} else {
if (mTags == null) {
mTags = new Hashtable<>();
}
mTags.put(key, value);
}
}
示例4: setIconStyleHotSpot
import locus.api.utils.Logger; //导入方法依赖的package包/类
public void setIconStyleHotSpot(int hotspot) {
if (iconStyle == null) {
Logger.logW(TAG, "setIconStyleHotSpot(" + hotspot + "), " +
"initialize IconStyle before settings hotSpot!");
return;
}
if (hotspot == HOTSPOT_TOP_LEFT) {
iconStyle.hotSpot = new KmlVec2(
0.0f, KmlVec2.Units.FRACTION, 1.0f, KmlVec2.Units.FRACTION);
} else if (hotspot == HOTSPOT_CENTER_CENTER) {
iconStyle.hotSpot = new KmlVec2(
0.5f, KmlVec2.Units.FRACTION, 0.5f, KmlVec2.Units.FRACTION);
} else {
// hotspot == HOTSPOT_BOTTOM_CENTER
iconStyle.hotSpot = generateDefaultHotSpot();
}
}
示例5: getTag
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Get tag attached to object, defined by "key".
* @param key key value that defined object
* @return required object otherwise 'null'
*/
public Object getTag(String key) {
// check key
if (key == null || key.length() == 0) {
Logger.logW(TAG, "getTag(" + key + "), " +
"invalid key");
return null;
}
// get tag
if (mTags == null) {
return null;
} else {
return mTags.get(key);
}
}
示例6: callSendMorePointsGeocacheFileMethod
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Send more geocaches with method, that store byte[] data in raw file and send locus link to this file.
* This method is useful in case of bigger number of caches that already has some troubles with
* method over intent.
* @param ctx current context
*/
public static void callSendMorePointsGeocacheFileMethod(Context ctx) throws RequiredVersionMissingException {
// get filepath
File externalDir = ctx.getExternalCacheDir();
if (externalDir == null || !(externalDir.exists())) {
Logger.logW(TAG, "problem with obtain of External dir");
return;
}
// prepare data
PackWaypoints pw = new PackWaypoints("test07");
for (int i = 0; i < 1000; i++) {
pw.addWaypoint(generateGeocache(i));
}
ArrayList<PackWaypoints> data = new ArrayList<>();
data.add(pw);
// send data
boolean send = ActionDisplayPoints.sendPacksFile(ctx, data,
new File(externalDir, "testFile.locus").getAbsolutePath(), ExtraAction.CENTER);
Logger.logD(TAG, "callSendMorePointsGeocacheFileMethod(), " +
"send:" + send);
}
示例7: refreshTrackRecordingLayout
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Refresh content of 'Track recording' layout.
*/
private void refreshTrackRecordingLayout() {
if (!mLastUpdate.isTrackRecRecording()) {
// check existence of track record profiles
if (mTrackRecProfiles == null || mTrackRecProfiles.size() == 0) {
refreshEmptyLayout(mContext.getString(R.string.track_record_no_profiles), false);
} else {
// set correct layout
if (setLayout(R.layout.screen_track_record_start)) {
Logger.logW(TAG, " sendListCount(), " + mTrackRecProfiles.size());
sendListCount(R.id.list_view_profiles, mTrackRecProfiles.size());
sendListPosition(R.id.list_view_profiles, 0);
}
}
} else {
// set correct layout
setLayout(R.layout.screen_track_record_running);
TrackStats stats = mLastUpdate.getTrackRecStats();
// update title
sendText(R.id.text_view_screen_title,
mLastUpdate.getTrackRecProfileName());
// update text content
sendText(R.id.text_view_info_01, UtilsFormat.formatDistance(
mLocusInfo.getUnitsFormatLength(), stats.getTotalLength(), false));
sendText(R.id.text_view_info_02,
TIME_FORMAT.format(stats.getTotalTime()));
}
}
示例8: setCurrentActivity
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Set reference to current activity.
*
* @param activity current activity
*/
private void setCurrentActivity(Activity activity) {
if (activity instanceof AppFailActivity) {
if (mTimerTerminate != null) {
mTimerTerminate.cancel();
mTimerTerminate = null;
}
if (mCurrentActivity != null) {
mCurrentActivity.finish();
}
mCurrentActivity = null;
onDestroy();
return;
}
LocusWearActivity act = (LocusWearActivity) activity;
if (mCurrentActivity != null && act != null && !act.isChildLocusWearActivity()) {
mCurrentActivity.finish();
}
Logger.logD(TAG, "setCurrentActivity(" + act + ")");
// if new activity is registered, end timer
if (act != null && mTimerTerminate != null) {
mTimerTerminate.cancel();
mTimerTerminate = null;
}
// register activity
if (mCurrentActivity == null && act != null) {
Logger.logW(TAG, " - application restored");
} else if (mCurrentActivity != null && act == null) {
Logger.logW(TAG, " - application terminated");
setTerminationTimer();
}
LocusWearActivity previous = mCurrentActivity;
mCurrentActivity = act;
if (mWatchDog != null) {
mWatchDog.onCurrentActivityChanged(previous == null ? null : previous.getClass(),
mCurrentActivity == null ? null : mCurrentActivity.getClass());
}
}
示例9: enableReceiver
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Enable updates receiver.
*
* @param ctx current context
*/
protected static void enableReceiver(Context ctx) {
try {
ActionTools.enablePeriodicUpdatesReceiver(ctx,
LocusUtils.getActiveVersion(ctx),
PeriodicUpdatesReceiver.class);
Logger.logD(TAG, "periodic receiver enabled");
} catch (RequiredVersionMissingException e) {
Logger.logW(TAG, "enableReceiver(" + ctx + "), missing required version!");
}
}
示例10: setPoints
import locus.api.utils.Logger; //导入方法依赖的package包/类
public boolean setPoints(List<Location> points) {
if (points == null) {
Logger.logW(TAG, "setPoints(), cannot be null!");
return false;
}
this.points = points;
return true;
}
示例11: setCacheID
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Set new cache code to cache.
* @param cacheID new cache ID (code)
*/
public void setCacheID(String cacheID) {
// check cache ID
if (cacheID == null || cacheID.length() == 0) {
Logger.logW(TAG, "setCacheId(" + cacheID + "), " +
"invalid cache ID");
return;
}
// define source and set values
int source = CACHE_SOURCE_UNDEFINED;
String testCode = cacheID.trim().toUpperCase();
if (testCode.startsWith("GC")) {
source = CACHE_SOURCE_GEOCACHING_COM;
} else if (testCode.startsWith("OB")) {
source = CACHE_SOURCE_OPENCACHING_NL;
} else if (testCode.startsWith("OK")) {
source = CACHE_SOURCE_OPENCACHING_UK;
} else if (testCode.startsWith("OP")) {
source = CACHE_SOURCE_OPENCACHING_PL;
} else if (testCode.startsWith("OU")) {
source = CACHE_SOURCE_OPENCACHING_US;
} else if (testCode.startsWith("OZ")) {
source = CACHE_SOURCE_OPENCACHING_CZ;
} else if (testCode.startsWith("O")) {
source = CACHE_SOURCE_OPENCACHING;
}
// finally set cache ID
setCacheID(cacheID, source);
}
示例12: showPoints
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Show points in AR add-on application.
* @param act current activity
* @param data packs of points to display
* @param yourLoc current users location
* @param guidedWptId ID of point on which is currently active guidance
* @return {@code true} if add-on was correctly called
*/
public static boolean showPoints(Activity act, List<PackWaypoints> data,
Location yourLoc, long guidedWptId) {
if (!isInstalled(act)) {
Logger.logW(TAG, "missing required version " + REQUIRED_VERSION);
return false;
}
// prepare intent
Intent intent = new Intent(INTENT_VIEW);
intent.putExtra(LocusConst.INTENT_EXTRA_POINTS_DATA_ARRAY,
Storable.getAsBytes(data));
intent.putExtra(EXTRA_LOCATION,
yourLoc.getAsBytes());
intent.putExtra(EXTRA_GUIDING_ID, guidedWptId);
// check intent firstly
if (!ActionDisplay.hasData(intent)) {
Logger.logW(TAG, "Intent 'null' or not contain any data");
return false;
}
// store location
mLastLocation = yourLoc;
// finally start activity
act.startActivityForResult(intent, REQUEST_ADDON_AR);
return true;
}
示例13: writeBitmap
import locus.api.utils.Logger; //导入方法依赖的package包/类
public static void writeBitmap(DataWriterBigEndian dw, Bitmap bitmap,
Bitmap.CompressFormat format) throws IOException {
if (bitmap == null) {
dw.writeInt(0);
} else {
byte[] data = getBitmap(bitmap, format);
if (data == null || data.length == 0) {
Logger.logW(TAG, "writeBitmap(), unknown problem");
dw.writeInt(0);
} else {
dw.writeInt(data.length);
dw.write(data);
}
}
}
示例14: setParameterRteAction
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Set Rte action for current point.
* @param action action
*/
public void setParameterRteAction(PointRteAction action) {
// check action
if (action == null) {
Logger.logW(TAG, "setParameterRteAction(), " +
"attempt to set invalid parameter");
return;
}
// store value
addParameter(GeoDataExtra.PAR_RTE_POINT_ACTION, action.getId());
}
示例15: getLocusWaypoint
import locus.api.utils.Logger; //导入方法依赖的package包/类
/**
* Get full waypoint from Locus database with all possible information, like
* {@link GeoDataExtra} object, {@link locus.api.objects.extra.Location}
* or {@link GeoDataStyle} and others
* @param ctx current context
* @param wptId unique ID of waypoint in Locus database
* @return {@link locus.api.objects.extra.Waypoint} or {@code null} in case of problem
* @throws RequiredVersionMissingException if Locus in required version is missing
*/
public static Waypoint getLocusWaypoint(Context ctx, LocusVersion lv, long wptId)
throws RequiredVersionMissingException {
// check version
int minVersion = VersionCode.UPDATE_01.vcFree;
if (!LocusUtils.isLocusFreePro(lv, minVersion)) {
throw new RequiredVersionMissingException(minVersion);
}
// generate cursor
Cursor cursor;
Uri scheme = getProviderUriData(lv, VersionCode.UPDATE_01,
LocusConst.CONTENT_PROVIDER_PATH_WAYPOINT);
scheme = ContentUris.withAppendedId(scheme, wptId);
cursor = ctx.getContentResolver().query(scheme,
null, null, null, null);
// check cursor
if (cursor == null || !cursor.moveToFirst()) {
Logger.logW(TAG, "getLocusWaypoint(" + ctx + ", " + wptId + "), " +
"'cursor' in not valid");
return null;
}
// handle result
try {
return new Waypoint(cursor.getBlob(1));
} catch (Exception e) {
Logger.logE(TAG, "getLocusWaypoint(" + ctx + ", " + wptId + ")", e);
} finally {
Utils.closeQuietly(cursor);
}
return null;
}