-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqsl4a.html
More file actions
1927 lines (1684 loc) · 84.4 KB
/
Copy pathqsl4a.html
File metadata and controls
1927 lines (1684 loc) · 84.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta
name="description"
content="Documentation for QPython's QSL4A API"
>
<title>QSL4A API Documentation</title>
<style media="screen">
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
color: #999999;
}
.highlight .sr {
color: #f6aa11;
}
.highlight .go {
color: #888888;
}
.highlight .gp {
color: #555555;
}
.highlight .gs {
}
.highlight .gu {
color: #aaaaaa;
}
.highlight .nb {
color: #f6aa11;
}
.highlight .cm {
color: #75715e;
}
.highlight .cp {
color: #75715e;
}
.highlight .c1 {
color: #75715e;
}
.highlight .cs {
color: #75715e;
}
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
color: #75715e;
}
.highlight .err {
color: #960050;
}
.highlight .gr {
color: #960050;
}
.highlight .gt {
color: #960050;
}
.highlight .gd {
color: #49483e;
}
.highlight .gi {
color: #49483e;
}
.highlight .ge {
color: #49483e;
}
.highlight .kc {
color: #66d9ef;
}
.highlight .kd {
color: #66d9ef;
}
.highlight .kr {
color: #66d9ef;
}
.highlight .no {
color: #66d9ef;
}
.highlight .kt {
color: #66d9ef;
}
.highlight .mf {
color: #ae81ff;
}
.highlight .mh {
color: #ae81ff;
}
.highlight .il {
color: #ae81ff;
}
.highlight .mi {
color: #ae81ff;
}
.highlight .mo {
color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
color: #ae81ff;
}
.highlight .sc {
color: #ae81ff;
}
.highlight .se {
color: #ae81ff;
}
.highlight .ss {
color: #ae81ff;
}
.highlight .sd {
color: #e6db74;
}
.highlight .s2 {
color: #e6db74;
}
.highlight .sb {
color: #e6db74;
}
.highlight .sh {
color: #e6db74;
}
.highlight .si {
color: #e6db74;
}
.highlight .sx {
color: #e6db74;
}
.highlight .s1 {
color: #e6db74;
}
.highlight .s, .highlight .sa, .highlight .dl {
color: #e6db74;
}
.highlight .na {
color: #a6e22e;
}
.highlight .nc {
color: #a6e22e;
}
.highlight .nd {
color: #a6e22e;
}
.highlight .ne {
color: #a6e22e;
}
.highlight .nf, .highlight .fm {
color: #a6e22e;
}
.highlight .vc {
color: #ffffff;
}
.highlight .nn {
color: #ffffff;
}
.highlight .ni {
color: #ffffff;
}
.highlight .bp {
color: #ffffff;
}
.highlight .vg {
color: #ffffff;
}
.highlight .vi {
color: #ffffff;
}
.highlight .nv, .highlight .vm {
color: #ffffff;
}
.highlight .w {
color: #ffffff;
}
.highlight {
color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
color: #ffffff;
}
.highlight .nl {
color: #f92672;
}
.highlight .ow {
color: #f92672;
}
.highlight .nt {
color: #f92672;
}
.highlight .k, .highlight .kv {
color: #f92672;
}
.highlight .kn {
color: #f92672;
}
.highlight .kp {
color: #f92672;
}
.highlight .o {
color: #f92672;
}
</style>
<style media="print">
* {
-webkit-transition:none!important;
transition:none!important;
}
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight, .highlight .w {
color: #586e75;
}
.highlight .err {
color: #002b36;
background-color: #dc322f;
}
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
color: #657b83;
}
.highlight .cp {
color: #b58900;
}
.highlight .nt {
color: #b58900;
}
.highlight .o, .highlight .ow {
color: #93a1a1;
}
.highlight .p, .highlight .pi {
color: #93a1a1;
}
.highlight .gi {
color: #859900;
}
.highlight .gd {
color: #dc322f;
}
.highlight .gh {
color: #268bd2;
background-color: #002b36;
font-weight: bold;
}
.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
color: #6c71c4;
}
.highlight .kc {
color: #cb4b16;
}
.highlight .kt {
color: #cb4b16;
}
.highlight .kd {
color: #cb4b16;
}
.highlight .s, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
color: #859900;
}
.highlight .sa {
color: #6c71c4;
}
.highlight .sr {
color: #2aa198;
}
.highlight .si {
color: #d33682;
}
.highlight .se {
color: #d33682;
}
.highlight .nn {
color: #b58900;
}
.highlight .nc {
color: #b58900;
}
.highlight .no {
color: #b58900;
}
.highlight .na {
color: #268bd2;
}
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
color: #859900;
}
.highlight .ss {
color: #859900;
}
</style>
<link href="stylesheets/screen-ad6e7f01.css" rel="stylesheet" media="screen" />
<link href="stylesheets/print-88f539c5.css" rel="stylesheet" media="print" />
<script src="javascripts/all-b12a2749.js"></script>
<script>
$(function() { setupCodeCopy(); });
</script>
</head>
<body class="qsl4a" data-languages="["python"]">
<a href="#" id="nav-button">
<span>
NAV
<img src="images/navbar-cad8cdcb.png" alt="" />
</span>
</a>
<div class="toc-wrapper">
<center><img src="images/logo-96d18de3.png" class="logo" alt="" /></center>
<div class="lang-selector">
<a href="#" data-language-name="python">python</a>
</div>
<div class="search">
<input type="text" class="search" id="input-search" placeholder="Search">
</div>
<ul class="search-results"></ul>
<ul id="toc" class="toc-list-h1">
<li>
<a href="#qsl4a-apis-documentation" class="toc-h1 toc-link" data-title="QSL4A APIs Documentation">QSL4A APIs Documentation</a>
</li>
<li>
<a href="#01-androidfacade" class="toc-h1 toc-link" data-title="01 AndroidFacade">01 AndroidFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0101-clipboard-apis" class="toc-h2 toc-link" data-title="0101 Clipboard APIs">0101 Clipboard APIs</a>
</li>
<li>
<a href="#0102-intent-amp-startactivity-apis" class="toc-h2 toc-link" data-title="0102 Intent & startActivity APIs">0102 Intent & startActivity APIs</a>
</li>
<li>
<a href="#0103-sendbroadcast-apis" class="toc-h2 toc-link" data-title="0103 SendBroadcast APIs">0103 SendBroadcast APIs</a>
</li>
<li>
<a href="#0104-vibrate" class="toc-h2 toc-link" data-title="0104 Vibrate">0104 Vibrate</a>
</li>
<li>
<a href="#0105-networkstatus" class="toc-h2 toc-link" data-title="0105 NetworkStatus">0105 NetworkStatus</a>
</li>
<li>
<a href="#0106-packageversion-apis" class="toc-h2 toc-link" data-title="0106 PackageVersion APIs">0106 PackageVersion APIs</a>
</li>
<li>
<a href="#0107-system-apis" class="toc-h2 toc-link" data-title="0107 System APIs">0107 System APIs</a>
</li>
<li>
<a href="#0108-sendemail" class="toc-h2 toc-link" data-title="0108 SendEmail">0108 SendEmail</a>
</li>
<li>
<a href="#0109-toast-getinput-getpassword-notify-apis" class="toc-h2 toc-link" data-title="0109 Toast, getInput, getPassword, notify APIs">0109 Toast, getInput, getPassword, notify APIs</a>
</li>
</ul>
</li>
<li>
<a href="#02-applicationmanagerfacade" class="toc-h1 toc-link" data-title="02 ApplicationManagerFacade">02 ApplicationManagerFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0201-manager-apis" class="toc-h2 toc-link" data-title="0201 Manager APIs">0201 Manager APIs</a>
</li>
</ul>
</li>
<li>
<a href="#03-camerafacade" class="toc-h1 toc-link" data-title="03 CameraFacade">03 CameraFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0301-camera-apis" class="toc-h2 toc-link" data-title="0301 Camera APIs">0301 Camera APIs</a>
</li>
</ul>
</li>
<li>
<a href="#04-commonintentsfacade" class="toc-h1 toc-link" data-title="04 CommonIntentsFacade">04 CommonIntentsFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0401-barcode-apis" class="toc-h2 toc-link" data-title="0401 Barcode APIs">0401 Barcode APIs</a>
</li>
<li>
<a href="#0402-view-apis" class="toc-h2 toc-link" data-title="0402 View APIs">0402 View APIs</a>
</li>
</ul>
</li>
<li>
<a href="#05-contactsfacade" class="toc-h1 toc-link" data-title="05 ContactsFacade">05 ContactsFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0501-contacts-apis" class="toc-h2 toc-link" data-title="0501 Contacts APIs">0501 Contacts APIs</a>
</li>
</ul>
</li>
<li>
<a href="#06-eventfacade" class="toc-h1 toc-link" data-title="06 EventFacade">06 EventFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0601-event-apis" class="toc-h2 toc-link" data-title="0601 Event APIs">0601 Event APIs</a>
</li>
</ul>
</li>
<li>
<a href="#07-locationfacade" class="toc-h1 toc-link" data-title="07 LocationFacade">07 LocationFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0701-providers-apis" class="toc-h2 toc-link" data-title="0701 Providers APIs">0701 Providers APIs</a>
</li>
<li>
<a href="#0702-location-apis" class="toc-h2 toc-link" data-title="0702 Location APIs">0702 Location APIs</a>
</li>
<li>
<a href="#0703-geo" class="toc-h2 toc-link" data-title="0703 GEO">0703 GEO</a>
</li>
</ul>
</li>
<li>
<a href="#08-phonefacade" class="toc-h1 toc-link" data-title="08 PhoneFacade">08 PhoneFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0801-phonestat-apis" class="toc-h2 toc-link" data-title="0801 PhoneStat APIs">0801 PhoneStat APIs</a>
</li>
<li>
<a href="#0802-call-amp-dia-apis" class="toc-h2 toc-link" data-title="0802 Call & Dia APIs">0802 Call & Dia APIs</a>
</li>
<li>
<a href="#0803-get-information-apis" class="toc-h2 toc-link" data-title="0803 Get information APIs">0803 Get information APIs</a>
</li>
</ul>
</li>
<li>
<a href="#09-mediarecorderfacade" class="toc-h1 toc-link" data-title="09 MediaRecorderFacade">09 MediaRecorderFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#0901-audio" class="toc-h2 toc-link" data-title="0901 Audio">0901 Audio</a>
</li>
<li>
<a href="#0902-video-apis" class="toc-h2 toc-link" data-title="0902 Video APIs">0902 Video APIs</a>
</li>
<li>
<a href="#0903-stop" class="toc-h2 toc-link" data-title="0903 Stop">0903 Stop</a>
</li>
</ul>
</li>
<li>
<a href="#10-sensormanagerfacade" class="toc-h1 toc-link" data-title="10 SensorManagerFacade">10 SensorManagerFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1001-start-amp-stop" class="toc-h2 toc-link" data-title="1001 Start & Stop">1001 Start & Stop</a>
</li>
<li>
<a href="#1002-read-data-apis" class="toc-h2 toc-link" data-title="1002 Read data APIs">1002 Read data APIs</a>
</li>
</ul>
</li>
<li>
<a href="#11-settingsfacade" class="toc-h1 toc-link" data-title="11 SettingsFacade">11 SettingsFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1101-screen" class="toc-h2 toc-link" data-title="1101 Screen">1101 Screen</a>
</li>
<li>
<a href="#1102-airplanermode" class="toc-h2 toc-link" data-title="1102 AirplanerMode">1102 AirplanerMode</a>
</li>
<li>
<a href="#1103-ringer-silent-mode" class="toc-h2 toc-link" data-title="1103 Ringer Silent Mode">1103 Ringer Silent Mode</a>
</li>
<li>
<a href="#1104-vibrate-mode" class="toc-h2 toc-link" data-title="1104 Vibrate Mode">1104 Vibrate Mode</a>
</li>
<li>
<a href="#1105-ringer-amp-media-volume" class="toc-h2 toc-link" data-title="1105 Ringer & Media Volume">1105 Ringer & Media Volume</a>
</li>
<li>
<a href="#1105-screen-brightness" class="toc-h2 toc-link" data-title="1105 Screen Brightness">1105 Screen Brightness</a>
</li>
</ul>
</li>
<li>
<a href="#12-smsfacade" class="toc-h1 toc-link" data-title="12 SmsFacade">12 SmsFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1201-sms-api" class="toc-h2 toc-link" data-title="1201 Sms API">1201 Sms API</a>
</li>
</ul>
</li>
<li>
<a href="#13-speechrecognitionfacade" class="toc-h1 toc-link" data-title="13 SpeechRecognitionFacade">13 SpeechRecognitionFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1301-speech-api" class="toc-h2 toc-link" data-title="1301 Speech API">1301 Speech API</a>
</li>
</ul>
</li>
<li>
<a href="#14-tonegeneratorfacade" class="toc-h1 toc-link" data-title="14 ToneGeneratorFacade">14 ToneGeneratorFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1401-tones-api" class="toc-h2 toc-link" data-title="1401 Tones API">1401 Tones API</a>
</li>
</ul>
</li>
<li>
<a href="#15-wakelockfacade" class="toc-h1 toc-link" data-title="15 WakeLockFacade">15 WakeLockFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1501-wake-api" class="toc-h2 toc-link" data-title="1501 Wake API">1501 Wake API</a>
</li>
</ul>
</li>
<li>
<a href="#16-wififacade" class="toc-h1 toc-link" data-title="16 WifiFacade">16 WifiFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1601-wifi-apis" class="toc-h2 toc-link" data-title="1601 Wifi APIs">1601 Wifi APIs</a>
</li>
</ul>
</li>
<li>
<a href="#18-batterymanagerfacade" class="toc-h1 toc-link" data-title="18 BatteryManagerFacade">18 BatteryManagerFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1801-battery-apis" class="toc-h2 toc-link" data-title="1801 Battery APIs">1801 Battery APIs</a>
</li>
</ul>
</li>
<li>
<a href="#19-activityresultfacade" class="toc-h1 toc-link" data-title="19 ActivityResultFacade">19 ActivityResultFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#1901-activity-apis" class="toc-h2 toc-link" data-title="1901 Activity APIs">1901 Activity APIs</a>
</li>
</ul>
</li>
<li>
<a href="#20-mediaplayerfacade" class="toc-h1 toc-link" data-title="20 MediaPlayerFacade">20 MediaPlayerFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2001-control" class="toc-h2 toc-link" data-title="2001 Control">2001 Control</a>
</li>
<li>
<a href="#2002-get-information" class="toc-h2 toc-link" data-title="2002 Get Information">2002 Get Information</a>
</li>
</ul>
</li>
<li>
<a href="#21-preferencesfacade" class="toc-h1 toc-link" data-title="21 PreferencesFacade">21 PreferencesFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#preferences-apis" class="toc-h2 toc-link" data-title="Preferences APIs">Preferences APIs</a>
</li>
</ul>
</li>
<li>
<a href="#22-qpyinterfacefacade" class="toc-h1 toc-link" data-title="22 QPyInterfaceFacade">22 QPyInterfaceFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2201-qpyinterface-apis" class="toc-h2 toc-link" data-title="2201 QPyInterface APIs">2201 QPyInterface APIs</a>
</li>
</ul>
</li>
<li>
<a href="#23-texttospeechfacade" class="toc-h1 toc-link" data-title="23 TextToSpeechFacade">23 TextToSpeechFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2301-tts-apis" class="toc-h2 toc-link" data-title="2301 TTS APIs">2301 TTS APIs</a>
</li>
</ul>
</li>
<li>
<a href="#24-eyesfreefacade" class="toc-h1 toc-link" data-title="24 EyesFreeFacade">24 EyesFreeFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2401-eyesfree-apis" class="toc-h2 toc-link" data-title="2401 EyesFree APIs">2401 EyesFree APIs</a>
</li>
</ul>
</li>
<li>
<a href="#25-bluetoothfacade" class="toc-h1 toc-link" data-title="25 BluetoothFacade">25 BluetoothFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2501-bluetooth-apis" class="toc-h2 toc-link" data-title="2501 Bluetooth APIs">2501 Bluetooth APIs</a>
</li>
</ul>
</li>
<li>
<a href="#26-signalstrengthfacade" class="toc-h1 toc-link" data-title="26 SignalStrengthFacade">26 SignalStrengthFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2601-signalstreagth-apis" class="toc-h2 toc-link" data-title="2601 SignalStreagth APIs">2601 SignalStreagth APIs</a>
</li>
</ul>
</li>
<li>
<a href="#27-webcamfacade" class="toc-h1 toc-link" data-title="27 WebCamFacade">27 WebCamFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2701-webcam-apis" class="toc-h2 toc-link" data-title="2701 WebCam APIs">2701 WebCam APIs</a>
</li>
</ul>
</li>
<li>
<a href="#28-uifacade" class="toc-h1 toc-link" data-title="28 UiFacade">28 UiFacade</a>
<ul class="toc-list-h2">
<li>
<a href="#2801-dialog" class="toc-h2 toc-link" data-title="2801 Dialog">2801 Dialog</a>
</li>
<li>
<a href="#2802-nfc" class="toc-h2 toc-link" data-title="2802 NFC">2802 NFC</a>
</li>
<li>
<a href="#2803-progress" class="toc-h2 toc-link" data-title="2803 Progress">2803 Progress</a>
</li>
<li>
<a href="#2804-alert" class="toc-h2 toc-link" data-title="2804 Alert">2804 Alert</a>
</li>
<li>
<a href="#2805-dialog-control" class="toc-h2 toc-link" data-title="2805 Dialog Control">2805 Dialog Control</a>
</li>
<li>
<a href="#2806-layout" class="toc-h2 toc-link" data-title="2806 Layout">2806 Layout</a>
</li>
<li>
<a href="#2807-webview" class="toc-h2 toc-link" data-title="2807 WebView">2807 WebView</a>
</li>
</ul>
</li>
<li>
<a href="#29-usb-host-serial-facade" class="toc-h1 toc-link" data-title="29 USB Host Serial Facade">29 USB Host Serial Facade</a>
<ul class="toc-list-h2">
<li>
<a href="#requirements" class="toc-h2 toc-link" data-title="Requirements">Requirements</a>
</li>
<li>
<a href="#2901-usb-host-serial-apis" class="toc-h2 toc-link" data-title="2901 USB Host Serial APIs">2901 USB Host Serial APIs</a>
</li>
</ul>
</li>
</ul>
<ul class="toc-footer">
<li></li>
</ul>
<div style="padding:60px">
<!--<img src="images/qrcode_for_apigpt-723fccb3.jpg" class="logo" alt="" />
<p style="color:grey">扫描关注<br />生成式AI云公众号</p>
<img src="images/apigpt-contact-e412e752.png" class="logo" alt="" />
<p style="color:grey">扫描加入<br />生成式AI用户群</p>-->
</div>
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<h1 id='qsl4a-apis-documentation'>QSL4A APIs Documentation</h1>
<p>The Scripting Layer for Android (abridged as SL4A, and previously named Android Scripting Environment or ASE) is a library that allows the creation and running of scripts written in various scripting languages directly on Android devices. QPython start to extend the SL4A project and integrate it.</p>
<p>There are many SL4A APIs, if you found any issue, please <code>report an issue <https://github.com/qpython-android/qpython/issues></code>_.</p>
<h1 id='01-androidfacade'>01 AndroidFacade</h1><h2 id='0101-clipboard-apis'>0101 Clipboard APIs</h2><h3 id='setclipboard-text'>setClipboard(text)</h3>
<p>Put text in the clipboard</p>
<p>:param str text: text</p>
<h3 id='getclipboard'>getClipboard()</h3>
<p>Read text from the clipboard</p>
<p>:return: The text in the clipboard</p>
<blockquote>
<p>Please run below script within your QPython</p>
</blockquote>
<div class="highlight"><pre class="highlight python tab-python"><code>
<span class="kn">from</span> <span class="nn">androidhelper</span> <span class="kn">import</span> <span class="n">Android</span>
<span class="n">droid</span> <span class="o">=</span> <span class="n">Android</span><span class="p">()</span>
<span class="c1">#setClipboard
</span> <span class="n">droid</span><span class="p">.</span><span class="n">setClipboard</span><span class="p">(</span><span class="s">"Hello World"</span><span class="p">)</span>
<span class="c1">#getClipboard
</span> <span class="n">clipboard</span> <span class="o">=</span> <span class="n">droid</span><span class="p">.</span><span class="n">getClipboard</span><span class="p">().</span><span class="n">result</span>
</code></pre></div><h2 id='0102-intent-amp-startactivity-apis'>0102 Intent & startActivity APIs</h2><h3 id='makeintent-action-uri-type-extras-categories-packagename-classname-flags'>makeIntent(action, uri, type, extras, categories, packagename, classname, flags)</h3>
<p>Starts an activity and returns the result</p>
<p>:param str action: action
:param str uri(Optional): uri
:param str type(Optional): MIME type/subtype of the URI
:param object extras(Optional): a Map of extras to add to the Intent
:param list categories(Optional): a List of categories to add to the Intent
:param str packagename(Optional): name of package. If used, requires classname to be useful
:param str classname(Optional): name of class. If used, requires packagename to be useful
:param int flags(Optional): Intent flags</p>
<p>:return: An object representing an Intent</p>
<blockquote>
<p>sample code to show makeIntent</p>
</blockquote>
<h3 id='getintent'>getIntent()</h3>
<p>Returns the intent that launched the script</p>
<blockquote>
<p>sample code to show getIntent</p>
</blockquote>
<h3 id='startactivityforresult-action-uri-type-extras-packagename-classname'>startActivityForResult(action, uri, type, extras, packagename, classname)</h3>
<p>Starts an activity and returns the result</p>
<p>:param str action: action
:param str uri(Optional): uri
:param str type(Optional): MIME type/subtype of the URI
:param object extras(Optional): a Map of extras to add to the Intent
:param str packagename(Optional): name of package. If used, requires classname to be useful
:param str classname(Optional): name of class. If used, requires packagename to be useful</p>
<p>:return: A Map representation of the result Intent</p>
<blockquote>
<p>sample code to show startActivityForResult</p>
</blockquote>
<h3 id='startactivityforresultintent-intent'>startActivityForResultIntent(intent)</h3>
<p>Starts an activity and returns the result</p>
<p>:param Intent intent: Intent in the format as returned from makeIntent</p>
<p>:return: A Map representation of the result Intent</p>
<blockquote>
<p>sample code to show startActivityForResultIntent</p>
</blockquote>
<h3 id='startactivityintent-intent-wait'>startActivityIntent(intent, wait)</h3>
<p>Starts an activity</p>
<p>:param Intent intent: Intent in the format as returned from makeIntent
:param bool wait(Optional): block until the user exits the started activity</p>
<blockquote>
<p>sample code to show startActivityIntent</p>
</blockquote>
<h3 id='startactivity-action-uri-type-extras-wait-packagename-classname'>startActivity(action, uri, type, extras, wait, packagename, classname)</h3>
<p>Starts an activity</p>
<p>:param str action: action
:param str uri(Optional): uri
:param str type(Optional): MIME type/subtype of the URI
:param object extras(Optional): a Map of extras to add to the Intent
:param bool wait(Optional): block until the user exits the started activity
:param str packagename(Optional): name of package. If used, requires classname to be useful
:param str classname(Optional): name of class. If used, requires packagename to be useful</p>
<blockquote>
<p>sample code to show startActivityForResultIntent</p>
</blockquote>
<h2 id='0103-sendbroadcast-apis'>0103 SendBroadcast APIs</h2><h3 id='sendbroadcast-action-uri-type-extras-packagename-classname'>sendBroadcast(action, uri, type, extras, packagename, classname)</h3>
<p>Send a broadcast</p>
<p>:param str action: action
:param str uri(Optional): uri
:param str type(Optional): MIME type/subtype of the URI
:param object extras(Optional): a Map of extras to add to the Intent
:param str packagename(Optional): name of package. If used, requires classname to be useful
:param str classname(Optional): name of class. If used, requires packagename to be useful</p>
<blockquote>
<p>sample code to show sendBroadcast</p>
</blockquote>
<h3 id='sendbroadcastintent-intent'>sendBroadcastIntent(intent)</h3>
<p>Send a broadcast</p>
<p>:param Intent intent: Intent in the format as returned from makeIntent</p>
<blockquote>
<p>sample code to show sendBroadcastIntent</p>
</blockquote>
<h2 id='0104-vibrate'>0104 Vibrate</h2><h3 id='vibrate-intent'>vibrate(intent)</h3>
<p>Vibrates the phone or a specified duration in milliseconds</p>
<p>:param int duration: duration in milliseconds</p>
<blockquote>
<p>sample code to show vibrate</p>
</blockquote>
<h2 id='0105-networkstatus'>0105 NetworkStatus</h2><h3 id='getnetworkstatus'>getNetworkStatus()</h3>
<p>Returns the status of network connection</p>
<blockquote>
<p>sample code to show getNetworkStatus</p>
</blockquote>
<h2 id='0106-packageversion-apis'>0106 PackageVersion APIs</h2><h3 id='requiredversion-requiredversion'>requiredVersion(requiredVersion)</h3>
<p>Checks if version of QPython SL4A is greater than or equal to the specified version</p>
<p>:param int requiredVersion: requiredVersion</p>
<p>:return: true or false</p>
<h3 id='getpackageversioncode-packagename'>getPackageVersionCode(packageName)</h3>
<p>Returns package version code</p>
<p>:param str packageName: packageName</p>
<p>:return: Package version code</p>
<h3 id='getpackageversion-packagename'>getPackageVersion(packageName)</h3>
<p>Returns package version name</p>
<p>:param str packageName: packageName</p>
<p>:return: Package version name</p>
<blockquote>
<p>sample code to show getPackageVersionCode & getPackageVersion</p>
</blockquote>
<h2 id='0107-system-apis'>0107 System APIs</h2><h3 id='getconstants-classname'>getConstants(classname)</h3>
<p>Get list of constants (static final fields) for a class</p>
<p>:param str classname: classname</p>
<p>:return: list</p>
<blockquote>
<p>sample code to show getConstants</p>
</blockquote>
<h3 id='environment'>environment()</h3>
<p>A map of various useful environment details</p>
<p>:return: environment map object includes id, display, offset, TZ, SDK, download, appcache, availblocks, blocksize, blockcount, sdcard</p>
<blockquote>
<p>sample code to show environment</p>
</blockquote>
<h3 id='log-message'>log(message)</h3>
<p>Writes message to logcat</p>
<p>:param str message: message</p>
<blockquote>
<p>sample code to show log</p>
</blockquote>
<h2 id='0108-sendemail'>0108 SendEmail</h2><h3 id='sendemail-to-subject-body-attachmenturi'>sendEmail(to, subject, body, attachmentUri)</h3>
<p>Launches an activity that sends an e-mail message to a given recipient</p>
<p>:param str to: A comma separated list of recipients
:param str subject: subject
:param str body: mail body
:param str attachmentUri(Optional): message</p>
<blockquote>
<p>sample code to show sendEmail</p>
</blockquote>
<h2 id='0109-toast-getinput-getpassword-notify-apis'>0109 Toast, getInput, getPassword, notify APIs</h2><h3 id='maketoast-message'>makeToast(message)</h3>
<p>Displays a short-duration Toast notification</p>
<p>:param str message: message</p>
<blockquote>
<p>sample code to show makeToast</p>
</blockquote>
<h3 id='getinput-title-message'>getInput(title, message)</h3>
<p>Queries the user for a text input</p>
<p>:param str title: title of the input box
:param str message: message to display above the input box</p>
<blockquote>
<p>sample code to show getInput</p>
</blockquote>
<h3 id='getpassword-title-message'>getPassword(title, message)</h3>
<p>Queries the user for a password</p>
<p>:param str title: title of the input box
:param str message: message to display above the input box</p>
<blockquote>
<p>sample code to show getPassword</p>
</blockquote>
<h3 id='notify-title-message-url'>notify(title, message, url)</h3>
<p>Displays a notification that will be canceled when the user clicks on it</p>
<p>:param str title: title
:param str message: message
:param str url(optional): url</p>
<blockquote>
<p>Sample code of notify</p>
</blockquote>
<div class="highlight"><pre class="highlight python tab-python"><code> <span class="kn">import</span> <span class="nn">androidhelper</span>
<span class="n">droid</span> <span class="o">=</span> <span class="n">androidhelper</span><span class="p">.</span><span class="n">Android</span><span class="p">()</span>
<span class="n">droid</span><span class="p">.</span><span class="n">notify</span><span class="p">(</span><span class="s">'Hello'</span><span class="p">,</span><span class="s">'QPython'</span><span class="p">,</span><span class="s">'http://qpython.org'</span><span class="p">)</span>
<span class="c1">#You could set the 3rd parameter None also
</span>
</code></pre></div><h1 id='02-applicationmanagerfacade'>02 ApplicationManagerFacade</h1><h2 id='0201-manager-apis'>0201 Manager APIs</h2><h3 id='getlaunchableapplications'>getLaunchableApplications()</h3>
<p>Returns a list of all launchable application class names</p>
<p>:return: map object</p>
<blockquote>
<p>sample code to show getLaunchableApplications</p>
</blockquote>
<h3 id='launch-classname'>launch(classname)</h3>
<p>Start activity with the given class name</p>
<p>:param str classname: classname</p>
<blockquote>
<p>sample code to show launch</p>
</blockquote>
<h3 id='getrunningpackages'>getRunningPackages()</h3>
<p>Returns a list of packages running activities or services</p>
<p>:return: List of packages running activities</p>
<blockquote>
<p>sample code to show getRunningPackages</p>
</blockquote>
<h3 id='forcestoppackage-packagename'>forceStopPackage(packageName)</h3>
<p>Force stops a package</p>
<p>:param str packageName: packageName</p>
<blockquote>
<p>sample code to show forceStopPackage</p>
</blockquote>
<h1 id='03-camerafacade'>03 CameraFacade</h1><h2 id='0301-camera-apis'>0301 Camera APIs</h2><h3 id='cameracapturepicture-targetpath'>cameraCapturePicture(targetPath)</h3>
<p>Take a picture and save it to the specified path</p>
<p>:return: A map of Booleans autoFocus and takePicture where True indicates success</p>
<h3 id='camerainteractivecapturepicture-targetpath'>cameraInteractiveCapturePicture(targetPath)</h3>
<p>Starts the image capture application to take a picture and saves it to the specified path</p>
<h1 id='04-commonintentsfacade'>04 CommonIntentsFacade</h1><h2 id='0401-barcode-apis'>0401 Barcode APIs</h2><h3 id='scanbarcode'>scanBarcode()</h3>
<p>Starts the barcode scanner</p>
<p>:return: A Map representation of the result Intent</p>
<h2 id='0402-view-apis'>0402 View APIs</h2><h3 id='pick-uri'>pick(uri)</h3>
<p>Display content to be picked by URI (e.g. contacts)</p>
<p>:return: A map of result values</p>
<h3 id='view-uri-type-extras'>view(uri, type, extras)</h3>
<p>Start activity with view action by URI (i.e. browser, contacts, etc.)</p>
<h3 id='viewmap-query'>viewMap(query)</h3>
<p>Opens a map search for query (e.g. pizza, 123 My Street)</p>
<h3 id='viewcontacts'>viewContacts()</h3>
<p>Opens the list of contacts</p>
<h3 id='viewhtml-path'>viewHtml(path)</h3>
<p>Opens the browser to display a local HTML file</p>
<h3 id='search-query'>search(query)</h3>
<p>Starts a search for the given query</p>
<h1 id='05-contactsfacade'>05 ContactsFacade</h1><h2 id='0501-contacts-apis'>0501 Contacts APIs</h2><h3 id='pickcontact'>pickContact()</h3>
<p>Displays a list of contacts to pick from</p>
<p>:return: A map of result values</p>
<h3 id='pickphone'>pickPhone()</h3>
<p>Displays a list of phone numbers to pick from</p>
<p>:return: The selected phone number</p>
<h3 id='contactsgetattributes'>contactsGetAttributes()</h3>
<p>Returns a List of all possible attributes for contacts</p>
<p>:return: a List of contacts as Maps</p>
<h3 id='contactsgetids'>contactsGetIds()</h3>
<p>Returns a List of all contact IDs</p>
<h3 id='contactsget-attributes'>contactsGet(attributes)</h3>
<p>Returns a List of all contacts</p>
<h3 id='contactsgetbyid-id'>contactsGetById(id)</h3>
<p>Returns contacts by ID</p>
<h3 id='contactsgetcount'>contactsGetCount()</h3>
<p>Returns the number of contacts</p>
<h3 id='querycontent-uri-attributes-selection-selectionargs-order'>queryContent(uri, attributes, selection, selectionArgs, order)</h3>
<p>Content Resolver Query</p>
<p>:return: result of query as Maps</p>
<h3 id='queryattributes-uri'>queryAttributes(uri)</h3>
<p>Content Resolver Query Attributes</p>
<p>:return: a list of available columns for a given content uri</p>
<h1 id='06-eventfacade'>06 EventFacade</h1><h2 id='0601-event-apis'>0601 Event APIs</h2><h3 id='eventclearbuffer'>eventClearBuffer()</h3>
<p>Clears all events from the event buffer</p>
<h3 id='eventregisterforbroadcast-category-enqueue'>eventRegisterForBroadcast(category, enqueue)</h3>
<p>Registers a listener for a new broadcast signal</p>
<h3 id='eventunregisterforbroadcast-category'>eventUnregisterForBroadcast(category)</h3>
<p>Stop listening for a broadcast signal</p>
<h3 id='eventgetbrodcastcategories'>eventGetBrodcastCategories()</h3>
<p>Lists all the broadcast signals we are listening for</p>
<h3 id='eventpoll-number_of_events'>eventPoll(number_of_events)</h3>
<p>Returns and removes the oldest n events (i.e. location or sensor update, etc.) from the event buffer</p>
<p>:return: A List of Maps of event properties</p>
<h3 id='eventwaitfor-eventname-timeout'>eventWaitFor(eventName, timeout)</h3>
<p>Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer</p>
<p>:return: Map of event properties</p>
<h3 id='eventwait-timeout'>eventWait(timeout)</h3>
<p>Blocks until an event occurs. The returned event is removed from the buffer</p>
<p>:return: Map of event properties</p>
<h3 id='eventpost-name-data-enqueue'>eventPost(name, data, enqueue)</h3>
<p>Post an event to the event queue</p>
<h3 id='rpcpostevent-name-data'>rpcPostEvent(name, data)</h3>
<p>Post an event to the event queue</p>
<h3 id='receiveevent'>receiveEvent()</h3>
<p>Returns and removes the oldest event (i.e. location or sensor update, etc.) from the event buffer</p>
<p>:return: Map of event properties</p>
<h3 id='waitforevent-eventname-timeout'>waitForEvent(eventName, timeout)</h3>
<p>Blocks until an event with the supplied name occurs. The returned event is not removed from the buffer</p>
<p>:return: Map of event properties</p>
<h3 id='starteventdispatcher-port'>startEventDispatcher(port)</h3>
<p>Opens up a socket where you can read for events posted</p>
<h3 id='stopeventdispatcher'>stopEventDispatcher()</h3>
<p>Stops the event server, you can't read in the port anymore</p>
<h1 id='07-locationfacade'>07 LocationFacade</h1><h2 id='0701-providers-apis'>0701 Providers APIs</h2><h3 id='locationproviders'>locationProviders()</h3>
<p>Returns availables providers on the phone</p>
<h3 id='locationproviderenabled-provider'>locationProviderEnabled(provider)</h3>