I hope this will make sense, too.
What would be the best way to incorporate a file writer in my code for a simple shopping list?
Basically, I am trying to do a shopping cart. You can log in successfully, you can browse through the products (list) and what I'd like to be able to do is click on the item and have it add to a 'cart'. Once products are added to a cart, I'd like to be able to view the cart and hopefully email the list. (this is where the file writer comes in)
Trouble is, I don't actually understand 100% how to do it, and I'd like to do it right. I've been on this for a few months now because I'm beginning and didn't want to ask for help.... but now I am about to give up. But I'd like to learn!
If anyone had any tutorials that I could follow or just reference, that'd be great. I am a beginner but I'd really like to get over this hump.
The goal is to make it simple, (apparently) that's why the use of file writer vs database.
What is the connection between a FileWriter and emailing the shopping list? The usual way of emailing something with user interaction would be to use an Intent.
Or is this just an exercise where you're supposed to use a FileWriter no matter whether it makes sense?
Correct! it's a project. The teacher said to use a file writer to make it simple. But hasn't given us any information on how to use it or even have the "shopping list" saved as a text file and then emailed. I have set the email part up... well if you click on it, it opens the email app etc.
I asked about using the DB, but unfortunately that's not the project.
I've asked how to do it, and "you'll have to google it, or ask SO for help"... SO is a no go zone, they're mean lol.
googling isn't teaching me what I have to do! :/ I've checked the text books and resources given a thousand times, it's not in there and I'm stuck!
Swastik Dey wrote:As per my understanding an ideal design can be, you should have 2 list views. One displays the items to be added to cart and the other displays the added items. From the 2nd list user can remove items. Apart from these 2 list views you should have a button that creats the file and sends mail.
ahhh yep yep!
I a) don't know how to get the filewriter code to talk to the listview (and what's been clicked)... and b) where do I even put it in my code?
We get told what to do, with no explanations on how to do it - as if it's come naturally. I used the code from the eclipse project and tried to djust a few things and it's made no file (which i honestly didn't expect it to, little things I'm missing)
So I've deleted it all (not the whole code) and now just staring blankly at the screen lol
I understand what I have to do, I just can't do it.
If I do that, could I possibly be able to put the items in the array (the ones that have been clicked on in the listview) into the text file?