smiley with text message to be displayed in list view - android

How can i display smiley along with text message in listview. I am developing chat screen.i type message and i need to add smileys along with text. When i press enter button i need to display text and smiley in the above list view where i display list of messages. Please guide me in this.
some thing like Gtalk chat where we type message and we have an option to select smiley. when we select smiley corresponding special charcter will be displayed. I am able to show grid with smileys and when i select smiley i am able to display specialchatcter(statically) using the position of the smiley.
how can i display these special character and smileys from database. I am i need of help in this issue. Please guide me.
Thanks.
Regards,
Raghav

you used grid view for all smiley..you refer this this link see with multiple images

Use Spannable if you want to display text and images.

Related

Capture part of text from image and highlight captured text

I am new to android. My challenge is to create an application which captures part of text from image and highlight captured text.
Ex:
Right now getting below result by using sample
But i need result as
highlight phone number, email and website and need to capture those fields from image. Is it possible to navigate website when user click on highlighted part of website?
Please help me. Thanks in advance.
If you are using the above library
then you will get below function in CaptureActivity
boolean handleOcrDecode(OcrResult ocrResult) {}
in this function you can filter the text that you want from overall text.
After filtering the data show custom dailog with mobile number and email.
And make it email clickable so it will redirect the user to website.

android how to search contacts by input strings and display results in scrollable list like in the sms messages

I want to implement contacts search like we have in the build in SMS messages app, when you have a text box to enter the contact name and for each letter you insert , a scrollable list of contacts which thier name starts with the input text is displayed on screen, right under the text box. If you delete all input or can't find sutable contact then the list disappear.
When the user selects one of the list items then its full name is written in the text box.
What controls should I use to implement this behaviour? Would EditText and a regular ListView will do?
I couldn't find examples...
Please help, thanks
You can use addTextChangeListener in your EditText and search value from your listview.
This link can help you.

webserivce messages in listview with smileys

I am working on a chat application with smileys. I have a image button that shows a pop up of smileys in grid view when clicked. I can select any smiley in that and it will get displayed in Edit Text.
My problem is : Now i have smiley image and text in my edittext. when i click on send i need to display this message with smiley in listview. Is it possible to display images with text in listview where i get mesages from webservice.
List view is used here as a place to display messages from web service. How can i work further in this.
Please guide me in this issue.
Regards,
Raghav Rajagopalan
Is it possible to display images with text in listview where i get mesages from webservice.
Yes it is possible of course. If you are using some complex way to get the messages from the webservice into the adapter, you must integrate this with sending these to the adapter.
Is it possible to send images to webservice and fetch them back in my listview. I am using .Net web service. I return XML from web service as my response.
Don not do that. Put your smileys in drawable or download them only once. Use your own tags inside text for smileys. For example when string :) occurs put a smiley.
I created a Db and added 4 fields to it: ID , Position, Special Character, URL. So i was able to display the corresponding specialcharcter when clicked. When i submit how can i convert that specialcharcter into smiley image. I tried to use functions like "Contains()" and "Replace". But nothing worked when i submited the message to listview. I get the same specialcharcter and text. I don get the image instead of specialcharcter. Please guide me
I suppose you are inserting the message inside a textView. You can use to replace the occurances of the special character with "<img src=\"the source\" />"
Use this to get the image shown setText(Html.fromHtml("hi how are you <img src=\"yourimage.png\" />"));
To replace :) with <img src=\"yourimage.png\" />.. use yourString.replaceAll(":)","<img src=\"yourimage.png\" />");

emoticons in message on Android

I am developing a chat application(like Simple Gtalk) for android mobiles. I am facing few issues in display emoji's/emoticons.
I need to replace the special character to a emojis image. How can i do this?
I select Image from grid.
Display corresponding special character of image selected into Edit Text along with message i typed.
When i click on send button i need to display emojis/ emotions instead of special character in the above list view where i display all the messages i receive from .NET web service. These images(emojis) are stored in drawable folder.
I get these messages from web service. But I want to know how can I find and replace the special character with a emojis image along with my text message coming from web service.
I need to replace the special character to a emojis image
You can refer to Emoji Picker.
Display corresponding special character of image selected into Edit Text along with message i typed.
This has already been answered on SO
But i want to know how can i find and replace the special character with a emojis image along with my text message coming from web service.
Check the Unicode chart.

Select Text In Android

Is it Possible to Display some text say a story, in an ANDROID app which also enables the user to select some text and perform some operations on that text..
the main idea is to display some text and when the user selects some text(a word or a sentence) i need to get that text for some further operation on that text.
we cant use text view as you cant select text in textview,and we cant use editview because the user should not be able to edit the contents of the text.
Why not display the text in a WebView and enable text selection?
It works pretty well in CodePad, which is open source so you can have a look at the code here.
My first try would be to display this text in a normal TextView. Then I would provide two or three buttons to implement the selection of a part of the text. For example 1 Button to start and end selection and 2 Buttons with arrows for increasing/decreasing the part of the selection.
To highlight the part of the text which is selected, I would for example color this part of the text in a different color.
Coloring of text can be either done by using Spannable or the HTML class.

Categories

Resources