本文整理汇总了Java中com.playuav.android.DroidPlannerApp类的典型用法代码示例。如果您正苦于以下问题:Java DroidPlannerApp类的具体用法?Java DroidPlannerApp怎么用?Java DroidPlannerApp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DroidPlannerApp类属于com.playuav.android包,在下文中一共展示了DroidPlannerApp类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGATracker
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
public static void initGATracker(DroidPlannerApp app) {
if (sAppTracker == null) {
final Context context = app.getApplicationContext();
final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
// Call is needed for now to allow dispatching of auto activity
// reports
// (http://stackoverflow.com/a/23256722/1088814)
analytics.enableAutoActivityReports(app);
analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());
// If we're in debug mode, set log level to verbose.
if (BuildConfig.DEBUG) {
analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
}
sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
}
}
示例2: initGATracker
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
public static void initGATracker(DroidPlannerApp app) {
if (sAppTracker == null) {
final Context context = app.getApplicationContext();
final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
// Call is needed for now to allow dispatching of auto activity reports
// (http://stackoverflow.com/a/23256722/1088814)
analytics.enableAutoActivityReports(app);
analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());
// If we're in debug mode, set log level to verbose.
if (BuildConfig.DEBUG) {
analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
}
sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
}
}
示例3: onItemClick
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Cancel discovery because it's costly, and we're about to connect
mBtAdapter.cancelDiscovery();
// Retrieve the selected bluetooth device
final BluetoothDevice device = (BluetoothDevice) parent.getItemAtPosition(position);
// Stores the mac address in the shared preferences,
// so the bluetooth client can retrieve it on connection.
final Context context = getApplicationContext();
DroidPlannerPrefs mAppPrefs = new DroidPlannerPrefs(context);
mAppPrefs.setBluetoothDeviceAddress(device.getAddress() + ";" + device.getName());
// Toggle the drone connection
DroidPlannerApp.connectToDrone(context);
// Finish the activity
finish();
}
示例4: StatusBarNotificationProvider
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
StatusBarNotificationProvider(Context context, Drone api) {
mContext = context;
this.drone = api;
mAppPrefs = new DroidPlannerPrefs(context);
mNotificationIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
FlightActivity.class), 0);
mToggleConnectionIntent = PendingIntent
.getBroadcast(mContext, 0, new Intent(DroidPlannerApp.ACTION_TOGGLE_DRONE_CONNECTION), 0);
LocalBroadcastManager.getInstance(context).registerReceiver(eventReceiver, eventFilter);
}
示例5: onReceive
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if(DroidPlannerApp.ACTION_DRONE_EVENT.equals(action)){
onInfoUpdate();
}
}
示例6: onCreate
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Context context = getApplicationContext();
dpApp = (DroidPlannerApp) getApplication();
lbm = LocalBroadcastManager.getInstance(context);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
}
mAppPrefs = new DroidPlannerPrefs(context);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
/*
* Used to supplant wake lock acquisition (previously in
* com.playuav.android.service .MAVLinkService) as suggested by the
* android android.os.PowerManager#newWakeLock documentation.
*/
if (mAppPrefs.keepScreenOn()) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
setVolumeControlStream(AudioManager.STREAM_MUSIC);
screenOrientation.unlock();
Utils.updateUILanguage(context);
}
示例7: doSysConnect
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
private void doSysConnect(CheckListItem checkListItem) {
boolean activated = checkListItem.isSys_activated();
boolean connected = drone.isConnected();
if (activated != connected) {
if (connected)
DroidPlannerApp.disconnectFromDrone(context);
else
DroidPlannerApp.connectToDrone(context);
}
}
示例8: onAttach
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
dpApp = (DroidPlannerApp) activity.getApplication();
}
示例9: onAttach
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onAttach(Activity activity){
super.onAttach(activity);
dpApp = (DroidPlannerApp) activity.getApplication();
broadcastManager = LocalBroadcastManager.getInstance(activity.getApplicationContext());
}
示例10: onAttach
import com.playuav.android.DroidPlannerApp; //导入依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
dpApp = (DroidPlannerApp) activity.getApplication();
broadcastManager = LocalBroadcastManager.getInstance(activity.getApplicationContext());
}