Android Question how to make a shopping cart,

hears

Active Member
Licensed User
Longtime User
shopping cart list display price ,products numbers,total price.
every column,get pice,numbers from SQLITE database,

need + ,- button to change the numbers of products.


i have try CustomListView.

i have try, maybe it is cannot change data in exactly column



how to start work ?
I realize this is a complicated situation, but do you have any advice?
 

hears

Active Member
Licensed User
Longtime User
i can display my database in CustomListView
but cannot every column add EDIT BUTTON for change (+ -) number ,i want list same to this picture:


ceshi.gif
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
:)Thank you very much
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
how to get product price ,and name from SQlite ? after instert to this CustomListView ?
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Start with these tutorials by @klaus ... 4 Simple SQLight projects..

Also see chapter 5 in the Users Guide .. https://www.b4x.com/b4a.html#documentation


Again basically ..

B4X:
'get all needed records from database ..
'loop thru the records , populate a map or array and pass  to CreateListItem sub.

For i = 0 to Cursor.Rowcount -1
   myMap.Put("product", Cursor.GetString("product_name"))
   '..................... more code

   clv1.Add(CreateListItem(myMap, clv1.AsView.Width, 70dip), 70dip, $"Item #${i}"$)
Next

Sub CreateListItem(m as Map, Width As Int, Height As Int) As Panel
  
   Dim p As Panel
   '.......................... more code

    lblProduct.Text = m.Get("product")
    lblPrice.Text = NumberFormat2(m.Get("price", 0, 0, 2, False)


Please start a New Thread for any further questions.


Cheers
 
Upvote 0

hears

Active Member
Licensed User
Longtime User
thinks for answers,i have finish my app with your help :)
 
Upvote 0
Top