In my android application, I would like to show small introductory tips for different features but I don’t want to be intrusive by showing them dialogs. What I want is something similar to:
Sorry for poor design but I hope it’s clear to understand. I want a small bar beneath ActionBar/Toolbar which shows the desired text and a close button aligned right. Clicking this cross button will permanently hide the tip.
Is there some library exists for such purpose or there’s room for something like this?
This will be much better way for applications to express their features without being intrusive.
Well, you can use a modified SnackBar like this
Kindle reader has a unique interface compared to all other reading apps. It takes a very large text and show it on screen in such a way that you dont have to scroll but you have to swipe to go to the next page. It reduces the text to be shown on the screen based on the screen size.
I have tried a lot but I am not able to see how they do it. There are number of questions on SO related to this but none of those answered were satisfactory. In many cases the problem is solved by adjusting the font of the text rather than text.
I think the correct approach to achieve this would be the following but I am not sure if all of it is possible in Android.
Create a Buffered reader and read each character.
Go on adding that character to the TextView
Check if the character is going beyond the visible area.
If yes stop and wait for the flick action else go to step1
If anyone can tell me how to achieve point 3 in android rest should be easy. Feel free to suggest other alternatives as well as long as they are not above web view.
I would like to create an application that can change / modify your default keyboard so that it has an image behind it (keys would be a little transparent so that you could see the image through the keyboard).
Can you point me in the right direction? I have looked at some sample applications, but this seems like an easy task, maybe with an easy solution?
You cannot modify or interfere with the user's default keyboard in any way whatsoever for security reasons.
The only way you'll get this done is if you write your own keyboard.
I have created a custom softkeyboard. It works for all the application throughout.
Is it possible to create a softkeyboard so that it can work for a particular application not for all the application.
Any ideas.
Thanks in advance
Here is good explanation of different ways to achieve this.
The Android Nethack application has a complete and clear source code example of how to create a custom keyboard for an application, how to display it on screen and how to define multiple keyboard layouts. It contains pretty much everything you need to know.
It is by far the best example I have seen.
http://code.google.com/p/nethack-android/
Umm, I guess you could integrate your own soft keyboard within your application - and never show the real one. Much work though, but I guess it could be done.
However you cannot force a certain soft keyboard to a certain application, but lots of keyboards support different styles using this in the XML:
android:inputType=""
Perhaps one of those would suit you?
For example if you'd like a keyboard fit for input in the form of email-addresses:
android:inputType="textWebEmailAddress"
I've been looking to create a custom keyboard for my application. At first, I started to look at the SoftKeyboard for the SDK examples, but reading the Android Developer Group led me to this post:
This is really not how the input
method framework is supposed to work.
An IME should be a generic input
facility, not for a particular
application. If you need some
app-specific input, you should build
it into your UI rather than pushing
it out to a generic IME.
How do I build an app-specific input within the UI? I mean, is there a way to extend the Keyboard app or something and use it only in my application?
Features needed for the keyboard:
Shift key to display some other keys
Special keys like square root or PI
etc.
PS: an ugly solution could be to make a table of ImageButton for example, but I wanted to make something clean.
I'm not really sure if there's a straight-forward solution to this (to that extent that it is even possible to understand the real reason behind the original question).
As is quoted in the original question:
If you need some app-specific input, you should build it into your UI
rather than pushing it out to a generic IME.
What is meant by that, is not that you within your app should try to build in such input features by extending or modifying the soft keyboard on the phone. There are so many different soft keyboards (and basically, the soft keyboard is just another app), since most phone manufacturers create their own version, and people download 3rd party keyboards (such as Swype or SwiftKey etc.), and I can't picture there being a way for you to "hack" into those to add a few buttons or whatever it is you want (which could also be a major security hole, another reason why it probably isn't possible).
What instead the above quote suggests, is that you have to create some other form of input besides the keyboard. One such example, and a very good one if I might add, is how the RealCalc Scientific Calculator looks:
Now this isn't open source, so I can only guess how the code looks like (but it shouldn't be too hard a guess either): in its simplest form, this is just a grid with lots of buttons. Each button handles the onClick event, which would mean performing some kind of action (changing the label on some other buttons, showing a menu, displaying some text in the upper label or whatever), and that's probably pretty much what's to it. And of course, the phone's soft keyboard is never displayed (since you don't need a keyboard with all those buttons (and also there aren't any input fields to write anything in)).
It all boils down to the already mentioned quote: If you need some app-specific input, you should build it into your UI. Or in other words: create buttons (and don't display the soft keyboard if you don't need it) and make things happen when you click them.
And just to have mentioned it: if you do want to create your own IME (which I strongly believe is not the case here), you should have a look at the following resources:
Onscreen Input Methods
Creating an Input Method
Soft Keyboard sample
In my humble opinion you should take a look at the beginning of reference about keyboard and keyboard view http://developer.android.com/reference/android/inputmethodservice/Keyboard.html and http://developer.android.com/reference/android/inputmethodservice/KeyboardView.html.
There you can see an example of defining keyboard using XML file. I think that this is what you are looking for.
As mentioned by #sebap123
Keyboard and KeyboardView class are the one you need to use,
Further, for Implementation, here is a quick detailed guide.