I am working on android project. By considering a list view I am displaying the student name from remote MSSQL Database. I have considered the student name text-view as hyperlink. When I click on the student name it has to display the details of that particular student from database.Based on the student id I want to display.
Now my question is how to pass the id value from database to query string in android?
Please provide us some solution regarding this? I will be thankful to you.
Related
I develop an android application for students attendance according to their seat numbers. If the student entered his seat number, it will be stored into real time database in fire-base.
Now, what I need to do is to retrieve the empty seat numbers to a list view according to students' information. for example: database has 50 seat numbers entered, but seat number (25) is not in the database then it will be retrieved to the list view.
In general how can I do that with fire-base real time database?
This is how database looks like for one student
You will need to mark seat empty in your db to later only fetch the empty seats. In current situation there is no way to put a query which can retrieve data only for absent students.
Your screenshot is limited so I suggest this structure.
{lectureId}/
seatNumber: {
isEmpty: boolean,
.... your other data
}
Then you will use orderByChild("isEmpty").equalTo(false);
And for querying a set of data from realtime database, have a look at the docs:
https://firebase.google.com/docs/database/web/lists-of-data
you can use a boolean if student is present (present = true).
put this variabble in te object
then you can run a loop on datasnashot for
i < noOfSeats
and show in te ListView with a condition
if (!present){
showInList();
}
i have created a simple sqlite database ,it consists of name and two phone numbers corresponding each name.Now i want to display data in text views.Also i have 4 entries of name and phoen number ande i want to display all of them.
Have you search in google before..
O.K
Just visit below link:
Display data from database into textview
Regards
I am reading database values from MySQL on web in the form of ClickAble List.Show only one column value like "name".Now I want to read all values related to specific name like when Click on one name show all values related to that person.now I don't know how to get name from list and send to database and then read data only related to that particular name. Still don't try any code.....
I want to get the column values of a row to a specific android app* after a new row is inserted to a mysql database table in my server.
specific android app* - we identify each app uniquely by phone number.
table structure as follows.
id fromphonenumber clientphonenumber messagebody
1 +3434354546 +484844646245 test123
when this kind of row inserted, I want to get the messagebody column value to the app like the way normal sms appear.
Can you please explain a way to do it and suggest any tutorial to refer.
Thank you in Advance
In my project I am getting the employee id values and employee names from the database. I am displaying the names of employees in listview. When I click on the name(here the name textview is a hyperlink) in the listview all the details of that particular employee will be displayed. Based on the employee id when we click on the name that employee details should display. Please help me how to do this in android.
For ex: In general we give like this ----http://sample.com?id=1
How to do that in android?
So based on your question and follow-up comment, what you're gonna want to do is as follows:
Grab the employee name and id as you have already done.
Make an Object that will hold both the employee name and id. Make a toString() method that will return the employee name as a String. The reason for this is because when the ListView is inflated, it defaults to calling the toString() method of its objects (each list entry). Make sure to also have a way to get the employee id from the Object via either a public getter or making the id a public variable itself.
Make the ListView's ArrayList use this Object and set it accordingly.
Then you must use onItemClick to query the site you were referencing in your question. However, when you do query this site, make sure to concatenate the employee id to the end of the URL. Do what you will once you query the site.