本文整理汇总了Java中com.o3dr.android.client.Drone.getGps方法的典型用法代码示例。如果您正苦于以下问题:Java Drone.getGps方法的具体用法?Java Drone.getGps怎么用?Java Drone.getGps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.o3dr.android.client.Drone
的用法示例。
在下文中一共展示了Drone.getGps方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateItemView
import com.o3dr.android.client.Drone; //导入方法依赖的package包/类
@Override
public void updateItemView(final Context context, final Drone drone) {
if (mItemView != null) {
String update = "--";
if(drone != null && drone.isConnected()) {
final Gps droneGps = drone.getGps();
final Home droneHome = drone.getHome();
if(droneGps.isValid() && droneHome.isValid()) {
double distanceToHome = MathUtils.getDistance(droneHome.getCoordinate(),
droneGps.getPosition());
update = String.format("Home\n%s", UnitManager.getUnitProvider()
.distanceToString(distanceToHome));
}
}
((TextView) mItemView).setText(update);
}
}
示例2: goToDroneLocation
import com.o3dr.android.client.Drone; //导入方法依赖的package包/类
@Override
public void goToDroneLocation() {
Drone dpApi = getDroneApi();
if (!dpApi.isConnected())
return;
Gps gps = dpApi.getGps();
if (!gps.isValid()) {
Toast.makeText(getActivity().getApplicationContext(), R.string.drone_no_location, Toast.LENGTH_SHORT).show();
return;
}
final float currentZoomLevel = getBaiduMap().getMapStatus().zoom;
final LatLong droneLocation = gps.getPosition();
updateCamera(droneLocation, (int) currentZoomLevel);
}
示例3: updateGps
import com.o3dr.android.client.Drone; //导入方法依赖的package包/类
private void updateGps(Drone drone) {
if (mInboxBuilder == null)
return;
Gps droneGps = drone.getGps();
String update = droneGps == null ? "--" : String.format(
"%d, %s", droneGps.getSatellitesCount(), droneGps.getFixType());
mInboxBuilder.setLine(1, SpannableUtils.normal("Satellite: ", SpannableUtils.bold(update)));
}
示例4: onReceive
import com.o3dr.android.client.Drone; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
final Drone drone = getDroneApi();
if (!drone.isConnected())
return;
final Gps droneGps = drone.getGps();
if (droneGps == null)
return;
if (mPanMode.get() == AutoPanMode.DRONE && droneGps.isValid()) {
final LatLong droneLocation = droneGps.getPosition();
updateCamera(droneLocation);
}
}