I'm doing a school project as a team, but none of us have never developed or even worn smartwatches.
We want to get the number of "tap" on a smartwatch's locked screen but we don't find out if that's possible.
Do you know a way to get the number of "tap" on a locked smartwatch screen?
If this is not possible, can we display a constant notification and retrieve the number of "tap" on this notification?
I'm using a Moto 360 with Android 6.0.1 and Android Wear 1.4.0.
Thank you in advance.
I would advise everyone on the team get a chance to the use watch just to understand the user experience. Watches are very battery limited devices and will always try to go into low power mode as often as possible.
Do you know a way to get the number of "tap" on a locked smartwatch screen?
Tapping normally wakes up watch, either from full screen off or lower power ambient mode. If you want to capture taps/button press you can create a watch app which when active will receive taps/button presses. I'm not quite sure if watch face can capture taps, and if it did it my guess would be after the watch face is fully on, but that would be another place to look.
If this is not possible, can we display a constant notification and retrieve the number of "tap" on this notification?
Custom watch face can allow display of custom content. Alternatively as a watch app you can show what you want.
Additional Comments
The Moto 360 came out in 2014 and was one of first Android Wear watches available. The latest code samples & codelabs from Google are for Wear OS 2.0. You can look back in the commit history for old versions of samples which may be more compatible with Android Wear 1.4
Also from this Android Wear Notice May 2015 always on apps became possible so that might work for your project/use case.
Related
So I been trying to get my first Wear Os watch face published But when I submit I keep it keeps getting rejected. I only lightly changed the Sample Android studio provides nothing much changed but the background and the way the hands move.
I keep getting this.
I really do not know why it keeps getting rejected. I make sure it works for both square and round wear OS.
I keep getting this message
Step 1: Fix the eligibility issue with your app
During review, we detected the following eligibility issue and were unable to accept your app for Wear OS:
The basic functionality of your app does not work as described in App Bundle
Wear OS functionality should work as expected or as described in the app's Google Play Store listing. Please make sure to test your app on a variety of Wear OS devices and configurations.
For example, Hours and Minutes hands are not placed in the center of the watch face on Square Device. as shown/described on the store listing.
I really don't know what to do because I have appealed twice. I asked is it because I am moving the arrows differently. I get the same generic response.
Thank you all for the questions and comments.
I did test the application on sq watches.
And same results I got.
Things started changing when I added a circle into the middle of the screen and that ended up being allowed as center. I have no idea why that would matter I knew it was already centered.
Thanks all.
How to Capture a Picture without Previewing in Android Studio use camera2 api
Google is protecting their users from this feature. You are no longer going to be able to do this as of Android Pie (API 28). This was first reported as of February of 2018.
"According to a source code commit spotted by XDA Developers, Android P will detect and prevent background applications from accessing the camera."
https://www.androidauthority.com/android-p-camera-restrictions-839076/
https://www.xda-developers.com/android-p-background-apps-camera/
Since this is going to limit your ability to upgrade this feature, as well as possibly getting your app disabled in the Play store, I'd avoid doing this.
You don't have to Display the previews but you need to go through at least 5-6 previews before the image is even decent. You run into a lot of issues where the image is too dark because it hasn't taken in enough light or it is out of focus. So you would need to cycle through many images in the preview. You don't need to display them. Only then can you take an actual picture using the STILL_CAPTURE template.
I have a Bluetooth led bulb that will only work with one specific app. I want to create an app that will open the bulb app (iHomentLight) and gradually increase the brightness slider to wake me up in the morning. I want to know if it is possible to do this, and if so how?
Apps are sandboxed so that someone can't use this kind of thing to take advantage of you (and steal your bank info for example). Some apps work around this via accessibility service.
How to perform Other app list item click using accessibility service like Voice Access app?
However, you are probably better off just figuring out what the bluetooth API for your bulb is and teaching your app to work with it. You'll have your app connect directly to the bulb and do it yourself. Search Google for the bulb name and see if anyone has reverse-engineered the API.
Here is an amazing writeup on how to reverse engineer a bluetooth API:
https://medium.com/#urish/reverse-engineering-a-bluetooth-lightbulb-56580fcb7546
Spend some time trying this out, I think it'll be a more useful skill than messing with the accessibility service.
There are around three approaches you can take:
1 - If you have access to iHomentLight's API, you could potentially send a series of intents to the app and have it gradually adjust the light over time.
2 - If that is elusive, I'd recommend trying to sending touch commands via the terminal. For example 'input tap x y android'.
How to run terminal command in Android application?
3 - Or you can use Tasker App to make commands that will adjust the light just as well
I have in the past developed some small Android Apps, and have recently gotten an LG G Watch, and absolutely love it.
Right now, the only issue with the device is that it lasts about a day and a half in ambient mode.
What I am looking to be able to do is through software, enable and disable the ambient mode on the device. In doing this, we will be able to turn it off at specific times, i.e. at night.
The advantage of being able to do this is both save the display, and by turning ambient mode off at night, I only need to charge the device every other day, but it is just an inconvenience to enable / disable every day.
I have the Java / Android experience to build the app, but the question I have is essentially the whole thing:
How can I, in code, enable and disable ambient mode?
Is this possible? I spent some time googling, and been unable to find an answer. Has anyone used the wearable API? And is there anything in it that would allow something like this?
It is not possible to disable ambient mode programatically. However, you don't need to do what you are describing. The device detects that is not worn and after 30 minutes it will turn the screen off completely, including turning off ambient mode.
If you are a AOSP programmer, modify AmbientService to call finish() from AmbientDream, if you are a app programmer, sorry there's no API for what you want.
After a user opens my application I don't want them to be able to get out. So when they press the home or back button it doesn't let them exit the app. I know there are ways using a service to keep the app always running in the background, but I don't even want them to even exit.
Is this even possible, if so how? Without having to hack the kernel.
I know this sounds odd, but it is not for a commercial app, but for my lab, it will never be on GooglePlay. The tablets will be given to little kids and they will take a test on it, so I can't have them using youtube or anything else.
Related post: Android, How to make the task of the app unclosable? Only closable by task killing
The answer by CommonWare seems to indicate that kernel hacking is the only way, but is it?
Also I am using Android L.
there is no official support yet - there will be support with android L via the Task locking API
The L Developer Preview introduces a new task locking API that lets
you temporarily restrict users from leaving your app or being
interrupted by notifications. This could be used, for example, if you
are developing an education app to support high stakes assessment
requirements on Android. Once your app activates this mode, users will
not be able to see notifications, access other apps, or return to the
Home screen, until your app exits the mode.
https://developer.android.com/preview/api-overview.html
EDIT: as you said you use L this got obsolete - but I leave it here as a hint for others
said that - you are also able to get this kind of work without root today if you have to ( e.g. kiosk mode app on a certain hardware ). It is not simple - and no solution that works for all devices - but if you need it you can get it work with tricks like:
- reacting on home-screen intent ( and setting it as default )
- when you go to background - bring your self foreground again
- ..
It seems google has some thing called COSU for setting up single-purpose devices
Android 5.0 Lollipop introduced two new ways to configure Android
devices for a single purpose:
With app pinning, the device user can temporarily pin specific apps to the screen.
With lock task mode, a user can’t escape the app and the Home and Recents buttons are hidden. Additionally, lock task mode gives the IT
administrator a more robust way to manage COSU devices, as discussed
below.
and
As an IT administrator, you can configure Android 6.0 Marshmallow and
later devices as corporate-owned, single-use (COSU) devices. These are
Android devices used for a single purpose, such as digital signage,
ticket printing, point of sale, or inventory management. To use
Android devices as COSU devices, you need to develop Android apps that
your customers can manage.
from here
and there is a code lab for it here
for earlier versions of android here i founded How-To Create a Working Kiosk Mode in Android which shows some hacks for disabling buttons and restarting the application after boot and lock. note that most of these hacks, don't work on android 6 and later