xamarin android best practises to tables with multiple columns - android

Maybe its a easy question but i cant figure out how to do tables with multiple columns and rows.. Order data in this table will be get via wcf service and next present in table. In this table i need of course scrolling and filtering. Every row will link in to details about order.
I thinking about using table layout and put in lists but this not resolved my problem with scrolling.. So should i do this? Which is best practise in this case topics?
I attach picture with this table.
Thanks for help.

I think i found solution of this problem on xamarin forum.
If samebody have better idea it will be pleasure to hear it.. :)
XamarinForum

Related

SQLITE DATABASE for multiple access

I would like to ask if any of you out there uses android studio and sqlite for apps that require multiple users to access the database? I have been looking for source codes and examples online, but haven't seen any. I understand that other database might be better but I only have enough time to use sqlite as I am alr using it now. Could anyone help me with example source codes?
viewComment.setText(name+comment);
replace with below code
viewComment.append("\n"+name+comment);
Update -
limit number comments - use counter , after certain number of hits stop appending to text view.
U can make scrollable too.
for above both please check your requirements or UI/UX teams.
You will have to work with RecyclerView here. Add a different layout resource file in your layout folder and bind it to the RecyclerView and all your comments must be stored somewhere, like in a database. You will then achieve your desired structure.

How to make a detailed table with lots of entries?

I need to create tables that will hold lots of entries (its a bus schedule).
I will need to be able to set the color of certain individual cells. And I would obviously want it to play nice with all kind of phone screen sizes.
So the questions are:
How do I go about creating this table?
What is the best approach for my need?
This is one the tables with the data that I need to make:
I suggest to use a ListView for this. Here is a nice tutorial: http://www.vogella.com/articles/AndroidListView/article.html
I ended up creating and styling the tables in Excel and exporting them as HTMLs. Then I just loaded them in a webview.

identify correct answer in trivia app

I'm just about to get into my nitty gritty of my game-changing -_- trivia app but I was wondering before i start my database (SQLite), how would my app know when an answer selected is correct? I was thinking that I could simply put a column in the database for the answer and then have 4 seperate columns for the answers choices, of which one would be repeated -then simply compare the answer selected to the answer of the current row. But this doesn't seem like the most elegant solution. I was simply wondering if there were other methods that I didn't know about.
I don't know if it's worth mentioning but the answers choices would be shuffled before finally being placed into textviews.
I would suggest giving each answer a numeric value (PK from database) and storing the number of the correct answer against the question row in the "questions" table.
As for checking the correct answer, do you really want to be going back to your database for each question? If you app takes off and is used by a lot of people your db is going to be put under a lot of strain. Perhaps have the app download the "round" (set of questions) definition and do the answer checking locally for each round, uploading the results afterwards.

Database query for comparision

Hi please anybody please help me with some link that will give details about comparing 2 columns in sqlite table.Actually my requirement is i have to compare 2 columns in 2 different table and i have to retrieve that particular row.Please help me.
If you're looking for resources on performing an INNER JOIN, look here: How do I join two SQLite tables in my Android application?
Please provide more information if this is not correct. Your question is hard to interpret.

Which is better, using a SQLite database or hardcoding data into a function?

I'm working on a trivia like app and wondering how is the best way to store all of the questions and answers. Right now, I just have a random number and using a whole lot of if statements. For example, if randomNum = 25, then question is THIS and choices are THIS. This seems to work fine, but my file is starting to get very large and this seems like it should cause performance issues. Space is also starting to become an issue. I have started to look into just putting all of the data into database and use a random number to just retrieve a row. Anybody have any suggestions on which would be the best practice or have any other ways of doing this?
Sounds like its a good time to start using the database. You can learn how to include a pre-populated database here.
...using a whole lot of if statements.
I have started to look into just putting all of the data into database and use a random number to just retrieve a row
I think you've kinda answered the question yourself.
What happens with your model if you have 10,000 questions? Are you going to use 10,000 'if' statements?
Even if you're never going to get to that many questions, using a SELECT on a DB where the question number equals a particular random number, is going to be far more extensible.
You should use the database.
It's not just a maintainability and (ultimately) a code simplicity option, either, but offers significant advantages.
Imagine if you want to be able to supply different packs of questions, for example. You could offer people the ability to download a trivia pack from a website, or load it from a file off their SDcard. This simply would not work for masses of if statements.
Suppose you want to let people add their own trivia questions? Upload them to the website for voting and ultimate inclusion into crowd-sourced question packs.
So yeah: you should use a database.

Categories

Resources