Skip to content

Instantly share code, notes, and snippets.

View virendersran01's full-sized avatar
💻
Working from home

Virender Srxn virendersran01

💻
Working from home
  • India
View GitHub Profile
android {
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
}
final WifiNetworkSuggestion suggestion1 =
new WifiNetworkSuggestion.Builder()
.setSsid("navigine_test_1")
.build()
final WifiNetworkSuggestion suggestion2 =
new WifiNetworkSuggestion.Builder()
.setSsid("navigine_test_2")
.setWpa2Passphrase("navigine_test_2_pass")
.build()
public void registerScanResultsCallback (Executor executor,
WifiManager.ScanResultsCallback callback);
public List<ScanResult> getScanResults ();
public void unregisterScanResultsCallback (WifiManager.ScanResultsCallback callback);
<manifest>
<!-- Grants the READ_PHONE_STATE permission only on devices that run
Android 10 (API level 29) and lower. -->
<uses-permission android:name="READ_PHONE_STATE"
android:maxSdkVersion="29" />
<uses-permission android:name="READ_PHONE_NUMBERS" />
</manifest>
public Set<Set<String>> getConcurrentCameraIds ();
public boolean isConcurrentSessionConfigurationSupported (Map<String, SessionConfiguration> cameraIdAndSessionConfig);
private static final Intent[] POWERMANAGER_INTENTS = {
new Intent().setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")),
new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")),
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity")),
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.Startup
public class NotificationService extends Service {
private static final int ID_SERVICE = 101;
@Nullable @Override public IBinder onBind(Intent intent) {
return null;
}
@Override public void onCreate() {
super.onCreate();
public class UploadWorker extends Worker {
public UploadWorker(
@NonNull Context context,
@NonNull WorkerParameters params) {
super(context, params);
}
@Override
public Result doWork() {
if (!mWifiScanning && timeNow > mWifiLastTime + WIFI_SLEEP_TIMEOUT)
{
if (mWifiBroadcastReceiver != null && !mWifiRegistered)
{
mContext.registerReceiver(mWifiBroadcastReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
mWifiRegistered = true;
}
if (mWifiManager.startScan())
{
/*
Initialize the NavigineSDK and load your location
*/
NavigineSDK.initialize(mContext, USER_HASH, SERVER_URL);
NavigineSDK.loadLocationInBackground(D.LOCATION_NAME, 30, mLoadListener); // Loading with Location.LoadListener callback
LocationView locationView = findViewById(R.id.locationView);
...
/*
After the location is loaded, you could set it to LocationView element