Sunday, October 17, 2021

Software development conventions

No comments

We use proper variable names instead of comments. The only exceptions for comments are "//TODO" temporary labels.

Order of class members in within the class definition

Internet suggests multiple ways for ordering and sorting members, and I follow neither of them. It is up to everybody to choose his/her own way of sorting members. It is not important how we sort members; rather it is important how consistently we follow our chosen methodology. So my way to sort members is as follows:

  1. Inherited (overridden) members from the parent class.
  2. Everything else.

In within of each of these, items are sorted as follows:

  1. Variables
  2. Init{} block
  3. Constructors(){}
  4. Functions(){}
  5. Everything else

In within of each of these, items are sorted as follows:

  1. Abstract
  2. Public
  3. Private
  4. Everything else

Sunday, October 10, 2021

How to connect an OBD device (car scanner) to an Android phone

To find my OBD device faster, I usually keep it already plugged in the OBD car slot under the steering wheel or at the shelf of the left driver's door. 

Plug in the OBD and turn on the engine. Make sure you see the OBD device bright light under the car dashboard.

Turn on the Bluetooth on the phone.
In the phone Bluetooth settings, connect to the "OBDII" device with the password (PIN) "1234".
If the Bluetooth doesn't see OBDII, probably OBDII is already connected to another phone.

If the phone doesn't see " OBDII" device, try to plug the OBD device out of the car's socket and plug it in again. 

Download "Car scanner" app:
https://play.google.com/store/apps/details?id=com.ovz.carscanner

In the app, connect to the "OBD" device.

In the app, press "Engine codes".

Troubleshooting:
- switch the phone
- switch the OBD device
- reboot the phone
- plug out and plug in the OBD device
- make sure the car engine is on