showing Alphabets in spinner - java

Howdy,
I am writing a GRE app on android.i am new in this arena.
I want to show all the alphabets in the spinner control. what is best way to do it and how can I do it. Can some share the code.
Like in .NET , i would have filled an array with all the chars A-Z. then have called toChar and bind it with combo control.
I dont how to did the same think java and android ?

Do a search first, Anyway here is the tutorial
http://developer.android.com/resources/tutorials/views/hello-spinner.html

Related

Unicode character ("\u232B") does not display on button

I'm building the keyboard of a calculator application for Android.
I'm using the unicode but the application did not display the button "erase to left"
static String[][] screen2L ={{"sin","asin","sinh","asinh","sind","asind","\u232B","AC"},
{"cos","acos","cosh","acosh","cosd","acosd","log2","gamma"},
{"tan","atan","tanh","atanh","tand","atand","log10","ln"}};
thanks
Unicode characters are not supported in all fonts. Check here to see the supported fonts for \u232B
Instead of using the character, make an image of the character and set it as the buttons background. A post that can help with that has already been answered here: How to make button with custom background image...
Also, as for using strings in java to print in your GUI, it's better practice to use xml for this. The buttons individual values would be stored to the app instead of having to assign them every time the app is run. I would write out instructions on how this is done, but the android developers guide that can be found here gives much better instructions than I could.

Is there a way to create the stackoverfow "Tags" EditText/Input field in Android?

I want to know If there is a way to create a EditText like the stackoverflow EditText in Android:
Questions:
How is this called? so I can search it on google
Is there any library out there already?
If there isn't, where should I start with making one myself?
I found it by searching "android tag editor textview" and I came along this: http://www.kpbird.com/2013/02/android-chips-edittext-token-edittext.html
So Stackoverflow tags field is Chips EditText in Android.
You have to make a Database that will listen to the keys events and using pattern matching, fetch out the data from database.
When you select the data, the data will be stored in a button or whatever.

Converting BB code to HTML for TextView

I'm trying to convert BB code to HTML in Java for an Android project. An example of the text in which the bb code is embedded looks like this:
[b]This[/b] is some [url="http://www.example.com"]example[/url] text
to display my problem.
There also might be several paragraphs [i]of[/i] text and normal URLs http://www.example.com.
What it needs to look like in the TextView:
This is some example text to display my problem.
There also might be several paragraphs of text and normal URLs http://www.example.com.
Unfortunatly I don't have any code to show you since i don't know how to go about doing this. The only thing i can come up with now is making alot of regular expressions but i´m not sure if that would be the best solution.
Eventually this will all be displayed in an Android TextView.
Any help is appreciated!
There are some java BB-code libraries out there. Check this question for information on them.

Question about creating GUIS "dynamically" on Android

I'm trying to make an android app (I'm new in the Android programming world), and I'm having problems creating the GUI.
The point is that I get information of some data that is divided in days... The problem is that I don't know, until I retrieve the information, how many days the GUI should display.
http://img574.imageshack.us/img574/3787/mainscreen.jpg
The grey part will be a TextView, and, also, the black part will be another TextView with multiple lines.
So, the point is, how can I do to have multiple TextView's without knowing before the exact number? I suppose that I can't declare them in the layout.xml
The only solution that I've been thinking about is to create in the layout 7 pairs of TextView and, when I know the exact number, just use what I have to, and don't use the others... (It's a bad solution)
What do you suggest?
Thank you for your answers!
You should create a ListView, which inflates TextView for the items you have.
You can use this example of how to create sectioned ListView, which will look exactly like you want.
I'm not familiar with Android, so other people may offer better, more specific advice.
In the environments I'm familiar with, the problem of displaying an unknown number of items is solved by using not a series of display elements for each data item but a list control. The list component will display as many items as you give it, and can usually be modified to have different appearance for different data, so you're flexible in making it as pretty as you want.
Well you can consider this one also,
Create a table layout in XML, give it a id: TableLayout table=(TableLayout)findViewById(r.id. ....)
Create dynamic TextViews using: TextView day=new TextView(this); day.setText(day name);
Now add this text view to your table layout : table.addView(day);
Run the code for textView creation and addition to table in loop
Hope this helps...............

Displaying a non-static string on an Android app?

I'm making a calculator-type application and it will have a resulting string that is generated by user-given inputs. This is my first android app, so I am not too familiar with the SDK. In main.xml I can make the static, non-changing strings, but how can I similarly display a string that can change and has no set value?
You just do it in your Java code. As you don't provide any snippet of your code, let's suppose you want to give text to the EditText that holds the calculations. In that case you will have to do this:
editText.setText(stringOfCalculation);
In this case, stringOfCalculation is an String that you have carefully formated by using the calculator buttons.

Categories