• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VehicleManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className, IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    // When the VehicleManager starts up, we store a reference to it
    // here in "mVehicleManager" so we can call functions on it
    // elsewhere in our code.
    mVehicleManager = ((VehicleManager.VehicleBinder) service)
            .getService();

    // We want to receive updates whenever the EngineSpeed changes. We
    // have an EngineSpeed.Listener (see above, mSpeedListener) and here
    // we request that the VehicleManager call its receive() method
    // whenever the EngineSpeed changes
    mVehicleManager.addListener(EngineSpeed.class, mSpeedListener);
    mVehicleManager.addListener(VehicleSpeed.class, mVehicleSpeedListener);
    //mVehicleManager.addListener(Longitude.class,longitudeListener);
    //mVehicleManager.addListener(Latitude.class,latitudeListener);

    setConnectionState(openXcState, true);


}
 
开发者ID:freeloki,项目名称:FordOpenXCHackathon,代码行数:22,代码来源:MainActivity.java


示例2: setUserVisibleHint

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser) {
        getActivity().bindService(
                new Intent(getActivity(), VehicleManager.class),
                mConnection, Context.BIND_AUTO_CREATE);
    } else {
        if(mVehicleManager != null) {
            Log.i(TAG, "Unbinding from vehicle service");
            mVehicleManager.removeListener(CanMessage.class, mListener);
            getActivity().unbindService(mConnection);
            mVehicleManager = null;
        }
    }
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:17,代码来源:CanMessageViewFragment.java


示例3: onReceive

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    BluetoothDevice bluetoothDevice = (BluetoothDevice)
        intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
    if(isVehicleInterface(bluetoothDevice)) {
        if(intent.getAction().compareTo(
                    BluetoothDevice.ACTION_ACL_CONNECTED) == 0){
            Log.d(TAG, "A Bluetooth OpenXC VI connected: " + bluetoothDevice.getName());
            context.startService(new Intent(context, VehicleManager.class));
            context.startService(new Intent(context,
                        PreferenceManagerService.class));
        } else {
            Log.d(TAG, "A Bluetooth OpenXC VI disconnected: " + bluetoothDevice.getName());
        }
    }
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:17,代码来源:BluetoothReceiver.java


示例4: setUserVisibleHint

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser) {
        getActivity().bindService(
                new Intent(getActivity(), VehicleManager.class),
                mConnection, Context.BIND_AUTO_CREATE);
    } else {
        if(mVehicleManager != null) {
            Log.i(TAG, "Unbinding from vehicle service");
            mVehicleManager.removeListener(SimpleVehicleMessage.class, mListener);
            getActivity().unbindService(mConnection);
            mVehicleManager = null;
        }
    }
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:17,代码来源:VehicleDashboardFragment.java


示例5: onCreate

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Log.i(TAG, "Service starting");

    bindService(new Intent(this, VehicleManager.class),
            mConnection, Context.BIND_AUTO_CREATE);

    mPreferenceManagers = new ArrayList<VehiclePreferenceManager>();
    mBluetoothPreferenceManager = new BluetoothPreferenceManager(this);
    mPreferenceManagers.add(mBluetoothPreferenceManager);
    mPreferenceManagers.add(new FileRecordingPreferenceManager(this));
    mPreferenceManagers.add(new GpsOverwritePreferenceManager(this));
    mPreferenceManagers.add(new NativeGpsPreferenceManager(this));
    mPreferenceManagers.add(new UploadingPreferenceManager(this));
    mPreferenceManagers.add(new NetworkPreferenceManager(this));
    mPreferenceManagers.add(new TraceSourcePreferenceManager(this));
    mPreferenceManagers.add(new UsbPreferenceManager(this));
    mPreferenceManagers.add(new VehicleInterfacePreferenceManager(this));
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:21,代码来源:PreferenceManagerService.java


示例6: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void
        onServiceConnected(ComponentName className, IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder) service)
            .getService();

    mIsBound = true;

    Integer gridPosition = getIntent().getExtras().getInt("pos");
    Class<? extends Measurement> measurementType = GridManager
            .getClass(gridPosition);
    mUpdateGraphTask = new GraphDataRetrieveTask(mVehicleManager,
            GrapherActivity.this, dataSeries, measurementType);
    mTimer = new Timer();
    mTimer.schedule(mUpdateGraphTask, 100, 1000);
}
 
开发者ID:openxc,项目名称:diagnostic-tool,代码行数:17,代码来源:GrapherActivity.java


示例7: RNOpenXcModule

import com.openxc.VehicleManager; //导入依赖的package包/类
public RNOpenXcModule(ReactApplicationContext reactContext, Activity activity) {
    super(reactContext);
    this.activity = activity;
    if(mVehicleManager == null) {
      Intent intent = new Intent(activity, VehicleManager.class);
      activity.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
    }
}
 
开发者ID:ozgurchn,项目名称:react-native-openxc,代码行数:9,代码来源:RNOpenXCModule.java


示例8: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
                               IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");

    mVehicleManager = ((VehicleManager.VehicleBinder) service)
            .getService();

    mVehicleManager.addListener(EngineSpeed.class, mSpeedListener);
    mVehicleManager.addListener(IgnitionStatus.class, mIgnitionListener);
    mVehicleManager.addListener(BrakePedalStatus.class, mBrakePedalListener);

}
 
开发者ID:ozgurchn,项目名称:react-native-openxc,代码行数:13,代码来源:RNOpenXCModule.java


示例9: onResume

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    // When the activity starts up or returns from the background,
    // re-connect to the VehicleManager so we can receive updates.
    if (mVehicleManager == null) {
        Intent intent = new Intent(this, VehicleManager.class);
        bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
    }
}
 
开发者ID:freeloki,项目名称:FordOpenXCHackathon,代码行数:12,代码来源:MainActivity.java


示例10: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
        IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder)service
            ).getService();

    mVehicleManager.addListener(CanMessage.class, mListener);
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:9,代码来源:CanMessageViewFragment.java


示例11: PipelineStatusUpdateTask

import com.openxc.VehicleManager; //导入依赖的package包/类
public PipelineStatusUpdateTask(VehicleManager vehicleService,
        Activity activity, View fileConnView,
        View networkConnView, View bluetoothConnView, View usbConnView,
        View noneConnView) {
    mVehicleManager = vehicleService;
    mActivity = activity;
    mFileConnView = fileConnView;
    mNetworkConnView = networkConnView;
    mBluetoothConnView = bluetoothConnView;
    mUsbConnView = usbConnView;
    mNoneConnView = noneConnView;
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:13,代码来源:PipelineStatusUpdateTask.java


示例12: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
        IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder)service
            ).getService();

    mVehicleManager.addListener(SimpleVehicleMessage.class, mListener);
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:9,代码来源:VehicleDashboardFragment.java


示例13: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
        IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder)service
            ).getService();

    mVehicleManager.addListener(DiagnosticResponse.class, mListener);
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:9,代码来源:DiagnosticRequestFragment.java


示例14: onResume

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onResume() {
    super.onResume();
    getActivity().bindService(
            new Intent(getActivity(), VehicleManager.class),
            mConnection, Context.BIND_AUTO_CREATE);
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:8,代码来源:DiagnosticRequestFragment.java


示例15: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
        IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder)service
            ).getService();

    try {
        mVehicleManager.addOnVehicleInterfaceConnectedListener(
                mConnectionListener);
    } catch(VehicleServiceException e) {
        Log.e(TAG, "Unable to register VI connection listener", e);
    }

    if(mVehicleManager.isViConnected()) {
        updateViInfo();
    }

    new Thread(new Runnable() {
        public void run() {
            mVehicleManager.waitUntilBound();
            if(getActivity() != null) {
                getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        mServiceNotRunningWarningView.setVisibility(View.GONE);
                    }
                });
            }
        }
    }).start();

    mUpdateMessageCountTask = new MessageCountTask(mVehicleManager,
            getActivity(), mMessageCountView);
    mUpdatePipelineStatusTask = new PipelineStatusUpdateTask(
            mVehicleManager, getActivity(),
            mFileConnIV, mNetworkConnIV, mBluetoothConnIV, mUsbConnIV,
            mNoneConnView);
    mTimer = new Timer();
    mTimer.schedule(mUpdateMessageCountTask, 100, 1000);
    mTimer.schedule(mUpdatePipelineStatusTask, 100, 1000);
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:41,代码来源:StatusFragment.java


示例16: onResume

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onResume() {
    super.onResume();
    if(getActivity() != null) {
        getActivity().bindService(
                new Intent(getActivity(), VehicleManager.class),
                mConnection, Context.BIND_AUTO_CREATE);
    }
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:10,代码来源:StatusFragment.java


示例17: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
        IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder)service
            ).getService();

    new Thread(new Runnable() {
        public void run() {
            mVehicleManager.waitUntilBound();
            for(VehiclePreferenceManager manager : mPreferenceManagers) {
                manager.setVehicleManager(mVehicleManager);
            }
        }
    }).start();
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:16,代码来源:PreferenceManagerService.java


示例18: onCreate

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String bugsnagToken = getBugsnagToken(this);
    if(bugsnagToken != null && !bugsnagToken.isEmpty()) {
        try {
            Bugsnag.register(this, bugsnagToken);
        } catch(NoClassDefFoundError e) {
            Log.w(TAG, "Busgnag is unsupported when building from Eclipse", e);
        }
    } else {
        Log.i(TAG, "No Bugsnag token found in AndroidManifest, not enabling Bugsnag");
    }

    Log.i(TAG, "OpenXC Enabler created");
    setContentView(R.layout.main);
    mAdapter = new EnablerFragmentAdapter(getSupportFragmentManager());
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);

    if (savedInstanceState != null) {
        mPager.setCurrentItem(savedInstanceState.getInt("tab", 0));
    }

    startService(new Intent(this, VehicleManager.class));
    startService(new Intent(this, PreferenceManagerService.class));
}
 
开发者ID:bibhrajit,项目名称:openxc-androidStudio,代码行数:29,代码来源:OpenXcEnablerActivity.java


示例19: onServiceConnected

import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void
        onServiceConnected(ComponentName className, IBinder service) {
    Log.i(TAG, "Bound to VehicleManager");
    mVehicleManager = ((VehicleManager.VehicleBinder) service)
            .getService();
    mIsBound = true;
    mVehicleManager.addListener(KeyMatcher.getWildcardMatcher(),
            mDumpListener);
}
 
开发者ID:openxc,项目名称:diagnostic-tool,代码行数:11,代码来源:DumpActivity.java


示例20: GraphDataRetrieveTask

import com.openxc.VehicleManager; //导入依赖的package包/类
public GraphDataRetrieveTask(VehicleManager vehicleService, Activity act,
        GraphViewSeries series, Class<? extends Measurement> measurementType) {
    mVehicleManager = vehicleService;
    mGraphSeries = series;
    mMeasurementType = measurementType;
    mActivity = act;
}
 
开发者ID:openxc,项目名称:diagnostic-tool,代码行数:8,代码来源:GraphDataRetrieveTask.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CodecJOrbis类代码示例发布时间:2022-05-22
下一篇:
Java Assumptions类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap