How to change picture in a telegram bot message? - java

I have a telegram bot, to create used library TelegramBots
Bot show post with text and image. The post looks like this:
When you press the inline buttons text of post changed (I used for this EditMessageCaption) , but I can not change the picture.
Does anyone know how to change the picture of message with image?

I found a solution, the picture can not be changed, but you can just paste the url into the text and change it.

Related

How to click on file-attachment icon using selenium (with java)?

I am creating automation that automatically sends messages through LinkedIn. The code is working fine, but as per our current requirement, I want to click on the attachment button so as to pass the attachment also with the text message. There are a few points that I have already tried:
Unable to fetch the element ID as its dynamic most of the time.
Don't want to use offsets (x,y) because once anyone changes the size of the window offsets changes.
Unable to use XPath.
Then I checked for another tool "UIVision" which makes a solution to capture that particular area (save it in a .png file) from the page where we want to click and during runtime it clicks there. So I tried searching image comparison API for java, tried with ASHOT and Sikulix too but none worked for me.
Anyone can help me with this?
When you say your unable to use xpath will you please elaborate?
The button has an id - it's attachment-trigger-ember1079.
If you're concerned about the latter part being dynamic, the attachment button also has a good title.
You can try using xpath string:
//button[contains(#title,'Attach a file')]
For me, on my linked in, this returns a unique hit on the expected attachment object:
If these don't work, there's also the option of using javascript to action the upload.
For more information on handling the upload dialog (after your identify the object) have a look here

Select and mark part of text in android

i want to select some part of the text from text view using long press and drag. Basically am looking for a functionality like android pdf reader text selection. how can i implement this? after select some text i need to highlight it (color change/underline etc) .When i again visit the same page, app should show the content like i previously highlighted.
I saw the textview.setTextIsSelectable(true) option,
when i use this i can select the text, whats next? is this the proper method for this kind of task ? please help.
You should use
textView.setSelection(startIndex, endIndex);
instead

how to get a blank canvas on which I can write using stylus

I am creating a service application where in the person who uses the service fills his data and signs it
Now I want to create a blank page where I can take the signature of the client on the TAB itself. So please help to do this.How can I implement it.
I have refereed to this http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Creating.html link but some how I am not able to work with it.
Please help.Thanks
You can do it using GestureOverlayView. Example in the links: http://www.intertech.com/Blog/android-gestureoverlayview-to-capture-a-quick-signature-or-drawing/
Specifically, create a GestureOverlayView in your layout xml file, then in your Activity class capture the gesture and save it as bitmap image.
Go through the developer API if you want to have specific function for your page, especially for events like Gesturing or Gesture Finish : http://developer.android.com/reference/android/gesture/GestureOverlayView.html
Hope that helps

Capturing and saving a screen shot

To save an image from the web in a folder?
I was thinking a behind the scenes screen shot or something. The image I am trying to get is at this link:
http://finance.yahoo.com/charts?s=CLF#chart5:symbol=clf;range=20010429,20040901;charttype=line;crosshair=off;ohlcvalues=0;logscale=on;source=undefined
Yahoo allows you to get just the chart of a specific symbol using something like this: http://chart.finance.yahoo.com/c/3m/d/msft , but i need to be able to specify the range of the chart.
Im looking for this to be done in java.
See this SO question: Convert web page to image
Search around for phrases like "render web page to image" - that should help you more than searching info about 'screenshots'.

Fill Android Facebook Dialog With App Data?

I've been working with the Facebook Android SDK for the past couple days, and while I have been able to post to my wall, one thing still stumps me: How can I fill the wall post dialog with information from my app?
For example, say you had an app that recorded hiking distance. When I launched the stream.publish dialog, I would want the text area under "What's on your mind?" to say something like "[User] hiked [distance] miles" instead of being blank.
I looked through the two samples included in the SDK, but neither address this. Is there a way to do this?
Thanks in advance!
I'm assuming you publish an attachment like - parameters.putString("attachment", publishingAttachment())
To add a message, just add the following line - parameters.putString("message", messageString);

Categories

Resources