Search code examples
androiddatabasestore

Classified ads Android app


I am making an app similar to olx.com android app where people can put ads of used items and other people can search and get information about it as an assignment of my class.

Now how should I approach for to implement features like showing suggested ads with respect to user's recently viewed ads.Like if a user just viewed an ad of a car worth $5000 then show him 5 more ads of car within price range of $3000 to $7000 .

What I though till now is keeping a track in shared preference of the last ad that user viewed and get same category ad from database with some range. This could be a solution but is there any better way to obtain that feature?

Thanks in advance for help. Regards.


Solution

  • Sounds good to me. Show them 5x more cars of the same category. Size, price, engine size, doors. etc. Storing in shared preferences, the categories of the last car, is perfectly viable.

    But if you want to follow the trend of say the last 3 cars they looked at, then maybe using a database would be more suited, to keep track of their history. This could also then be used as a history of viewed, list. Where you can take them back to something they have already seen. You wouldnt then even need to re-store info on the cars they looked at, just the ID, and use the ID on the cars table, to pull the info.