Hey there,
So I have the EULA code written up and in the application, I have the strings set the way it says to, i have it calling it in the main pages onCreate, and I have a EULA.txt written up and in the assets section. The problem is that it does not display the text. The box shows up with the title, a section where the text should be displayed, and the accept/decline buttons. I'm not exactly sure why the text wont display in it. Would appreciate any help... thanks.
Related
If I put the <abbr> tag in an HTML webpage like so in the snippet below, there will be a text WHO, which upon hovering will show its full form World Health Organization in a small box beside it.
<abbr title="World Health Organization">WHO</abbr>
How to replicate the same thing in Android? (I am using Java btw) You may not be able to hover on a mobile device, but can this functionality be replicated on click? If so, how?
For example, I have a paragraph in a TextView like so
HTML is not a programming lang...
I want it so that when the user clicks on the specific word "HTML" its full form should show beside it (In some sort of "floating" box)
Maybe make a small box, position it accordingly and then toggle its visibility on click? I don't know where to start.
I've scoured for the answer for this. I have a simple text based game. I make a choice with a radio button, and confirm it with a button click. I've set the game to save for when I change to landscape from portrait view.
But I cannot for the life of me find how to save the game when the back button is pressed.
I'd like to have a simple menu on the title screen with three buttons, one of them being "Continue" which would restore the game's saved settings. And obviously, one in the action menu I already have set up which would reset all the game data.
I've tried sharedPreferences etc. if someone can tell me the way to save the game data by using SQL so no user can mess with the data, that'd be better.
Thank you in advance for you help.
on edit I realized my question is not specific enough. I am trying to retain the state of a TextView which I am modifying with user choices, thus changing the text. Every time the app is restarted, the first text loads.
It kind of depends on how much information you want to save, but if it's very little I'd look in to shared preferences which saves key value pares. If it contains a bit more, you should look in to SQLLite which is just a database for your app on the device.
Further reading:
SharedPreferences:
https://developer.android.com/training/basics/data-storage/shared-preferences.html
SQLLite:
https://developer.android.com/training/basics/data-storage/databases.html
Have you tried serialization? Put the informations in a file, like a text file, then simply un-serialize it and take back the informations. You can always encrypt it if you don't want anyone to change the datas, like a real game save file.
I looked on google but didn't find what exactly i am looking for.
I want a edit text to have text or image which i can change by tapping it and selecting new text or image. Also i want hint followed by that text or image.
I tried multiple experiment and was able to add text(by changing selection location and adding text) and image(using drawable addition from android code)
For text :
edt.setText("Fixed Text");
Selection.setSelection(edt.getText(), edt.getText().length());
Image through XML:
android:drawableLeft="#drawable/ic_launcher"
But when i add text, i won't be able to add hint. In case of image hints get added. Also i want my permanent text and image to be tappable and updatable.
Any help would be really helpful. I want $ to be fixed and tappable, and want to change it to different currency. but want 52.63 to be hint and can be editable by user tap.
EDIT to give more clarity:
Example: i want to add part of the text as permanent and part as hint for example $ 52, so $ is permanent and not editable through user, he can select it through list view by tapping on $, but 52 he can change using android keyboard.
I am not quite sure about the whole part about the image being placed into the EditText as a hint, but if you wanted to create the $52.63 as a hint in the EditText, all you would have to do is:
edt.setHint("$52.63");
in your onCreate() method. I am not sure if this is what you are looking for, but this is a simple way to add a hint to a textEdit. If you wanted the hint to change when the user tapped the screen or something like that, I would look into adding a tap listener of the android component that you desire to be tapped to change the hint, and then modify the hint using the method above.
I'm making a program in java that recive some strings and then display them in a new frame scolling them in one line, like the news, (shown below)
There, the text are displayed in a line, like what I need, but my problem is that I don't know what I should use in java, I though about put a panel on a frame and then a textfield inside the panel, then I realize that it's impossible because for every message I may need to change the color of background for an highlight message...
So, if anyone can help me, can you tell me what should i use for the diferent message and how i can get the text scrolling?
Thank you all in advance!
I am a huge newbie and I have a program that normally prints items to the Java console window. I would like this program to become a window in which the user can interact with. The reason why I have not resorted to dialog boxes and panels is because this program require multiple prints to the console window. A traditional dialog box does not continuously update or compound on data that has already been printed on the box. I realize that there is another way of doing this by creating a program that mimics the Java console window. Because I am a noob, all of the java console redirecting questions and answers on this site have blown over my head. Can anyone please help me?
See maybe How to Use Editor Panes and Text Panes will be helpful and give you some ideas.
The short answer is, every time you want to update the contents of a text box, call the setText function again. There's no "append" function on the contents: you have to give the entire contents each time. If you want something that mimics a console window, where messages continue to scroll, the simplest thing to do is to keep the entire contents in a StringBuilder. Each time you get new text append to the StringBuilder, then setText(myStringBuilder.toString).
You could, I supppose, write mybox.setText(mybox.getText()+"new contents"). That would be a little inefficient but probably not a big deal.
I don't know exactly what you're up to, but trying to redirect console output to a text box sounds like more nuisance that it's worth. Just put your data in the text box: don't write it somewhere else, then try to get it back and put it where you want it. I suppose if you have thousands of lines of code writing to the console and now you want it to go a text box, there might be value in not having to change all that code. But the structure of a console app is so different from the structure of a GUI app that changing the output statements would probably be the least of the things you'd have to rework.