Trouble with list adapters and images. Android - android

i need help with this wall i have hit inside my app. Basically i have a screen that needs to display 80 rows of information (scrollable listview type) however i need 2 different images (dependent upon data from the database);
like this (image edit; it wont let me post images so i'll ASCII draw it, prolly wont turn out right =) )
|img| | img 2 | Built String
|| |_____|
Where the first image is say like a picture of a person, the second image will be sorta like a progress bar made up 1 of 5 pictures (20% increments) and the text will be a string built from data.
I can get my listviews to display a built string perfectly but im having issues on the images. Anyway, ive searched and cant seem to find any information to help so if anyone is out there that can help me id appreciate it. Thanks.

You need to have a special xml layout file for the single row which then contains
all the <Image> tags for what you want.
Have a look at https://github.com/pilhuhn/ZwitscherA/blob/master/res/layout/tweet_list_item.xml for an example. This layout is then passed when setting the adapter as in https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TweetListActivity.java#L419

Related

How to show exact amount of Views?

Let I have some number n. It can be equal to any integer number ranged between 2 and 15,for example. And according to this number, I need to show n TextView's(orButtons). I need this concept for creating kind of 4 pic 1 word quiz game. As you know, in this game , if secret word is banana,then app create 6 places for each letter. And my question is what kind of concepts to use in order to solve this problem? My idea for solution was following: creating some view and add to this view a TextView n times. But I don't think that it is right way to do that. Can you tell me what I have to use in order to achieve my goal?
Loads of ways to achieve this:
You couid just create the placeholders you want in an XML Layout, I would of thought EditText with maxLength=1 and then use .setVisibility to show the ones you need depending on question;
You could use a loop to generate the number of elements you want. See
here for code example

Multiple images in edit text Android

I am trying to replicate the text message application of Android Application, where the requirement is to send multiple images in one message.
I am able to put one image in edit text field. However, I am not sure how we can put multiple images in edit text?
If it is not possible, what is the another way to do it?
Someone has mentioned in following link that need to use relative layout with gallery and textview.
How do I insert multiple image in Edit Text in android
Can anyone help me on this?
Thank you in advance.
You can use a
LayerDrawable
It is a Drawable that manages an array of other Drawables. These are drawn in array order, so the element with the largest index will be drawn on top.

xml for dropdown text

I have used this forum when I didn't know how to do something, but now I have decided to begin participating in it.
I would like to know how could I do a dropdown text (maybe it has a specific name and that's why I don't find any results on the internet). I mean, I have some tags in the screen (About, Company, Contact, ...). Each of these tags has a down arrow on the right side, and when I click it, it has to display (and hide if it's clicked again).
Here are the links with the images of what I want to do.
http://i45.tinypic.com/4fzoso.png
http://i47.tinypic.com/2u5886q.png
Thank you in advance!
You should use an ExpandableListView component.
There is a tutorial for it here.
Finally I did it with ImageViews and TextViews using the property android:visibility. Now that it's a static version is working properly. I hope that it continues working well when taking the information from the DB

How to add image multiple times in a layout?

I am new to this site. I am developing an application on Basic maths for Children .
In that app first i am showing simple calculator . Now I want to insert an image according to
the 1st of times, in next row image according to 2nd number . So like that I want to show as image wise also Basic Mathematics .
I am not getting how to do that can any one know how to do that or else give me some links to study
Please see the following links
http://developer.android.com/guide/topics/ui/overview.html
http://www.vogella.com/tutorials.html
Prevent asking questions repetively,
given the solution here :)
How to show same image multiple time in row?

Android : taking pictures and text from a website and putting them in a ListView

I have a very precise question:
I want to make an android application that can access this website http://www.cineklik.com/Showing-Now-Movies.aspx and then take the pictures of every movie in the Showing Now section and the title of this movie and put them both in a ListView (image on left and text on right or middle like in this example : http://blog.sptechnolab.com/2011/02/01/android/android-custom-listview-items-and-adapters/).
My main problem is that I don't know how to read data from this page because its source is very complex, so I need help for this particular issue most, but I would appreciate help on anything I can get !
Thanks.
in order to get a website's data you'll have to use an HTTPGet (if there is no API from that site). After that you'd be able to parse the response and use the data

Categories

Resources