I've got problem with my school project.
Basically user create a table on website with records and then by android app can upload own datas to table.
Table might have many rows with different type like integer, date, text. So in my app I need to create layouts dynamicly depends on defined table. I thought that I can convert rows to xml file and then create layouts in android, but it seems to be a difficult one. Can You suggest my how can I create that layouts from downloaded xml ? Or maybe is the other simple way. Help
Related
hello friends i am creating a table in which i have to implement a multiple column selector. If i select multiple text from drop down than it will show as multiple columns.
If anybody has any idea than please solve the issue.
What is the best way to create a thumbnail list of files for a file explorer app in android like this. I understand how to create a list but dont know how to do that. Also, if I want to add a system so that user can flip between two view styles (one with list and one with those thumbnails), how should I do it?
You should use a GridView. If you know how to work with a ListView you can easily work with a GridView too. They are almost same, but GridView has multiple column support.
I have ListView with about 30 items. When I click on an item, some text displays.
Currently I am storing text in strings.xml, but I wonder if it's better practice to insert this text into database.
What are advantages and disadvantages of both ways? Which is faster?
If the text is static, or not changing over time, I would definitely put it in strings.xml in your res folder. All XML files in your res folder are optimized and compressed when you create an .apk of your app. A database also introduces more complexity, and you will have to connect to the database before retrieving your text. If your text changes over time, you will need to put it in a database (or plain file, if you prefer that).
If your strings which are getting displayed in list are not dynamic (not change while code excutes), I prefer having them in strings.xml rather than database, this way we can avoid unnecessary logic related to database retrieval. 30 is not a big count.
I'm making a new application and its basically filled with information about Warcraft.
I have similar apps on my phone that have similar information and when I looked inside their .apk they only had like 10 layouts.
The app that I am making already has 5 layouts and it seems like I will need about 50-60 layouts.
So now my question is it normal to have that many layouts? Or do I have to learn to make one general layout and keep reusing it? For example, like if I need to display information about a topic for instance the classes in warcraft which are 10 different classes with 2-3 different guide pages on average for each class, would I need to make a different layout for each page or is their a better way of doing it?
I would really appreciate any input/suggestions.
What I recommend is having one layout for every type of screen (basically one per Activity) and use Java to fill in all of the info. Use getResources().getString(int id) and pass something from R.string. That means you need to keep all of your information in a strings.xml file in your values folder (located in /res/values). List all of your views in the layout XML file and then find them by ID and set their values.
It's best to keep all of your string resources in a separate XML file and not hard code them into the layout (otherwise it's a pain to replace every instance of a word you realized you misspelled or something). If you don't know how to write XML, that's okay since there are tools in Eclipse, but I HIGHLY recommend learning it.
You can re-use layouts without any problems. In fact for maintaining the code it is a very good idea to do so. No one wants to maintain 50+ layouts and associated code.
hi i am new to android.What i did is i am creating a xml file with some data.Now i need to add some additional data to existing xml file dynamically.How can i done this.Pls help me.Thank u in advance.
Everything that you do with XML in your layout file can be done via coding inside the .java files.
For example, if you want to change the text of the label, you grad the ressource in your code and modify it or if you have a table and want to add data depening on some previous operations, you create the rows programmatically and add it to the "xml" table.
Read through the UI Guides to get many examples and explanations. The Dev Guide is a great ressource and well written.