Android :: Creating GUIS Dynamically On Android
Nov 13, 2010
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.
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)
View 3 Replies
Mar 15, 2010
Is it possible to write an Softkeyboard without XML or is this the time I'll need it?The idea is: I have an Arraylist with buttons which have a specific position in the layout, height, width, text etc. Those buttons should create my keyboard by converting them into keys.If this won't work, my second idea is, to write a XML-File out of Java.I wonder if one of these ideas are possible.
View 2 Replies
View Related
Dec 13, 2009
In my main.xml layout file, I define a FrameLayout. Then in another layout file (say overlay.xml), I define another layout.
At runtime (onCreate) I want to create a new View object, set it's layout with overlay.xml, and add it to the frame dynamically. I need access to the elements of the overlay, to change text etc.
View 4 Replies
View Related
Jan 13, 2010
I'm creating buttons dynamically.
for(int i=0; i<colSize;i++){
final Button btn = new Button(this);
btn.setText(SectionName[i]);
btn.setTextSize(10);
btn.setPadding(8, 3,8, 3);
btn.setTextColor(Color.WHITE);
btn.setTypeface(Typeface.SERIF, Typeface.BOLD);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//***Every time that I click my button is selected !:)
btn.setSelected(true);
} } );
}
But how could I deselect the other buttons that were selected, I just want one Button selected!
View 2 Replies
View Related
Aug 26, 2013
I have "Class Checkin's" Which have a max amount of people who can be checked in. So on my application I have the Class Time and under each of these class times, I want to have a horizontal progress bar that adds one to the bar each time someone checks in (On my web application I am using jquery .progressbar).
Currently I have the following:
HTML Code:
private void createProgressBar(ArrayList<Integer> array, Integer maxProgress){
View BoxProgressLayout = findViewById(R.id.BoxProgress);
Iterator<Integer> iterator = array.iterator();
while(iterator.hasNext()) {
ProgressDialog progressBar = new ProgressDialog(BoxProgressLayout.getContext());
progressBar.setCancelable(false);
progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressBar.setProgress(0);
progressBar.setMax(maxProgress);
progressBar.show();
}
}
In order to add the progress bar to my Progress layout. But the progress bar doesn't appear on the page. Is this the best way to go about this? or am I going to have to draw my own progress bar that increments and fills by a percentage each time someone checks in.
View 2 Replies
View Related
Jan 29, 2010
Currently I am working on an Android application that is dynamically creating controls. Everytime a user would click a button a new EditText appears below the button and the user can interact with the EditText. However if the screen orientation changes, the EditText's that the user created also disappears.
Code sample of user creating a EditText: (located in a onClick(), p is basic layoutParamas, and layout is a LinearLayout located undearneath the button).........
View 1 Replies
View Related
Jun 26, 2010
I am new to Android Development. What I want is to know how I have to begin thinking to program a neat, sexy GUI. I guess the android.opengl API is a good starting point. Let's say we wanna create something like a simplified 3D-Pool-Billard-Game: You see the table from the top and you have on the table the balls. You want to make them realistic (shadow, gloss).
What kind of Graphics do I need?
How to begin coding?
What kind of classes do I need? For each element (ball, table, ..)?
Where to create and encapsulate the "3D-ness"?
If you know better/additional questions, just add them or/and let me know in which direction I have to think in this case of developing. My skills/background on Java: I've programmed a lot in Java EE and used to handle graphical output with JSP/JSF. So this mobile SE for Android is new to me. Hope to get some intersting stuff together for a smooth access.
View 2 Replies
View Related
Mar 10, 2010
I want to take a byte and append it to a resource ID to be able to get the image that corresponds to that numbered deck in the game. It was easy to with paths on other devices, but with the Resource ID's I am unsure how I could go about do this.
Here's what I have now:
CODE:..................
In my Blackberry version of this, I simply had:
CODE:.....................
Is there a way to accomplish something similar using Resource IDs on Android?
View 1 Replies
View Related
Jul 20, 2010
I would like to define the following layout (which is currently an xml file) dynamically in my code.
The end goal is to have the ability to conditionally include certain pages in my viewflipper. code...
View 1 Replies
View Related
May 1, 2010
In my app i want to set the logo in the title bar. but depending upon the size of the device how could it be set,so it may be dynamically possible.
View 2 Replies
View Related
Jul 13, 2009
I've learned that to set typeface needs font to be under asset folder how to dynamically load the ttf file to be used in code? or maybe how in runtime to add ttf file into the asset folder? is there any solution for this problem?
View 3 Replies
View Related
Nov 2, 2009
I am trying to make ListView which should display data from db. But the db is filled slowly so want the entries in the ListView to grow dynamically according to the elements in db. For example on a desktop music player when you import a folder to the music library the list with songs is filling in real time with the newly added songs. So how can i get this working on android.
View 5 Replies
View Related
Sep 28, 2010
I want to dynamically load a ListView, for example, load them during the scrolling so its not loading all 100 posts I have. How can I achieve this?
I have looked at similiar solutions here at SO, but since I not got it to work, I asked this question.
My code:.............
I have in the same .java file, functions to download the info from the web and loop through 100 items, like this:
CODE:................
And then it add a new order correctly and so on. But now!(?) I want to have so when the first item is loaded, it should appear and when scrolling it loads gradually.
View 1 Replies
View Related
Apr 21, 2010
I want to implement a "Settings" section in my application, and I want that when the user selects whatever, one of the strings from string.xml will change its value according to the user selection. Is this possible at all? any ideas on how to implement it?
View 4 Replies
View Related
May 28, 2010
I am currently learning about widgets in Android. I want to create a WIFI widget that will display the SSID, the RSSI (Signal) level. But I also want to be able to send it data from a service I am running that calculates the Quality of Sound over wifi. Here is what I have after some reading and a quick tutorial: public class WlanWidget extends AppWidget Provider {RemoteViews remoteViews; AppWidgetManager appWidgetManager; Component Name thisWidget; WifiManager wifiManager; public void onUpdate(Context context, AppWidgetManager appWidget Manager, int[] appWidgetIds) { timer timer = new Timer(); timer.schedule AtFixed Rate(new WlanTimer(context, appWidgetManager), 1, 10000); The above seems to work ok, it updates the SSID on the widget every 10 seconds. However what is the most efficent way to get the information from my service that will be already running to update periodically on my widget? Also is there a better approach to updating the the widget rather than using a timer and timertask?
View 12 Replies
View Related
Jun 18, 2010
I'm trying to learn how to build apps for Android. The first simple app, which will become a component of a bigger app I hope to build, is to have a button on the screen where, when tapped, it adds something new to the view. For instance: Imagine a layout that only has a button:
[Create!]
When that button is pressed, the view gets a new row added to it:
[Create!]
A Something!..............
View 2 Replies
View Related
Nov 8, 2010
I am a new developer in android, and I see some examples about activity, but I don't know How can I create the widget dynamically?
View 2 Replies
View Related
Nov 19, 2010
I use a LinearLayout and first I have a MapView and below the map I have a TableLayout with informations fields.
Now I would like to add additional information fields (e.g. a new TableLayout) when the user select a specific menu item on the Options Menu. I would like to have these fields either between the MapView and the TableLayout, or on top of the bottom area of the MapView.
How can I add this TableLayout with additional information fields dynamically after the user has selected a menu item? How can I show it below the MapView or on top of the bottom area of the MapView?
View 1 Replies
View Related
Feb 19, 2010
Is it possible to find dynamically what are the languages supported by the application? For example, I have strings for the following languages: English, French, Dutch and German. They are defined in their corresponding res directories: values, values-fr, values-nl and values-de. I want to give the user the possibility to choose between them and for this I want to load them. But I don't want to hard-code the choices. I tried to use: getApplication().getResources().getAssets().getLocales() But this method returns all the locales the phone supports.
View 1 Replies
View Related
Dec 4, 2009
My query is regarding on whether we can apply dynamically themes in android,like what we do with our phones in which we can select a theme and the same theme gets applied all across the phone.Is there a way to do this in android? (I am able to change the default theme by hardcoding in the code (styles.xml),but I need to know how we can we set themes dynamically. I saw the Android phone,but there is no Setting where we can set the Theme.)
View 5 Replies
View Related
Sep 7, 2010
In my application I need to set dynamic text to my textview so I want it to get resized dynamically. I have set:
< TextView
android:id="@+id/TextView02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="normal"
android:layout_weight="1"
android:singleLine="false"
android:minLines="4" />
And from java code I am setting text of the textview at runtime.My textview height is not going beyond 1 line and the text is getting cut. Can anybody please help?
View 2 Replies
View Related
Feb 18, 2010
I have three tabs in my Application. On an event under one Tab, i want to change the title of an another existing Tab. This is the title that we provide while adding the tabs to the TabHost.
Eg: TabHost.addTab(tabHost.newTabSpec("Tab2")).setIndicator("I need to be Changed dynamically").setContent....
In the above example, the title of the tab2 that i provided under setIndicator(), should be changed dynamically.
Is there any way to accomplish this.
View 3 Replies
View Related
Oct 15, 2010
I have an Android application which has four tabs (I use a main TabActivity with TabHost and TabSpecs).
In one of my sub activity (activity opened in a tab), i need to open a tab not by clicking on the tab title and i don't know how to do this.
For example, i have a button in my activity and when i click on it, it opens a different tab.
For the moment, it is what i do:
Intent intent = new Intent(myActivity.this, myTabActivity.class);
intent.putExtra("ComeFrom", true);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
Then in the TabActivity, if i get true reading the "ComeFrom" extra i open the wished tab but the problem is that it kills all the other activity. So, if someone knows a better (cleaner) way to do that trick.
View 3 Replies
View Related
Sep 21, 2009
How can i add image to my listview dynamically.
Here is My Code...
View 3 Replies
View Related
Sep 21, 2010
I want to display 4 frames in layout which contains customized views.when ever i clicked on one frame it has to occupy total screen. please let me know how to do .
View 2 Replies
View Related
Mar 24, 2009
I have a tab activity with 3 tabs. Each tab has a default icon.
I want these icons have to be changed dynamically on each tab selected.
I mean, each tab has two icons, one for on tab select, another for on tab deselect.
Can any one please suggest me how to do it?
Here is my sample code...
View 3 Replies
View Related
May 26, 2010
Is it possible to change the name of the application name dynamically? I want to keep a certain name like XYZ free when my application is free and XYZ Pro when the user has paid. So is it possible to change the name of the application dynamically?
View 3 Replies
View Related
Dec 5, 2009
How to add button dynamically in android?
View 2 Replies
View Related
Oct 28, 2010
I want to decompose my UI into several XML Layouts. The first one would be the main layout, and the other ones would be the content layouts.
I would like to be able to set which content_layout should be included dynamically during runtime, so I don't want to set a "layout="@+layout/content_layout" in my XML file.
Here are my layouts:
main_layout.xml:
CODE:................
content_layout.xml:
CODE:.......
content_layout2.xml:
CODE:..........................
View 2 Replies
View Related
Jan 11, 2010
How can you dynamically create a CheckedTextView in android [without creating a new implementation]?
It seems CheckedTextView is abstract ... (which does not make any sense at all) because I keep getting the compile time error: "Cannot instantiate the type CheckedTextView"
Using Android 1.5
View 1 Replies
View Related