Replace default smileys menu - android

I want to replace the default smileys menu (the one that shows up when the smiley button on the virtual keyboard is pressed) with a custom one with own drawables. Is this even possible?
If not, is there any way to get access to the smartphone's default smiley drawables so I can show them in my textview?
I'd love to use my own ones though. Any suggestions?

No. Not without making your own keyboard. Which you can do of course. Part of the reason that this is a no is that each keyboard does smilies on its own, so they all have different ones.
You can put any image you want in a textview - just use an ImageSpan. Android doesn't really have default emoticons (although an OEM may use a consistent set across pre-installed apps). Either keyboards will insert their own emoticons via image spans, or apps will see a familiar pattern like :-) in the text and convert it into an image span. If you want the images from the default android keyboard you can find those in the AOSP somewhere, or by unzipping the apk file.

Related

How does Android's image copy-paste work and can this feature be expanded/modified?

Apologies if there is already information about this. I couldn't find anything.
On Android, you can long-press an image and choose copy. On other apps, such as Messages, Discord, FB Messenger, and Twitter, the image will show up as a suggestion above the keyboard. If you tap it, it will upload the image to the text/tweet/etc. It also works when searching on Chrome - you can either select "Image you copied" or use the keyboard suggestion like with other apps. However, long-pressing the text input and selecting Paste does NOT work in any of these apps.
How does this image copy-paste function work? Is it something that could be emulated with other file types other than images, such as audio files? Can you force a file from an app to show up in the keyboard suggestions on other apps? Or, is it just a built-in feature that can't really be expanded on at all? Thanks for your help.
How does this image copy-paste function work?
Android has a Clipboard Framework which can be used to copy & paste content from one place to other
Is it something that could be emulated with other file types other than images, such as audio files
Android supports generic way to copy paste content, as long as the content is a standard multi-media type you can do copy paste. only prerequisite is that the both application should support the file-type.
The app you are copying the content should know how to put the data in the clipboard, and the app that you are pasting should know how to decode the content.
Android provide all information like, whats the content type and everything so what matters is both app should make use of this Clipboard framework.
Can you force a file from an app to show up in the keyboard suggestions on other apps?
You can't force it appear on top of keyboard, even a simple copied text will show only one time on top of keyboard. even though the content present on clipboard keyboard won't show it second or third time.
It's basically specific to how a keyboard app is designed, the above scenario is true for G-board at the time of writing this.

Edit translation text at runtime from server

Overview
AFAIK on Android you have twi ways to set the texts of your application:
You can use string.xml with different locales
You can download strings from server and set every label with a setText(language.text) but it will be a pain
The problem might sussist if you have to change a text of your published application without re-publishing it; for example if you want to change for a specific translation a small text without any functionality change. (ie: you might notice that you wrote "Take picure" instead of "Take picture").
Library
i18next is a good library to manage translations dinamically from server, but you still have to add the text for each label you got.
So, my question is
Still AFAIK, there is no way to do it natively, but is there a low level library or a workaround that allows to replace a string in your string.xml with some downloaded text?
Another option could be to make our label text to point instead of at #string/myValue to something like #myresource.pathtovalue.
Honestly I think this could be an huge improvement for application, is there something useful?

Android - copy and paste un-slelectable text

I am building an app which requires the user to copy and paste a ten digit identification number from another app on the phone. Only thing is, in the other app, the ID number is presented as a header/title bar. I am sure it is not an image with text. Most apps for custom text capture require the user to take a screenshot and use some OCR operation to harvest the text from an image.
I find this as taking too many steps for my users, some of whom may not even know how to take a screenshot with android using the volume and power buttons.
Is there any way to copy and paste text that is un-highlightable on an app without using a screenshot?
Can I code my app to add context menu option on long press any text on screen so I can grab this text?

default selector for imageButton in Android

I'm trying to locate the Android XML and drawable files that are used by default for imageButtons.
I'm trying to customise an imageButton using a selector. When I create a new project, by default the background color of an imageButton is transparent-grey and it gets highlighted in blue when touched. (I'm SDK-19 and .Light theme). To avoid the hassles of re-creating lots of icons, I want to find the default XML selector code and 9.pngs Android uses for an imageButton.
Looking in the SDK android-19/data/res/drawable folder there are a bunch of XML selectors defined in files with names like "btn_default_holo_light" "btn_default_transparent" etc., and a bunch of button drawables in .../drawable-hdpi.
I can pick any of these, copy it into a "my_selector.XML" file in my project's drawable folder (plus copy the necessary drawables into my projects drawable_hdpi), and set "my_selector" as my imageButton's background. This all works fine...Except none of the SDK files I've found results in the default "blue when touched" effect (some turn the imageButton orange, others do nothing...).
I'm sure the default files are right there under my nose but I'm pulling my hair out trying to find them!
Any help appreciated
I am afraid you won't find the default images you are looking for in the SDK files. The default images can vary from device to device, rather than from android version to android version. The effect you are looking for is probably specific to your device/emulator.
"The appearance of your button (background image and font) may vary from one device to another, because devices by different manufacturers often have different default styles for input controls."
Reference^^
If you just want to get the images and copy them, you may be able to find them on the actual device by activating USB Debugging and searching through the usually hidden folders on your particular device. The storage of those files probably vary between devices so I am afraid I can't tell you where they are (some files are kept hidden even with Debugging active. In those cases apps such as ES File Explorer might be able to help). Although this probably wasn't the answer you were looking for I hope this helps.

is it possible to create a Android application that can replace other applications text

I wanted to know if it is possible to create
a Android application, when it is running (in background) it replaces if text for example:
"(smiley)" => ":)"
it should work for all other applications
If yes, then how?
I've tried to create custom symbols via SoftKeyboard, but that is not what i want.
Thank you.
One app cannot directly change the contents of another app's UI.
An input method editor (IME, a.k.a., "soft keyboard") may be able to help the user create emoticons and the like, but the user has to opt into using it.

Categories

Resources