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


Java LocusInfo类代码示例

本文整理汇总了Java中locus.api.android.utils.LocusInfo的典型用法代码示例。如果您正苦于以下问题:Java LocusInfo类的具体用法?Java LocusInfo怎么用?Java LocusInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: loadHandShake

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
/**
 * Load basic data from current Locus application.
 */
private HandShakeValue loadHandShake(Context ctx) {
	LocusInfo locusInfo = null;

	try {
		// check if object exists
		if (lv != null) {
			// handle info
			locusInfo = ActionTools.getLocusInfo(ctx, lv);
		}
	} catch (RequiredVersionMissingException e) {
		Logger.logE(TAG, "loadHandShake", e);
		// clear data
		locusInfo = null;
	}

	// prepare container with data and send it
	HandShakeValue value = lv == null ?
			new HandShakeValue() :
			new HandShakeValue(lv.getVersionCode(),
					locusInfo != null && locusInfo.isRunning(),
					locusInfo != null && locusInfo.isPeriodicUpdatesEnabled());
	return value;
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:27,代码来源:DeviceCommService.java

示例2: loadTrackRecordingValue

import locus.api.android.utils.LocusInfo; //导入依赖的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;
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:22,代码来源:DeviceCommService.java

示例3: MapContainer

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
public MapContainer(ActionTools.BitmapLoadResult loadedMap, UpdateContainer mLastUpdate, LocusInfo li, int zoom) {
	this();
	mLoadedMap = loadedMap;
	if (mLastUpdate != null) {
		mZoomDevice = (byte) mLastUpdate.getMapZoomLevel();
		mZoomWear = (byte) zoom;
		mGuideType = (byte) mLastUpdate.getGuideType();
		UpdateContainer.GuideTypeTrack guide = mLastUpdate.getGuideTypeTrack();
		if (guide != null) {
			mStatus |= guide.isValid() ? NAV_VALID_FLAG : 0;
			mNavPointAction1Id = guide.getNavPoint1Action().getId();
			mNavPointAction2Id = guide.getNavPoint2Action().getId();
			mNavPoint1Dist = guide.getNavPoint1Dist();
			if (li != null) {
				mUnitsFormatLength = (byte) li.getUnitsFormatLength();
			}
		}
	}
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:20,代码来源:MapContainer.java

示例4: getLocusInfo

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
/**
 * Return complete information about required LocusVersion. LocusInfo object
 * contains all main parameters of existing Locus installation, together with
 * some user preferences etc. More in LocusInfo object
 * @param ctx current context
 * @param lv version of Locus that's asked
 * @return {@link LocusInfo} object or <code>null</code> if problem happen. It's
 * always required to check that return value is correct!
 * @throws RequiredVersionMissingException if Locus in required version is missing
 */
public static LocusInfo getLocusInfo(Context ctx, LocusVersion lv)
		throws RequiredVersionMissingException {
	// get scheme if valid Locus is available
	Uri scheme = getProviderUriData(lv, VersionCode.UPDATE_01,
			LocusConst.CONTENT_PROVIDER_PATH_INFO);

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

		// return info container
		return LocusInfo.create(cursor);
	} catch (Exception e) {
		Logger.logE(TAG, "getLocusInfo(" + ctx + ", " + lv + ")", e);
	} finally {
		Utils.closeQuietly(cursor);
	}
	return null;
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:34,代码来源:ActionTools.java

示例5: getDataLocusInfo

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
/**
 * Get LocusInfo container with various Locus app parameters.
 * @param ctx current context
 * @param lv required Locus version
 * @return loaded info container or 'null' in case of problem
 * @throws RequiredVersionMissingException if Locus in required version is missing
 */
public static LocusInfo getDataLocusInfo(Context ctx, LocusVersion lv)
		throws RequiredVersionMissingException {
	// get scheme if valid Locus is available
	Uri scheme = getProviderUriData(lv, VersionCode.UPDATE_13,
			LocusConst.CONTENT_PROVIDER_PATH_DATA + "/" + LocusConst.VALUE_LOCUS_INFO);

	// execute action
	Cursor cursor = null;
	try {
		byte[] data = queryData(ctx, scheme, null, LocusConst.VALUE_LOCUS_INFO);
		if (data != null && data.length > 0) {
			return new LocusInfo(data);
		}
	} catch (Exception e) {
		Logger.logE(TAG, "getDataLocusInfo(" + ctx + ", " + lv + ")", e);
	}
	return null;
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:26,代码来源:ActionTools.java

示例6: TrackRecordingValue

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
public TrackRecordingValue(boolean infoAvailable, boolean isTrackRecording, boolean isPaused,
						   String trackRecProfileName, TrackStats trackStats, LocusInfo info,
						   ExtendedTrackInfo ext) {
	super();
	this.infoAvailable = infoAvailable;
	this.trackRecRecording = isTrackRecording;
	this.trackRecPaused = isPaused;
	this.trackRecProfileName = trackRecProfileName;
	this.trackRecStats = trackStats;
	if (info != null) {
		fillUnitsFormatInfo(info);
	}
	this.mExtendedTrackInfo = ext != null ? ext : new ExtendedTrackInfo();
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:15,代码来源:TrackRecordingValue.java

示例7: fillUnitsFormatInfo

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
private void fillUnitsFormatInfo(LocusInfo info) {
	mUnitsPacked1 = (byte) (info.getUnitsFormatTemperature()
			| info.getUnitsFormatSlope() << 2
			| info.getUnitsFormatEnergy() << 4
			| info.getUnitsFormatAltitude() << 6);
	mUnitsPacked2 = (byte) (info.getUnitsFormatLength() | info.getUnitsFormatArea() << 4);
	mUnitsPacked3 = (byte) (info.getUnitsFormatAngle()
			| info.getUnitsFormatWeight() << 3
			| info.getUnitsFormatSpeed() << 5);
}
 
开发者ID:asamm,项目名称:locus-addon-wearables,代码行数:11,代码来源:TrackRecordingValue.java

示例8: getLocusRootDirectory

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
/**
 * Use getLocusInfo() instead
 */
@Deprecated
public static String getLocusRootDirectory(Context context)
		throws RequiredVersionMissingException {
	LocusInfo locusInfo = getLocusInfoData(context);
	if (locusInfo != null) {
		return locusInfo.getRootDirectory();
	} else {
		return null;
	}
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:14,代码来源:ActionTools.java

示例9: isPeriodicUpdatesEnabled

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
/**
 * Use getLocusInfo() instead
 */
@Deprecated
public static boolean isPeriodicUpdatesEnabled(Context context)
		throws RequiredVersionMissingException {
	LocusInfo locusInfo = getLocusInfoData(context);
	return locusInfo != null &&
			locusInfo.isPeriodicUpdatesEnabled();
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:11,代码来源:ActionTools.java

示例10: getLocusInfoData

import locus.api.android.utils.LocusInfo; //导入依赖的package包/类
@Deprecated
private static LocusInfo getLocusInfoData(Context ctx)
		throws RequiredVersionMissingException {
	return getLocusInfo(ctx, LocusUtils.createLocusVersion(ctx));
}
 
开发者ID:asamm,项目名称:locus-api,代码行数:6,代码来源:ActionTools.java


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