Timing device documentation
If you have any questions, please contact qq987424501
Note: the title in bold indicates that special attention should be paid to the following
I. camera
See CameraDemo. You can import cameralib directly and depend on it.
II. Card swiping module
1. Module type
nfc (there are many articles about nfc on the Internet, such as: https://blog.csdn.net/pku_and...
Configuration of manifest:
<!--File read and write--> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!--card reading--> <uses-permission android:name="android.permission.NFC"/>
<application android:name=".App"
<activity android:name=".ui.activity.ICCardActivity" android:screenOrientation="landscape" android:launchMode="singleTask"> <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> </intent-filter> <intent-filter> <action android:name="android.nfc.action.TAG_DISCOVERED"/> </intent-filter> <intent-filter> <action android:name="android.nfc.action.TECH_DISCOVERED"/> </intent-filter> <meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter"/> </activity> <activity android:name=".ui.activity.IdCardActivity" android:screenOrientation="landscape" android:launchMode="singleTask"> <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <intent-filter> <action android:name="android.nfc.action.TECH_DISCOVERED"/> </intent-filter> <meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter"/> <intent-filter> <action android:name="android.nfc.action.TAG_DISCOVERED"/> </intent-filter> </activity>
2. Ic card reading
Inherit NfcActivity to implement the interface. See the source code for the specific logic of NfcActivity. If the sector password of the card used is not the default password 0xFFFFFFFF, modify the member variable password of NfcActivity to sector password. The logic of assigning a password can be implemented in the generatePassword() method of nfcctv.
3. ID card serial number reading
Inherit the implementation interface of NfcIdCardActivity, and see the source code for the specific logic of NfcIdCardActivity.
Three, positioning
No matter what location sdk you use, you must call LocationHelper.getInstance().locateAtIntervals() in the onCreate of Application. This is to update the gps almanac and reduce the offset.
public class App extends Application { @Override public void onCreate() { super.onCreate(); //log tool initialization try { LogUtil.init(); } catch (Exception e) { e.printStackTrace(); } //Restart positioning every other period of time, which is mainly used to make equipment gps module positioning more accurate and reduce drift try { LocationHelper.getInstance().locateAtIntervals(); } catch (Exception e) { e.printStackTrace(); } } }
IV. power off completely after equipment shutdown (without loss of vehicle battery)
In the manifest, you can configure it as follows.
<receiver android:name="com.haoxueche.mz200alib.receiver.ShutdownBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.ACTION_SHUTDOWN"/> </intent-filter> </receiver>
V. acc reading
AccManager.getInstance().isAccOn();
Vi. imei reading
SystemUtil.getImei(context);
7. Serial number reading
DeviceHardwareUtil.SERIAL