radiobuttons sqlite

MichaelTJ

Member
Licensed User
Longtime User
can someone point me at some good SIMPLE coding example for using an sqlite table (probably scrollview) with radiobuttons... need sample code
 

klaus

Expert
Licensed User
Longtime User
You should give more details on what exactly you want to do.
How are the RadioButtons related to the SQLite database, what are they supposed to do, etc ?
You could have a look at the CustomListView or the ScrollView Examples summary.

Best regards.
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
some details...

i tried to leave a quite complete details when first asking the question but when i tried to post it the reply kept coming back that there was something wrong with the page but anyway....

i want to figure out how to associate radio buttons with lines of an sqlite table... so like the table might contain a letter code and a description like M, Medication...E, Exercise, W, Weight..... the radio buttons would allow the user to select what type of record they are going to post to main table which would eventually become quite large.... IF it could be placed into an sqlite table rather than hard coded then the list would be expandable... for certain categories such as Medication there would be yet another table holding sub-categories for various meds.... the point is to choose a radio button and thusly have the value chosen posted to positions in the main table....AND SO a panel with the full contents of a table all radiobuttoned.... hope this makes sense.... can this be done? if i could see the very simplest of examples for such a thing i could expand upon it to meet my needs as simple examples of a starting point is how i best learn
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
what it tried to post before...

slowly working my way through b4a.... i can use panels with no problem and now wish to associate the records of an salite table with radiobuttons so that a particular item may be selected.... so i have

For i = 0 To Cursor1.RowCount - 1
Dim row(NumberOfColumns) As String
Cursor1.Position = i
row(0)=Cursor1.GetString("TYPE")
row(1)=Cursor1.GetString("description")

AddRow(row)
Next
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
second part....

the above is used with a scrollview... can someone explain or better yet show me where to insert code for the radio button..... can someone point me at an example of code that does this....

more but probably un-needed explan.... i need to choose a single record type from a list of several before posting a record and accompanying data to an sqlite table.... there are a half dozen "types" in the sqlite table "TYPES"..... there are several other tables for subtypes and other that will also need to be controlled via radiobuttons... i just need one good simple example to copy and expand upon
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I'm not sure that I've understand exactly what you want to do.
Do you want to show a table with the content of the database and show the selected items with radiobuttons and or do you want the radiobuttons when you edit a database record or when you edit the data type.

But are you sure that Radiobuttons are the best way.
Wouldn't Spinners (drop down lists) do it, they take less space ?

I think that you won't find any existing example doing what you are looking for.

Best regards.
 
Upvote 0

MichaelTJ

Member
Licensed User
Longtime User
the possible trouble with a spinner....

the problem with a spinner MIGHT be that list of items displayed cannot be expanded upon by the user could you point me at a good (straight forward and simple) example of a spinner and/or spinner feeding the list from a table?
 
Upvote 0

Hero post

Member
Licensed User
Longtime User
how do I format a radiobutton

I use radiobuttons in my new app. The problem is they ar barely visible when unchecked. Is there a way to change the lightgray circle to Black.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
In IDE, click Project, then 'Manifest Editor'. Change your value to 10 like shown below and save it.
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>

or you can skip changing the manifest editor and use this code:
B4X:
Dim MyRB as Radiobutton
Dim cd As ColorDrawable
cd.Initialize(Colors.Black,10)
MyRB.Background=cd
 
Upvote 0

Hero post

Member
Licensed User
Longtime User
Hi Mahares,Thanks for your quick reply.
Unfortunately is is not a solution to my problem.
You solution formats the background of the radion button. Nice but not what I need.
The radiobutton consists of the green dot (when selected) and I know I cannot change the color of that. But it also has a circle around the dot. This has a light gray color and is therefore barely visible on a colored background. I an looking for a way to change the color of the circle.

Kind regards
Hero
 
Upvote 0
Top