@@ -873,104 +873,6 @@ func main() {
873873
874874</details >
875875
876- <details >
877- <summary >How to get GPS coordinates</summary >
878-
879- > ** Library:** [ jni] ( https://github.com/xaionaro-go/jni ) — GPS is a Java-only API, not available via NDK.
880-
881- ``` go
882- package main
883-
884- import (
885- " fmt"
886- " log"
887-
888- " github.com/xaionaro-go/jni/location"
889- )
890-
891- func main () {
892- mgr , err := location.NewManager ()
893- if err != nil {
894- log.Fatal (err)
895- }
896-
897- loc , err := mgr.LastKnownLocation (" gps" )
898- if err != nil {
899- log.Fatal (err)
900- }
901-
902- fmt.Printf (" Lat: %f , Lon: %f \n " , loc.Latitude , loc.Longitude )
903- }
904- ```
905-
906- </details >
907-
908- <details >
909- <summary >How to connect to a WiFi AP</summary >
910-
911- > ** Library:** [ jni] ( https://github.com/xaionaro-go/jni ) — WiFi management is a Java-only API, not available via NDK.
912-
913- ``` go
914- package main
915-
916- import (
917- " fmt"
918- " log"
919-
920- " github.com/xaionaro-go/jni/net/wifi"
921- )
922-
923- func main () {
924- mgr , err := wifi.NewManager ()
925- if err != nil {
926- log.Fatal (err)
927- }
928-
929- fmt.Println (" WiFi enabled:" , mgr.IsEnabled ())
930-
931- // Scan and connect (requires ACCESS_FINE_LOCATION permission).
932- if err := mgr.Connect (" MySSID" , " MyPassword" ); err != nil {
933- log.Fatal (err)
934- }
935- fmt.Println (" Connected to MySSID" )
936- }
937- ```
938-
939- </details >
940-
941- <details >
942- <summary >How to send a notification</summary >
943-
944- > ** Library:** [ jni] ( https://github.com/xaionaro-go/jni ) — Notifications require the Java SDK, not available via NDK.
945-
946- ``` go
947- package main
948-
949- import (
950- " log"
951-
952- " github.com/xaionaro-go/jni/app/notification"
953- )
954-
955- func main () {
956- mgr , err := notification.NewManager ()
957- if err != nil {
958- log.Fatal (err)
959- }
960-
961- err = mgr.Notify (" channel_default" , notification.Builder {
962- Title: " Hello from Go" ,
963- Text: " This notification was sent from a Go program." ,
964- Icon: " ic_launcher" ,
965- })
966- if err != nil {
967- log.Fatal (err)
968- }
969- }
970- ```
971-
972- </details >
973-
974876<details >
975877<summary >How to query battery status</summary >
976878
0 commit comments