Stop step tracking in android wear devices - android

Is it possible to make a button inside an app to stop all step tracking on a galaxy wear device.
E.g. I built an app and I want a button in it to stop step tracking when pressed and re start step tracking when pressed again.
I haven't started building yet so not sure which language is needed
I haven't tried anything yet as I'm a react programmer ( beginner) and I will need to learn another language to make this work

Related

How can i avoid the restart of my application at unwanted times ? Flutter

I am using a package named flutter_background_service which allows me to have a service running h24 to search information on the Web. The problem is that normally there is a loop with an interval that can change to fetch information.
I noticed by going to see the different services in the developer tools (Oneplus Nord 2) that my service (my application in general) restarts by itself when my phone turned on sleep mode or at certain events. This is not the case for many applications like Instagram, WhatsApp, etc...
So my question is, how can I prevent the app from restarting so often to let my loop do itself?
Is there a package that allows me to change this or something to change in the different Android files ?
Thanks in advance for your help

How to track the time when the phone lock is open of closed?

How to track how many times does user unlock his/her phone in flutter?
That is something very platform specific. Because this is a rather unusual Usecase I doubt that there is any package that offers this functionality. Therefore you will probably have to use MethodChannels and implement it with platform specific code for each platform you want to support. Here is an explanation on how to do it for android: Android - detect phone unlock event, not screen on
You can use this library for this situation: https://pub.dev/packages/is_lock_screen
With this library you can counter how many times locked and unlocked phone in flutter

Keep Android Process (App) Running at All Times

Proglem:
Create custom Android App which will never be killed by the platform.
Given a Dialer app (or a phone-app), for making calls on Android Phone, is there a way to similarly create custom app and make it a system app, so that Android always keep it running?
In other words, the problem we have is to deploy an app which will never be killed by AOSP due to lack of resources or anything similar, which is what I think android does for Dialer and some other system apps/services.
Possible helpful hint: The device will always have power supply, as it is not a phone/tablet but rather a custom device running custom AOSP.

Is it possible to launch Unity3d Android app with enabled VR in non-VR mode?

We developing an app for Oculus Quest with multiplayer and it's working fine. Now we've come to the moment where we need to have a non-VR spectator app that is built from exact same project, but allows to control only the flying camera to observe the scene with other users.
There is no problem with build for PC - just adding 'None' in VR devices list after 'Oculus' allow the app to switch to desktop mode (or skip VR device from code if it is presented), but if we want to build spectator app for Android with similar way, there is only the black screen from very start (even no Unity splash, but sounds tells us that app is working).
Disabling XR in Player Settings allow us to build for Android with required functionality, but then every single timewe should build twice - VR and non-VR apk. However, as we're using automated build server, that pipeline becomes a nightmare because first you're making VR build, then commiting changed settings, building again for non-VR, then changing settings back and commiting once more. That hell tooks an hour if not more and fills the repo's changelog with trash. Of course we could build locally, but it completely blocks the machine for next 30-40 minutes per build, so it is unacceptable.
Any ideas would be appreciated, my friends!

How do Android applications quit?

I've read all the questions related to quitting Android application. But I could not find the answer to my problem.
So what is my problem. My application is a music player written in Qt (C++/QML). I wrote it especially for my car. First it was a UMPC with Windows, now I have an aftermarket headunit with Android. I successfully ported my player to Android.
Now I try to solve following issue. If I shut off my car, the Android "computer" inside my radio also shuts down. I would like to save the current track and the track progress so I can resume it on next start.
Is it possible to catch the signal from Android that my app should close and save the settings? Or does Android kill my application without giving me a chance to react to it?
Currently I'm saving the progress to a database every 10 seconds. But I feel this not ideal. I would like to know how applications are closed in Android in these situations:
1) The app is in background and OS decides it needs more RAM and terminates it
2) User invokes app switching menu a swipes my application away
3) System shuts down
4) A "battery saver" (task killer) closes my application
Can I react on some of these situations and do something before my app is closed.
If you use ApplicationWindow (you mention you are using QML so you should be using that) it is trivial:
onClosing: {
saveYourSettings()
close.accepted = true
}

Categories

Resources