This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.ajoberstar.grgit.Grgit | |
apply plugin: 'com.android.application' | |
lastCommitHash = { -> | |
git = Grgit.open() | |
def lastHash = git.head().getAbbreviatedId() | |
println("INFO: Last Git Hash $lastHash") | |
return lastHash | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WifiScanner { | |
private class ScanWifiNetworkReceiver extends BroadcastReceiver { | |
@Override | |
public void onReceive(final Context context, final Intent intent) { | |
final List<ScanResult> wifiNetworks = wifiManager.getScanResults(); | |
final List<ScanResult> rttSupportedNetworks = new LinkedList<>(); | |
for (ScanResult network : wifiNetworks) { | |
// Check if Wifi network supports ranging | |
if (network.is80211mcResponder()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WifiRttManager rttManager = (WifiRttManager) getSystemService(Context.WIFI_RTT_RANGING_SERVICE); | |
if (rttManager.isAvailable()) { | |
// TODO Smartphone supports ranging | |
} else { | |
// TODO Smartphone doesn't support ranging | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RangingRequest request = new RangingRequest.Builder() | |
.addAccessPoint(scanResult) | |
.build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RangingResultCallback callback = new RangingResultCallback() { | |
@Override | |
public void onRangingFailure(final int i) { | |
// TODO ranging failed -> handle it. | |
} | |
@Override | |
public void onRangingResults(final List<RangingResult> list) { | |
// TODO ranging successful -> handle it | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rttManager.startRanging(request, callback, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(const OverlayPortalExampleApp()); | |
class OverlayPortalExampleApp extends StatelessWidget { | |
const OverlayPortalExampleApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |