Size of Facebook Event Picture - java

I am trying to fetch the information of a facebook event using a request by the Facebook SDK for Android, but I am getting a small image. The fetching procedure is done as follows:
params.putString("fields", "id,name,picture");
mAsyncRunner.request("me/events",params, new RequestListener() {.....
But the link to the JPG image is very small. Is there any way to get a better resolution of this image?

Once you know the EVENT_ID for a particular event, you can send a graph request to "EVENT_ID/picture?type=SIZE" where SIZE=small | normal | large.

Related

Inserting an image into a Telegram bot message

i need help with sending the image along with the SendMessage entity.
I need help with sending the image along with the SendMessage entity. I tried to do it through markdown markup, but it doesn't work - the image is displayed as a preview and the link is also visible.
sendMessage.enableMarkdown(true);
sendMessage.setText("<image src=\"https://info-master.su/programming/web/html/images/images-in-html.jpg\" alt=\"Текст с описанием картинки\">")
result
https://disk.yandex.ru/i/8ibJJVBAaVNrUQ
how do I make exactly an embedded image, without a link, please help me

Facebook realtime api for feed

I have set up realtime feed update for user. So whenever a user comments or likes something, I get a update request from facebook.
{
object='user',
entry=[{
uid='1372299847',
id='1372299847',
time=1368760855,
changedFields=[feed]
}]
}
But this doesn't tell me what the update exactly was. I have to read that user's feed and see what is the new change and process it. If I get the id, then I can just request for that object and process it rather than reading his feed and getting the changes.
Is there any way to get what exactly was changed(id of the comment or status)?
Facebook doc says that you have to get the actual changeset via Graph API or FQL query. The notification you get tells you only the concerned user's ID.

Wrong picture on FB Wall, feed post from android app (android FB sdk)

I have a problem with Feed post Picture, we decided to change our (android native) FB App icon, so we changed this icon at all occurrences in FB app settings, and we changed the picture on ftp server(on which we refferenced when posting feed from app).
But when I post feed from app (in the feed dialog there is a correct picture), on wall in browser there is wrong(old) picture, weird is when I check my wall from katana(facebook android app), there is a correct picture. Size of picture is 512x512 and it's png format.
I'm talking about picture besides the feed (not small icon under feed)
Sample of feed post:
...
Bundle parameters = new Bundle();
parameters.putString("picture", path_tou_our_icon_on_ftp_server_in_png_fromat);
parameters.putString("name", facebookMsgName);
parameters.putString("caption", facebookMsgCaption);
parameters.putString("description", facebook_message);
parameters.putString("link", "http://bit.ly/....");
facebook.dialog(mInstance, "feed", parameters,....
Add "?cache=" + System.currentTimeMillis(); to your image URL posted to FB.
The reason for this is because facebook are probably caching your image. There are two solutions:
Give the new image a different name and update your code to use it. This will force facebook to use the new image, but it means you have to get a update for you app through the App Store, or
Wait for Facebook to update it's cache and start using the correct new image.

Accessing data to display as search results in Android app

I am developing an Android app which takes the current location of the user and displays a list of restaurants close to his/her location. The restaurants' data is available to me (i.e I do have the lat/long of each restaurant I want to display in the search results). I can't use Google Places API, because I need to show only those restaurants that are available in our database(in our website). My question is how do I access my database(or even an URL),which is on a computer, to extract the restaurants' data and display as search results in my android app?
I am actually making a Seamless ( http://bit.ly/Jp7pUN ) type application for my company.
I am a complete newbie to android app development. So, pardon me if this is really a very broad or a stupid question. Please just tell me what topics I need to study to implement this. I would study and do it myself.
Thanks.
You will need:
a Sqlite database to store the restaurants and their longitude/latitude
a MapView to display the map (Don't forget to register your Google Maps API key)
a map overlay to show the markers on the map
GPS access to get the user's location (needs the appropriate Android permission)
a simple search algorithm that retrieves a result set of restaurants within x distance of the user's location
EDIT
If your database is stored on a server, you will need a way to query the server, preferably using an HTTP-based protocol such as REST. It is useful (but not required) to cache the restaurant locations on the Android device (using Sqlite), in case the user is offline (The good news: Since you can use Java both on Android and the server, 90% of your data access layer you will only need to write once).
For the data transfer from server to the Android client, JSON is a popular format.
To acces database on your computer (not SQLite on Android) you should use url for your database server changing localhost to: 10.0.2.2. But in case your database will be on the Internet - you should create maybe some REST API to get the data you need. Then use HttpClient to fetch the data from server.
Everything that you need is in Developer Guide: MapView
And for retrieving current location I advice using MyLocationOverlay
For example (url to server):
//public static final String SERVER_ADDRESS = "http://10.0.2.2:3000"; // for localhost server
public static final String SERVER_ADDRESS = "http://railsserver.herokuapp.com"; //for remote server
Accessing data on your server - this depends on that how you implement (and using what thechnology) your server (REST API?, WebService?, Plain HTML?) and what will be the format of the response from server (JSON? XML?, etc.)
I suggest using JSON because it is easy to parse using included classes in Android SDK:
String json = execute(new HttpGet(Constants.SERVER_URL + "/fetchData"));
JSONObject responseJSON = new JSONObject(json);
if(responseJSON.has("auth_error")) {
throw new IOException("fetchData_error");
}

AJAX / Java persistence

I'm new to server side.
I'm creating a database app for my company that stores links to all our marketing videos. Each entry is a url(to video), description, industry etc.
I already have the front end somewhat set up in HTML/JavaScript. Using a local XML source file, it populates a list with video names, and has text fields for all props of the video item.
Here's my question:
How do I handle updating my view when I send the form data (new entry) to the back end?
Should I insert a new entry based on local data?
Should I wait for the response from the server, and if success then update view based on local data?
Or, same as above, but update view based on back end data?
The goal is to make sure my view always reflects the state of data on the back end.
(Back end is Java / Google App Engine)
When using AJAX:
There is a callback function included in it, which triggers asynchronously when the response of the request comes back from the server.
In this function you can call your page update functions to execute on the page updating processes.

Categories