4. (20 points) The figure below shows the setting of a "gesture password" on a mobile phone. In a $2 \times 2$ grid, there are 9 grid points. A "gesture password" starts from one of the grid points and connects several grid points with line segments. Each line segment must not have any unused grid points in between, and the two endpoints of the line segment cannot both be already used grid points. If a person's gesture password starts from the center grid point and only uses three grid points, how many connection methods are there?

---

The translation preserves the original text's formatting and structure.
【Analysis】As shown in the right figure, 9 grid points are labeled with letters respectively. Starting from $O$, a line segment can first connect to any of the other 8 grid points, and then connect to a third point. By reasoning in two categories and using the principle of counting by classification, we can reach the conclusion.

【Solution】Solution: As shown in the right figure, 9 grid points are labeled with letters respectively. Starting from $O$, a line segment can first connect to any of the other 8 grid points, and then connect to a third point.
(1) When the second grid point is $A$, according to the problem, the third grid point to connect can be $B, D, E, F, H$, so there are 5 ways to connect; similarly, when the second grid point is $C, E, G$, there are 5 ways to connect each;
(2) When the second grid point is $B$, the third grid point to connect can be any of the other 7 grid points except $O$ and $B$, so there are 7 ways to connect; similarly, when the second grid point is $D, F, H$, there are 7 ways to connect each, thus the total number of connection methods that meet the conditions is $4 \times(5+7)=48$. Therefore, the answer is: 48.