I need your help in designing my database.
I have 2 spinners; each one has 10 values.
Each value from the first spinner is related with the 10 values from the other.
In other words, its like a map paths so when you are on the 1st place, your options are 9 from the other spinner, and each option has a specific picture for it, if you see what I mean.
And option 2 (from first spinner) has 9 options (from second spinner) etc..
So there will be almost a 100 pictures.
I was thinking of 10 tables..... each option from the first spinner has the 9 from the other
Now I need your help on how I am gonna design my database.
Any ideas related to the subject would be great.
You want one table, not ten.
Table: SpinnerMapping
Spinner1 INTEGER NOT NULL CHECK(Spinner1 BETWEEN 1 AND 10)
Spinner2 INTEGER NOT NULL CHECK(Spinner2 BETWEEN 1 AND 10)
Picture ...image type... NOT NULL
PRIMARY KEY(Spinner1, Spinner2)
Related
Iam a student and Iam developing an app for my college for downloading previous year question papers,my college has 14 departments and for each department 8 semesters and in each semester minimum 10 subjects are there so 14*2*8= 1120 java files and XML files I have to create if I keep on intenting from one activity to another it will take a huge time.how handle this huge activities.my app structure would be
Select department(14) >> Select sem(8)>> select subject(10)
Is there any methods like nestedif or something else to reduce the activity files.if there are any methods please do help me to complete the project.thanks in advance
No, you don't need that many activities. You need to write abstract activities that take parameters and displays different data based on those. At most I see 4 activities here- department selector, semester selector, subject selector, and the actual subject activity. And arguably some of those should be fragments instead, although that's more personal choice.
I want to build program looks like this.
I'm getting confused how i can build it like this. The only possibilities in my mind is only using ListView. But really i already searching in many sites how to make it looks like this, but i didn't found it.
So that i already give the mark in the picture. That data is coming from database. So for the example in the first record contain Ship-001 , CDD, Indah Transport, 5 Nov 2015. And the second record is Ship-002, CDE, Buana Karya, 6 Nov 2015, and so on.
Could u help me to provide me about this ?
so a listview use data in the form of array. every item in the array, will contain one record, for example, item 1 contains ("Ship-001" , "CDD", "Indah Transport", "5 Nov 2015").
then use the list view to show all the items.
this is a great tutorial for listview
list view tutorial
I am building an Android app for a bus schedule between my village and Barcelona.
I have built a sqlite database as follows (probably it's a really bad design, but I'm a newbie in databases):
run | stopCode | time
1.........1.......620
1.........2.......650
.
.
.
5........11.......NULL
5........12.......1020
And so on.
I use the following SQL statement in order to pick the rows that match my criteria:
SELECT run,stopCode,time
FROM tablename
WHERE time> x AND time <>'' AND (stopCode=1 or stopCode=8);
Using this sentence gives me an output similar to this:
6(run)|8(stopCode)|1045(time)
9|1|1900
9|8|2000
My problem is that I want to select only the rows that have the run value repeated twice. If it only appears once, it means that the bus has a NULL destination in that particular run.
I tried using COUNT(*) c, blabla c=2, but that gives me only the second row with the repeated run number, and I want to select both of them (which would correspond to where you pick the bus and where you want to go down). Any clues how to do it?
Edit:
this is the statement i tried
SELECT run,stopNumber,time,COUNT(run) c
FROM Directes_dirBarna
WHERE time> 600 and time<>'' and (stopNumber=1 or stopNumber=8)
GROUP BY run having c=2;
Edit2:
Thanks to Marcos Vasconcelos i fixed it. This is my final statement if anyone has the same problem:
SELECT run,parada, hora FROM Directes_dirBarna taula WHERE hora> 600
and TIME<>'' IN (parada=1, parada=8);
Here you go:
select t1.run, t1.code, t2.code from tablename t1, tablename t2
where t1.run = t2.run and t1.code = 1 and t2.code = 8;
You select 2 rows (t1 and t2) such as they are on the same run, one is the departure, and one is the arrival. It will give you a single line for each run that satisfies the condition.
See http://sqlfiddle.com/#!5/7d3f3/3
I don't have enough reputations to add it as a comment. If I understand correctly what the question is, to select runs that are 5 or 8 and that should be more than once in the table with some constraints on time.
For that the solution is
SELECT a.run, a.stopNumber,time
FROM Directes_dirBarna a, Directes_dirBarna b
WHERE a.run = b.run AND (a.run= 5 or a.run = 8) AND time> 600 and time<>'';
remove (a.run= 5 or a.run = 8) if you want any run that repeated twice.
You can use the IN operator and repeat the query (but it would be bad if any other option is available)
I want to add a Highscore Screen to my Quiz App. I've already created a Highscore Screen with a start value, which contains the score the user has reached in the last round, the category-name and the difficulty.
I split this start value into 2 variables:
The first contains only the score and the other one the category and the difficulty. Now all in all I have 3 categories and 2 difficultys for each of them. Now I want to keep the top 10 Highscores of each category and difficulty. Like this:
Category 1 Difficulty 1
Category 1 Difficulty 2
Category 2 Difficulty 1
Category 2 Difficulty 2
Category 3 Difficulty 1
Category 3 Difficulty 2
As you can see, I will have 6 different Highscore lists.
Now my question:
How can I save all of the 6 lists in my TinyDB and reload the data again?
for each of the lists use its own tag for TinyDB
to save one of the lists, use the TinyDB.StoreValue block, to get it again in Screen.Initialize use the TinyDB.GetValue block, see also the docu and remember: on first run TinyDB is empty, see an example here how to handle that.
and: do the tutorials to get familiar with the basic concepts of App Inventor.
I'm programming an Android app that shows data from MySQL database via ListView with some sorting:
1) Items that are closer to android phone by GPS are shown firstly
If there are 2 or more items with equal distance, second sorting parameter applies - time.
2) Items that are closer in time are showm firstly.
Here is a scheme of the process that I guess to implement:
My idea is to get all needed rows into Array, then make some PHP manipulations with it and then pull sorted Array to the phone.
(as shown on the image above)
So please advice me what will be the proper way?
Maybe there is easier method for this functionality?
Or maybe I should do all the sortings exactly in the Android app when programming ListView, getting only standard "SELECT *" array from the database? Then, is there an opportunity to create a ListView with sorting based on calculated values?