I am having a java program which performs MATRIX ADDITION.I want to implement this to ANDROID.I have done layout also for this purpose.But how to implement this to android in such a way to get input from user and to print the output to mobile screen.I know that i cant use "System.out.print()" function here
It seems that you have very basic holes in knowledge in regards to android development, so as others have advised, you should check out http://developer.android.com/training/index.html. I will attempt to give you some start though, if you know general java programming, you can create an EditText view and then populate it as you would usually, but instead of using System.out.println(""); (if your EditText view is named editText1), use editText1.setText("");
Related
I would like to create an android keyboard as much as possible only using Java.
I am familiar with the traditional android keyboard app setup - xml files for each keyboard 'page' and hardcoded key sizes etc.
I want a lot of customization in my keyboard with the ability to use JSON as a data source for whole keyboard layouts generated with Java.
Has it been done before or am I dreaming?
Of course it is. Any UI can be made without an xml file- you can always create views with new and manually add them to a parent.
Did you mean doing it without using KeyboardView? Yes, you can do that too. KeyboardView is meant as a convenience for very simple keyboards, no real keyboard app uses it- not even google's keyboard. In the InputMethodService's onCreateInputView, return whatever view you wish to use. Any view can be returned. So you can be as flexible as you want.
I'm making a custom view that can be annotated with typical paint tools like draw, shape dropping, or writing text, and I'm stuck on how to enable text input without resorting to creating new views on touch. I'd like to be able to handle all of the annotation in this one custom view class.
My idea is to extend EditText, since it seems to have all of the functionality I need for creating editable text onscreen. Currently, I override onTouchEvent(MotionEvent event) to annotate whatever drawable has been loaded into my custom EditText called AnnotationView. I can call super.onTouchEvent(event) when the text tool is selected, and the soft keyboard displays. Entered text is displayed on screen, and I can edit it. However, at the moment I can only enter text in one place, seeing as how this currently is just an EditText with added drawing capabilities. Any other overridden methods (onSizeChanged, onDraw, performClick) start with a call to their super implementation.
Has anyone here attempted something like this before? I need to allow the user to start editing text at their touch coordinates, but I have no idea what methods I'd need to override or create to do that. It seems like this would be a good way to avoid requiring more views be created from the Activity using AnnotationView, but I'm not sure how feasible this approach really is.
Issue can be seen here:
Image of AnnotationView being used in a sample app
To explain why I'm trying to avoid creating new views to write text in - I'd like to release this as a library, so I'm trying to require the least amount of hassle for someone using this view. Ideally, a developer could just place this view and then choose whatever tools I've implemented via their own UI. If I need to create views on top of this, I'll need to require users to roll their own text editing implementation via some kind of listener... maybe? If I'm missing a simpler way of doing this, please let me know! I've seen similar questions asked here, but it seems like a definitive good practice for capturing user input and displaying it on canvas would be useful for a lot of beginners such as myself.
I'm currently building a small game for Android using LibGdx in Android Studio. In the game the player uses the on-screen keyboard to enter different letters one by one.
My problem is that the autocomplete is one (since I use it when I'm texting) and this forces the player to click the "suggestion box" after every typed letter to actually make sure that the keyboard press and character input is registered. Since the input in my game should be one letter at a time I don't want autocomplete to try to "guess"/create a word.
I'm using the InputProcessor class with the "keyTyped(char character)" function. If I turn of the auto complete in phone settings (manually before starting the game) the input is registered and the correct character is passed in.
So, my question is if there is any way to turn off/toggle autocomplete programmatically?
Thanks in advance!
I realise this is old but if you or anyone else is looking for a way to do this then I have a solution. I built a completely new method for Android soft keyboard input to tackle the issues involved with the current libgdx methods. I am surprised to read auto-complete was actually working for you, because on all my testing devices it does not, and this is one of the problems I have attempted to solve.
I have built a sample project for people to work with that allows for much more reliable input using the Android soft keyboard, this includes swype, auto-correct, dictionary, etc. What you may be interested in is I have also included some customisation for the keyboard, such as the ability to disable auto-complete and suggestions. You would simply customise your TextFieldStyle with;
textFieldStyle.androidKeyboardAutoCorrect = false;
textFieldStyle.androidKeyboardTextSuggestions = false;
As of posting, no one has used this sample project and I have only tested on a few devices, so it may be a little erroneous. I will carry on maintaining it when/if feedback is received.
You can find it on Github here (source and executable apk)
If you have any comments/feedback please refer to Github or the badlogic forum topic
Hope this helps!
On create, im trying to play two videos at one time. I am currently using two videoviews. Firstly, should i create buttons to start the video views or should I use MediaController? Also, I have haerd that two VideoViews will not work. Is this true and if so, is there a way around it.
Thanks,
XcutionX
There is no reason you cannot play two VideoViews at one time. If you want to show more, I recommend looking at TextureViews (If you are targeting Ice Cream Sandwich or above, I'd recommend using TextureViews regardless).
It makes no real difference if you want to handle the play state with buttons or with the MediaController. Do whatever you think looks right.
pretty simple question here but I cant seem to find anything. Anyway, There is a game on android and with a keyboard you can enter a cheat id like to use(personal use not uploading to market) . Well I created a static button that remains on-top of all activities. Id like to just click my button and have it paste the word to the game so the cheat will be entered. Anyway to paste onclick? I cant see this being hard
You can't make other apps behave in a different way than they do as it violates the whole sandboxing idea of android (unless of course the app itself allows it in some way or another) .
What you can do is to copy the content to the clipboard , and allow the user to paste it anywhere he can .
More info about it here:
http://developer.android.com/guide/topics/text/copy-paste.html
There might be root solution , but like many root operations , i really lacks this knowledge of how to do it.