本文整理汇总了Java中locus.api.android.utils.LocusUtils.isLocusAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java LocusUtils.isLocusAvailable方法的具体用法?Java LocusUtils.isLocusAvailable怎么用?Java LocusUtils.isLocusAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类locus.api.android.utils.LocusUtils
的用法示例。
在下文中一共展示了LocusUtils.isLocusAvailable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionStartNavigation
import locus.api.android.utils.LocusUtils; //导入方法依赖的package包/类
/**
* Intent that starts navigation in Locus app based on defined target.
* @param act current activity
* @param name name of target
* @param latitude latitude of target
* @param longitude longitude of target
* @throws RequiredVersionMissingException if Locus in required version is missing
*/
public static void actionStartNavigation(Activity act,
String name, double latitude, double longitude)
throws RequiredVersionMissingException {
// check required version
if (!LocusUtils.isLocusAvailable(act, VersionCode.UPDATE_01)) {
throw new RequiredVersionMissingException(VersionCode.UPDATE_01);
}
// call Locus
Intent intent = new Intent(LocusConst.ACTION_NAVIGATION_START);
if (name != null) {
intent.putExtra(LocusConst.INTENT_EXTRA_NAME, name);
}
intent.putExtra(LocusConst.INTENT_EXTRA_LATITUDE, latitude);
intent.putExtra(LocusConst.INTENT_EXTRA_LONGITUDE, longitude);
act.startActivity(intent);
}
示例2: actionStartGuiding
import locus.api.android.utils.LocusUtils; //导入方法依赖的package包/类
/**************************************************/
public static void actionStartGuiding(Activity act,
String name, double latitude, double longitude)
throws RequiredVersionMissingException {
if (LocusUtils.isLocusAvailable(act, 243, 243, 0)) {
Intent intent = new Intent(LocusConst.ACTION_GUIDING_START);
if (name != null) {
intent.putExtra(LocusConst.INTENT_EXTRA_NAME, name);
}
intent.putExtra(LocusConst.INTENT_EXTRA_LATITUDE, latitude);
intent.putExtra(LocusConst.INTENT_EXTRA_LONGITUDE, longitude);
act.startActivity(intent);
} else {
throw new RequiredVersionMissingException(243);
}
}
示例3: callAddNewWmsMap
import locus.api.android.utils.LocusUtils; //导入方法依赖的package包/类
/**************************************************/
/*
Add own WMS map
------------------------------------
- this feature allow 3rd party application, add web address directly to list of WMS services in
Map Manager screen / WMS tab
*/
public static void callAddNewWmsMap(Context context, String wmsUrl)
throws RequiredVersionMissingException, InvalidObjectException {
// check availability and start action
if (!LocusUtils.isLocusAvailable(context, VersionCode.UPDATE_01)) {
throw new RequiredVersionMissingException(VersionCode.UPDATE_01);
}
if (TextUtils.isEmpty(wmsUrl)) {
throw new InvalidObjectException("WMS Url address \'" + wmsUrl + "\', is not valid!");
}
// call intent with WMS url
Intent intent = new Intent(LocusConst.ACTION_ADD_NEW_WMS_MAP);
intent.putExtra(LocusConst.INTENT_EXTRA_ADD_NEW_WMS_MAP_URL, wmsUrl);
context.startActivity(intent);
}
示例4: actionPickLocation
import locus.api.android.utils.LocusUtils; //导入方法依赖的package包/类
/**
* Start basic "Pick location" event.
* @param act current activity
* @throws RequiredVersionMissingException if Locus in required version is missing
*/
public static void actionPickLocation(Activity act)
throws RequiredVersionMissingException {
if (LocusUtils.isLocusAvailable(act, 235, 235, 0)) {
Intent intent = new Intent(LocusConst.ACTION_PICK_LOCATION);
act.startActivity(intent);
} else {
throw new RequiredVersionMissingException(235);
}
}