Adb shell command to disable keyboard suggestions on android - android

So I am trying to disable keyboard suggestions and contact suggestions programmatically on an aosp api 29 emulator (for e2e screenshot test purposes) which I belive should start like adb shell settings put ... but I cannot seem to find a command to switch that off as my google fu is not strong enough. Would be amazing if someone here knows the answer to that.
So what I would like to achieve is to disable the suggestion part in the image shown below
Thank you in advance

If you are using AVD from android SDK, in wizard configuration there is show advance settings that let you enable keyboard input or not.
And if you are using another emulator apps there should be an address like ~/.android/avd/<The_Device_Name>/config.ini in your home directory and then Change the below setting to be:
hw.keyboard=yes
also do not forget to restart the emulator after changes.

Related

Debug Installed App

How can I debug an app that was built with debugging turned on but is already installed on a phone?
I have tried to find a way to attach Android Studio to an existing app, but can't figure that out. Do I need to use adb in some way to do this? Any hints would be appreciated.
Click in the fourth button in the bar (This is screenshot is from AndroidStudio 2.2, the icons have changed but the position is the same).
After that, it will prompt to you all running application that can have debug attached, just select it and you are now debugging.

Android Wear keyboard Input Method

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.

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.

How to start Android console on VirtualBox emulator?

I've set up Android on a virtualbox, it boots and runs correctly.
However I'm trying to start its console so I can do netcfg and get the IP address, so I can try connecting the adb to it.
As the tutorials say, I tried pressing ALT + F1 but it has no effect. I've tried both the right and left ALT buttons but the console doesn't show up.
What am I doing wrong? Does Android have to be started in Debug mode to see the console?
No need for Debug mode for use the console. What a image are you use? Try [Ctrl]+Alt+F2/F3, or download other image.
Easiest way it's to open the Android Apps inside the VM and open a Terminal Emulator like you will do in your phone.
At least, I do it that way as ALT+F1 doesn't work for me.
Then, in the terminal emulator, you can use "su" to root and "netcfg" to know the IP of the VM so as to use it in "adb connect IP".
Hope it helps

"Unable to open log device '/dev/log/main': No such file or directory"

I am new to Android development and bought a cheap Huawei Sonic (U8650 apparently) so I could test my first attempts at making an app on an actual device.
However, whenever I try to use 'adb logcat' or 'adb shell' then 'logcat' on the device I get:
Unable to open log device '/dev/log/main': No such file or directory
I have already enabled Usb debugging in Settings -> Developer.
I just don't know enough about Android to know if this is something I can even fix.
I have found two other questions with similar problems:
/dev/log/main not found
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Unable to open log device '/dev/log/main': No such file or directory
...but they both turned out to be using some kind of non standard kernel that had logging disabled. Mine is a stock phone out of the box.
It's a very cheap but snappy Android 2.3 phone, so hopefully it wasn't a total waste of money.
Any help would be greatly appreciated.
Dial this: *#*#2846579#*#*
Service menu will appear.
Go to "ProjectMenu" -> "Background Setting" -> "Log Setting"
Open "Log switch" and set it to ON.
Open "Log level setting" and set the log level you wish.
Reboot the phone.
Open: /system/etc/init.d/××× (not the same file on different ROMs, find the right file)
Find the line that says: rm /dev/log/main
Change the line to: # rm /dev/log/main (comments out the line, rm = remove, in case you were wondering)
Save and reboot
I'm sharing my case and solution:
My cellphone had a jellybean version oriented to performance (To be exact a Slim Bean ROM) with a Semaphore kernel (You can recognize it because when the cellphone is starting, the semaphore logo is shown). These kind of ROM have by default disabled the logging so I had to download the Semaphore Manager application (You can download it from here). After that, in the section "Modules" I had to turn on the Logger option as it is shown in the picture
Restart and the logcat should be working now!
I have actually found an answer for this finally!
I was having another aimless look to see if anything had been updated about this anywhere and came across a post on xda-developers about a slightly different Huawei device with the same problem.
http://forum.xda-developers.com/showpost.php?p=17774398&postcount=93
It actually worked. I have complete logcat logging on my Huawei Sonic (U8650) now.
Three cheers for not giving up.
Solution, copied from the xda (in case it is removed etc):
There is a hidden service-menu where you can set loggin up. The
service-menu is started by "dialing" this phone number:
*#*#2846579#*#*
I have a custom rom on my Samsung Captivate, but my approach may work for others as well:
Open up CMD or Terminal and type:
adb shell
logcat-enable
reboot
The rom I have is Continuum v6.1, but this still may work for others.
If you have the terminal emulator on the phone, you also may be able to do:
logcat-enable
and then just reboot the phone. I didn't try that, but it probably would work too. My phone is also rooted - don't know if that makes a difference.
it was enough to restart the Huawei device
adb shell
reboot
I'm having exactly the same problem.
Someone from xda-developers wrote something as follows in msg #33
http://forum.xda-developers.com/showthread.php?t=1169869&page=4
One of the reason it can't be rooted is this phone had removed the
"Logcat" mechanism from android. So, this makes most of rooting ways
malfunction.
Maybe right maybe wrong i don't know.Anyway it gives some idea about the case.

Categories

Resources