Giving name and price to pictures of foods - android

I am working On a Food Management Project In android .I have created a gallery and want that when any user touch any of the picture that i have used in that look with a description That what is the name of that food and price of that food .After That i want to add the Online payment process in that.What Should Be code and Process to achieve this task.

For implement image gallery you can refer to this
Builng image gallery

Related

How could you do a Get Random to get images from a url?

I am making an application and I want one of the Fragments to have an ImageView and the image to be taken from a URL that connects to my VPS. I would like you to tell me how can I take a random url from the img folder of the url https://imagerandom.com/img (that url is an example) and project it to ImageView
Method 1
If you already have a bunch of images you can follow below steps:-
1)first import the all images in the file/code.
2)then store their names in the array or list of string/integer depending upon the name type.
3)then uses the random function to generate index of list/array.
4)then store the random index in some variable and you can use that to have a random images.
Method 2
On internet a lot of websites are available for generating random pictures
I used "picsum" and help me a lot in various web application for testing
Link for the site:-
https://picsum.photos/
hope you gonna love it !!

Android Studio Kotlin Refrofit - Distincby using

When I send the same multiple data over enter image description heredatabase, I want to separate them by size in the product details section. The same product name and product code comes line by line, but the only difference is the size and color codes. How can I separate the colors and sizes of the products that come with the same product name and code in the product detail section?
I heard about its distinctBy feature, can it work
My data;

How to save images by name as 1,2,3,....n in android

My app contains the camera functionality. I have develop the app.
As the app get starts one ListView of stations will popup(Like Station1, Station2,Station3....) & user has select one item from it. Then it will open the camera activity. So once the user took a picture, the image has to be stored like 'Station1_1', 'Station1_2', 'Station2_1', 'Station2_2' inside gallery. I have covered with the initial station name(Station1, station2..). But how do I store the last portion because it contains the sequence for each Station. So is there any way to save the images by 1,2,3....?
Thanks in advance.
There is a way but it isn't appropriate. If you just want to store each image having last portion is different then you can do in the following ways:-
You can call API for just handling counter.
You can store counter in PREFERENCE, but it won't work perfect if user clear data then new images were override old one.
You can store TIMESTAMP as end portion and it is appropriate way.

android comparing text to save image and send via bluetooth

i make a project for hearing impaired people ,where two devices are connected via bluetooth , its already working sending and receiving messages but what i want is when i type a text "hi" in a editext and when i click the send button the display would be the picture in a right(girl picture) but if that picture is not available display the second picture in left side(hand sign) , is this possible? can i compare the txt i type to the drawable folder image so that , that particular image will display?... ..
plz share ur idea....
Then you will need the following:
get the text (Hi) before displaying it, by getText
check the availability of the image either you want it to be available in phone 1 or phone 2 by this method
Sure it is possible to send an image via Bluetooth, also you can code it as this example
Also my opinion is to upload the image to the firebase or let it with your application if you need it for much use
Edit : compairing file name with string that you want is like is
boolean fileExists = new File("path/to/" + name + ".png").isFile();
where name if the chat message you want to compare and surely, that code occurs before the texts/images are displayed to the users

Android autofocus

I am new to android and just created an android application consisting of many images and a few buttons suppose like john, what I want is whenever a person clicks on john, all the images with names including john will get highlighted.
Thanks in advance.
for exmple of Jhon:
Just follow the steps:
1)setOnItemClickListener on images
from that you find all about the selected image throgh function get getResources()
you can fetch the name from that.
2)After fetchting the name fire one query like "selected name "
it should display result name "Jhon"
3)Display name picture as per your requirement.
or
4)If you want to display into the same you can
let me know if you have any query for it.

Categories

Resources