Android Wear keyboard Input Method - android

for my Android Wear app I need a Keyboard to enter text. I do not want to use the Microphone Input of the Google Voice Service.
I found a nice tutorial on how to do Custom Keyboards on android (http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615 )
and tried it out on Android Wear. However since you cannot choose the Input Method in the settings, the Keyboard wont get inflated on Input fields.
I found out that there already are some keyboards for Android Wear like the "Minuum" or the "Analog Keyboard for Android Wear". So it must be possible somehow to do a custom Keyboard for the Watch.
I can test the app on an Samsung Gear Live and Sony Smartwatch 3 but on neither of them it is working yet.
Does someone know how to program a Custom Keyboard for the Android Wear?
Thank you.

Do the steps as follows:
1. Open [Debug] mode on your android wear device.
2. connect your wear device to a computer via USB.
3. Open a command line window, and navigate to ADB directory.
4. using this command to install your signed IME apk. "adb install ime.apk"
5. activate your input method. "adb shell ime enable com.example.xxx/.yourInputServiceName"
6. set your ime as default. "adb shell ime set com.example.xxx/.yourInputServiceName"
This is the only way you can use your ime on android wear. There are two reasons why:
1. Android wear disabled the input & language setting activity, so you can not call it as you can do so on android phone.
2. Due to security reason, you can not run adb shell commands from inside of your app, for example, using the following code will give you a security exception.
Runtime.getRuntime().exec("ime enable ......").
But, may be you can change your app to be a systme app rather than a user app. How to do it? I dont know. If you got answer, please tell me.

Related

Is there an alternative to the chrome feature flag "CommandLineOnNonRooted" to test a TWA

I am trying to use a TWA as explained in the original documentation (https://developers.google.com/web/updates/2019/02/using-twa). I tried setting the chrome flag Enable command line on non-rooted devices to Enable, but Chrome is telling me after the relaunch that You are using an unsupported feature flag: CommandLineOnNonRooted. Stability and security will suffer. I tested this on two real Android phones, one on Android 10, one on 9. I also tested it with multiple emulator devices on different Android versions but I am getting the same error message.
Is there any other way to test that the URL bar is not visible in the TWA, without the verification on the website part?
This feature is for debugging reasons. If you just want to test if the Url Bar is visible or not you do not have to enable this feature.
From the Link, getting Started with TWA:
Enable debug mode:
Open Chrome on the development device, navigate to chrome://flags, search for an item called Enable command line on non-rooted devices and change it to ENABLED and then restart the browser.
Next, on the Terminal application of your operating system, use the Android Debug Bridge (installed with Android Studio), and run the following command:

Is there any way to skip Android device setup wizard using ADB when device is on Android P?

I want to skip the Android P setup wizard programmatically to reach Home Screen to proceed doing other scripted jobs. Since the ADB already recognizes the device when plugged on first setup wizard page, I was trying to skip initial setup using it. Is there any way to do that using ADB or by other tools, potentially Python?
I think I may have tried this before and I don't believe there is. While the ADB recognizes that there is a device attached, that doesn't mean it can read it. The device would have to be set up completely before it would be able to interact and read/send data to the ADB.

Connect to RS232 from Android - No permission dialog or shell command

Objective
I'm developing a custom app for internal use on a rooted android mini-pc.
The goal (between others... so...many...others...) is to be able to turn on and off a tv using the serial port embeeded on the tv.
I'm using an FTDI UART RS232 serial usb cable for it.
Status
The application is working right now, using an android library (serial-driver) i can communicate with the tv, but the problem is that the device asks for permissions every install (and sometimes, weirdly, again on the same device), so it needs to be improved.
Issue
Since the device doesn't have mouse or keyboard by default, when this happens someone has to click the buttons, and since the device is normally hidden behind the screen, it can be really annoying.
My two bits
This problem, i feel, can be solved by two methods, but i still haven't been able to make them work.
Since the device is rooted, i might be able to modify an unknown (to me) parameter that allows me to bypass the permission request. For this i have tried to make an intent filter for the usb device, and to rewrite the interface that controlls this behaviour, both without success. Is there a way to make this android version more lenient about permissions?
I use for other reasons SuperSU inside the app, so i can use the full width of the might shell power. Using this i've been trying to send commands manually to the device (/dev/bus/usb/00X/00Y), but this haven't worked. My theory is that it's beacuse of the permissions of the device path, but even doing an unhealthy chmod 777 i cannot have them working.
So, that's my problem right now. I hope someone here can help me.
Additional data
Running: Custom Android 4.4.2 (Cannot be changed)
Needs to be doable solely from within the apk (but it can use shell commands)
We don't have the manufacturer signature to install it as a system app
We can use only one app, so i cannot have another one to move this one to /sys/apps, and i don't know if an app can do that to itself.
using Busybox stty -F /dev/.../ returns "Operation not permitted"

Migrated to Android Studio: Where are the hardware buttons in the emulator?

I just migrated my projects and development to Android Studio. Even though I prefer to use hardware devices for development/testing sometimes I use the emulator. On Android studio I cannot find the option to enable the hardware keys on the device! How can I press now the power button/volume buttons, home/back/menu buttons?
I have already tried creating a new device and enabling the hardware keys on the device settings. But I do not get them.
Any help would be appreciated.
I don't know for sure about making the buttons show up on the UI, but you can use ADB to send key events to your device.
for example: adb shell input keyevent 3 is equivalent to clicking the home button.
For a complete list of valid key codes check this answer to another question.

Can I call Android LockScreen function from Linux command line?

Running Android 4.0.4 on Emerson EM543 Tablet. Could not install Google Play so had to install Android Market. Market apparently somehow disables the Android system LockScreen. So, now trying to get lockscreen back on boot (downloadable apps, as far as I can see, don't lock screen at system boot, which is what I want). I got a terminal emulator and was wondering if there was a Linux command line argument I could use to start Droid lockscreen at system startup. Any suggestions?
All the questions and solutions I have found regarding "lockscreen" deal with programmatic solutions. I am looking for a command line argument that could be used in a startup script.
Programmatically in android code, you can use Device Admin API's to lock screen, Refer http://developer.android.com/guide/topics/admin/device-admin.html
devicepolicymanager.lockNow();

Categories

Resources