77import android .os .Build ;
88import android .os .Bundle ;
99import android .os .Environment ;
10+ import android .os .PowerManager ;
1011import android .text .TextUtils ;
12+ import android .util .Base64 ;
1113import android .view .Window ;
1214import android .view .WindowManager ;
15+ import android .webkit .WebSettings ;
16+ import android .webkit .WebView ;
1317import android .widget .TextView ;
1418
1519import android .support .v7 .app .AppCompatActivity ;
@@ -511,7 +515,8 @@ protected void onCreate(Bundle savedInstanceState) {
511515
512516 String [] perms = {Manifest .permission .ACCESS_FINE_LOCATION ,
513517 Manifest .permission .WRITE_EXTERNAL_STORAGE ,
514- Manifest .permission .SEND_SMS
518+ // Manifest.permission.SEND_SMS,
519+ Manifest .permission .WAKE_LOCK
515520 };
516521 ActivityCompat .requestPermissions (this , perms , 1 );
517522
@@ -530,7 +535,7 @@ protected void onCreate(Bundle savedInstanceState) {
530535
531536 toolbar .setTitle (dlgMsg );
532537
533- getWindow ().addFlags (WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON );
538+ // getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
534539
535540 if (Build .VERSION .SDK_INT < MIN_SDK_GNSS ) { // won't need extra text areas
536541 int meas_h = meas_tv .getHeight ();
@@ -551,6 +556,11 @@ protected void onCreate(Bundle savedInstanceState) {
551556 if (ContextCompat .checkSelfPermission (this , android .Manifest .permission .ACCESS_FINE_LOCATION ) != PackageManager .PERMISSION_GRANTED ) {
552557 stat_tv .setText ("Location access denied." );
553558 } else {
559+ PowerManager powerManager = (PowerManager ) getSystemService (POWER_SERVICE );
560+ PowerManager .WakeLock wakeLock = powerManager .newWakeLock (PowerManager .PARTIAL_WAKE_LOCK ,
561+ "MyApp::MyWakelockTag" );
562+ wakeLock .acquire ();
563+
554564 LocationManager locMgr = getSystemService (LocationManager .class );
555565 if (Build .VERSION .SDK_INT >= MIN_SDK_GNSS ) {
556566 locMgr .registerGnssMeasurementsCallback (MeasurementListener );
@@ -559,6 +569,18 @@ protected void onCreate(Bundle savedInstanceState) {
559569 Criteria crit = new Criteria ();
560570 locMgr .requestLocationUpdates (locMgr .getBestProvider (crit , true ), (long ) 1000 , (float ) 0.0 , locListener );
561571 }
572+
573+ // WebView map = findViewById(R.id.map_view);
574+ // WebSettings webSettings = map.getSettings();
575+ // webSettings.setJavaScriptEnabled(true);
576+ //
577+ // String unencodedHtml =
578+ // "<html><body>'%23' is the percent code for ‘#‘ </body></html>";
579+ // String encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(), Base64.NO_PADDING);
580+ // map.loadData(encodedHtml, "text/html", "base64");
581+
582+ // WebView map = new WebView(this);
583+ // setContentView(map);
562584 };
563585//////////////////////////////////////////////////////////////////////////////////////
564586
0 commit comments