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.
Related
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.
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
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
I want to add the countries and their corresponding States in android application locally, in such a way that when the user clicks on the country a dialog should come up and it should show a list of country names, and when the person selects a country, in the state dialog it should show the corresponding state names.
I have a list( in xml format ) for all the country and their states but i am unable to use them in my android app and also do not know the way how to use them.
Please help
you can do like wheel demo like iphone default spinner,
I have a link which has the same concept like you want. but yes it has not been entered all the list of country and their state. but on that you can find the way how to get it.
http://code.google.com/p/android-wheel/
For Country and it's state detail you have to find out in google that any default methods provides to get all countries and their states or otherwise you have to add it manually add it by country wise I have the link that has list of country and it's states.
http://en.wikipedia.org/wiki/List_of_countries_by_population
hope it will help you.
hi i would like to know solution for such a problem..... i have an xml file containing users data of around 1000 users listed out in alphabetical order. The xml file use to be as follow
<usersdata>
<user>
<id>1</id>
<firstname>A</firstname>
<middlename>AA</middlename>
......
......
</user>
<user>
<id>2</id>
<firstname>B</firstname>
<middlename>BB</middlename>
......
......
</user>
........
........
</usersdata>
Now from the above xml file i am parsing all the tags and storing them in an array list for each tag. I am listing out the Firstname in a listview, by array list of first name. When the any of the list is clicked, it opens up a new activity where the all other details of the selected name is been shown.
For example if third name in the list is clicked, by using its position(example 3), in the next activity i am listing out the third values stored in all the array lists i am using. This is what currently i am doing.
Now the problem is i have a edit box above the list view, named as a search box. If the letter S is typed in it, then all the names starting with S gets listed first. Opening the next activity by clicking the list now gets some wrong data, how to avoid this.
Please give me a suggestion....
For example if the first name C is clicked, it will be listed at position 3
There is a quick and dirty hack: you can store user id in the invisible field, retrieve it on click and use it as an argument for the second activity. I'm afraid I can't come up with better suggestions without seeing the code.
i tried out by setting some flag and by using an example code in developers site. And i am able to list out the data's but this idea does not full fill my apps requirement in the next activity. So i removed the search part in my app.
Sorry for posting such a question here......