Skip to content

Commit f8f0281

Browse files
author
River@devbox
committed
Update QSL4A documentation to match source code
- Fix imageCompress() parameters (targetByteSize, targetWidth, targetHeight) - Fix startLocating() parameters (remove provider, add updateGnssStatus) - Fix floatView function names to match implementation - Add missing camera functions (cameraCapturePicture, cameraSetTorchMode, recorderCaptureVideo) - Add missing recorder functions (recorderStartScreenRecord, recorderSoundVolumeDetect, etc) - Add missing WiFi functions (checkWifiState, toggleWifiState, wifiStartScan, etc) - Add missing SMS functions (smsGetMessageById, smsGetAttributes) - Add missing DocumentFile functions (Exists, IsFile, IsDirectory, etc) - Add missing dialog functions (dialogCreateAlert, dialogCreateInput, etc) - Add missing fullscreen functions (fullGetProperties, fullSetListSelected, etc) - Add missing application functions (launch, createScriptShortCut, etc) - Add textToSpeech and cipherInit documentation
1 parent 5c4cf9a commit f8f0281

File tree

13 files changed

+1083
-70
lines changed

13 files changed

+1083
-70
lines changed

source/en/qsl4a/connectivity/location.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Access GPS and network location services.
88
Start location updates.
99

1010
```python
11-
startLocating(provider="gps", minUpdateDistance=1, minUpdateTime=5000)
11+
startLocating(minUpdateTime=60000, minUpdateDistance=30, updateGnssStatus=False)
1212
```
1313

1414
**Parameters:**
15-
- `provider` (str): "gps" or "network"
16-
- `minUpdateDistance` (float): Minimum distance for update (meters)
17-
- `minUpdateTime` (int): Minimum time between updates (ms)
15+
- `minUpdateTime` (int): Minimum time between updates in milliseconds (default: 60000)
16+
- `minUpdateDistance` (float): Minimum distance for update in meters (default: 30)
17+
- `updateGnssStatus` (bool): Enable GNSS status updates (default: False)
1818

1919
### stopLocating()
2020
Stop location updates.
@@ -56,8 +56,8 @@ import time
5656

5757
droid = androidhelper.Android()
5858

59-
# Start GPS
60-
droid.startLocating("gps", 1, 5000)
59+
# Start location updates
60+
droid.startLocating(minUpdateTime=5000, minUpdateDistance=1, updateGnssStatus=False)
6161

6262
# Wait for fix
6363
time.sleep(10)

source/en/qsl4a/connectivity/sms.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ Get message details.
3636
smsGetMessages(unreadOnly=False, folder="inbox", attributes=None)
3737
```
3838

39+
### smsGetMessageById()
40+
Get a specific message by ID.
41+
42+
```python
43+
smsGetMessageById(id, attributes=None)
44+
```
45+
46+
**Parameters:**
47+
- `id` (int): Message ID
48+
- `attributes` (list, optional): Specific attributes to retrieve
49+
50+
**Returns:** Message data dict
51+
52+
### smsGetAttributes()
53+
Get available SMS message attributes.
54+
55+
```python
56+
smsGetAttributes()
57+
```
58+
59+
**Returns:** List of available attribute names
60+
3961
### smsDeleteMessage()
4062
Delete message.
4163

source/en/qsl4a/connectivity/wifi.md

Lines changed: 147 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,171 @@
22

33
Control WiFi adapter and get connection information.
44

5-
## Methods
5+
## Adapter Control
66

7-
### wifiGetApState()
8-
Get WiFi AP (hotspot) state.
7+
### checkWifiState()
8+
Check if WiFi is enabled.
99

1010
```python
11-
wifiGetApState()
11+
checkWifiState()
12+
```
13+
14+
**Returns:** True if WiFi is enabled, False otherwise
15+
16+
### toggleWifiState()
17+
Turn WiFi on or off.
18+
19+
```python
20+
toggleWifiState(enabled=None)
21+
```
22+
23+
**Parameters:**
24+
- `enabled` (bool): True to enable, False to disable, None to toggle
25+
26+
**Returns:** True if operation succeeded
27+
28+
### wifiStartScan()
29+
Start scanning for available WiFi networks.
30+
31+
```python
32+
wifiStartScan()
33+
```
34+
35+
### wifiGetScanResults()
36+
Get list of discovered WiFi networks.
37+
38+
```python
39+
wifiGetScanResults()
1240
```
1341

42+
**Returns:** List of access point information
43+
44+
## Connection Management
45+
46+
### wifiGetConnectionInfo()
47+
Get detailed connection information.
48+
49+
```python
50+
wifiGetConnectionInfo()
51+
```
52+
53+
**Returns:** Dict with connection details including SSID, BSSID, IP address
54+
1455
### getConnectedInfo()
15-
Get connected WiFi network info.
56+
Get connected WiFi network info (simplified).
1657

1758
```python
1859
getConnectedInfo()
1960
```
2061

2162
**Returns:** Dict with SSID, BSSID, signal strength
2263

64+
### getDhcpInfo()
65+
Get DHCP information for current connection.
66+
67+
```python
68+
getDhcpInfo(ipConvertToString=True)
69+
```
70+
71+
**Parameters:**
72+
- `ipConvertToString` (bool): Convert IP addresses to string format (default: True)
73+
74+
**Returns:** Dict with DHCP info including IP, gateway, DNS
75+
76+
### wifiDisconnect()
77+
Disconnect from current WiFi network.
78+
79+
```python
80+
wifiDisconnect()
81+
```
82+
83+
### wifiReconnect()
84+
Reconnect to the current network.
85+
86+
```python
87+
wifiReconnect()
88+
```
89+
90+
### wifiReassociate()
91+
Reassociate with the current access point.
92+
93+
```python
94+
wifiReassociate()
95+
```
96+
97+
## Hotspot
98+
99+
### wifiGetApState()
100+
Get WiFi AP (hotspot) state.
101+
102+
```python
103+
wifiGetApState()
104+
```
105+
106+
**Returns:** Hotspot state
107+
108+
## WiFi Locks
109+
110+
### wifiLockAcquireFull()
111+
Acquire a full WiFi lock (keeps WiFi active even when screen is off).
112+
113+
```python
114+
wifiLockAcquireFull()
115+
```
116+
117+
### wifiLockAcquireScanOnly()
118+
Acquire a scan-only WiFi lock.
119+
120+
```python
121+
wifiLockAcquireScanOnly()
122+
```
123+
124+
### wifiLockRelease()
125+
Release the WiFi lock.
126+
127+
```python
128+
wifiLockRelease()
129+
```
130+
23131
## Usage Example
24132

25133
```python
26134
import androidhelper
135+
import time
27136

28137
droid = androidhelper.Android()
29138

30-
# Get WiFi info
31-
info = droid.getConnectedInfo().result
139+
# Check WiFi state
140+
if droid.checkWifiState().result:
141+
print("WiFi is enabled")
142+
else:
143+
print("Enabling WiFi...")
144+
droid.toggleWifiState(True)
145+
time.sleep(2)
146+
147+
# Start scanning
148+
droid.wifiStartScan()
149+
time.sleep(3)
150+
151+
# Get scan results
152+
networks = droid.wifiGetScanResults().result
153+
for network in networks:
154+
print(f"SSID: {network.get('SSID')}, Signal: {network.get('level')} dBm")
155+
156+
# Get connection info
157+
info = droid.wifiGetConnectionInfo().result
32158
if info:
33-
print(f"Connected to: {info['ssid']}")
34-
print(f"Signal: {info['rssi']} dBm")
35-
```
159+
print(f"Connected to: {info.get('ssid')}")
160+
print(f"BSSID: {info.get('bssid')}")
161+
print(f"IP: {info.get('ip_address')}")
162+
163+
# Get DHCP info
164+
dhcp = droid.getDhcpInfo().result
165+
if dhcp:
166+
print(f"Gateway: {dhcp.get('gateway')}")
167+
print(f"DNS: {dhcp.get('dns1')}")
168+
169+
# Acquire WiFi lock for background operation
170+
droid.wifiLockAcquireFull()
171+
# ... do work ...
172+
droid.wifiLockRelease()

source/en/qsl4a/hardware/camera.md

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Capture photos and record video.
55
## Photo Capture
66

77
### takePicture()
8-
Take a photo.
8+
Take a photo using the default camera.
99

1010
```python
1111
takePicture(path=None)
@@ -16,6 +16,32 @@ takePicture(path=None)
1616

1717
**Returns:** Image path or image data
1818

19+
### cameraCapturePicture()
20+
Capture picture with advanced camera controls.
21+
22+
```python
23+
cameraCapturePicture(targetPath=None, cameraId=0, useAutoFocus=True)
24+
```
25+
26+
**Parameters:**
27+
- `targetPath` (str, optional): Save path
28+
- `cameraId` (int): Camera to use (0 = back, 1 = front)
29+
- `useAutoFocus` (bool): Enable auto focus
30+
31+
**Returns:** Captured image path
32+
33+
### cameraSetTorchMode()
34+
Control camera flashlight/torch.
35+
36+
```python
37+
cameraSetTorchMode(enabled)
38+
```
39+
40+
**Parameters:**
41+
- `enabled` (bool): True to turn on, False to turn off
42+
43+
**Returns:** True if successful
44+
1945
### imageReaderGetScreenShot()
2046
Capture screenshot.
2147

@@ -30,7 +56,7 @@ imageReaderGetScreenShot(path=None, delayMilliSec=1000)
3056
## Video Recording
3157

3258
### takeVideo()
33-
Record video.
59+
Record video using default settings.
3460

3561
```python
3662
takeVideo(path=None, quality=1)
@@ -45,6 +71,21 @@ takeVideo(path=None, quality=1)
4571
- 3: 640x480
4672
- 4: 800x480
4773

74+
### recorderCaptureVideo()
75+
Capture video with advanced controls.
76+
77+
```python
78+
recorderCaptureVideo(targetPath=None, duration=10, cameraId=0, quality=8)
79+
```
80+
81+
**Parameters:**
82+
- `targetPath` (str, optional): Save path
83+
- `duration` (int): Recording duration in seconds (default: 10)
84+
- `cameraId` (int): Camera to use (0 = back, 1 = front)
85+
- `quality` (int): Video quality (0-8, higher is better)
86+
87+
**Returns:** Video file path
88+
4889
### recordAudio()
4990
Record audio.
5091

@@ -118,14 +159,24 @@ import androidhelper
118159

119160
droid = androidhelper.Android()
120161

121-
# Take photo
162+
# Take photo with default camera
122163
photo_path = droid.takePicture("/sdcard/photo.jpg").result
123164
print(f"Photo saved: {photo_path}")
124165

125-
# Record video
166+
# Take photo with front camera and auto focus
167+
camera_path = droid.cameraCapturePicture("/sdcard/selfie.jpg", cameraId=1, useAutoFocus=True).result
168+
print(f"Front camera photo: {camera_path}")
169+
170+
# Control flashlight
171+
droid.cameraSetTorchMode(True) # Turn on flashlight
172+
173+
# Record video with default settings
126174
video_path = droid.takeVideo("/sdcard/video.mp4", quality=3).result
127175
print(f"Video saved: {video_path}")
128176

177+
# Record video with advanced controls
178+
video_path = droid.recorderCaptureVideo("/sdcard/movie.mp4", duration=30, cameraId=0, quality=8).result
179+
129180
# Screenshot
130181
ss_path = droid.imageReaderGetScreenShot("/sdcard/screenshot.png", 500).result
131182
```

0 commit comments

Comments
 (0)