How to put like using API from Vkontakte? part of the code that I have written:
final int item_id = 0; final String type = "post"; final String owner_id = "135088235"; final double vers = 5.60; final String sity = "https://vk.com/idcyperxaker?w=wall135088235_9347"; final VKApiPost post = new VKApiPost(); setLike("post", "135088235", post.id); public static String setLike(String type, String owner_id, int item_id ) { final String[] res = {""}; VKRequest request = new VKRequest("likes.add", VKParameters.from("type", type, "owner_id", owner_id, "item_id", item_id)); request.executeSyncWithListener(new VKRequest.VKRequestListener() { @Override public void onComplete(VKResponse response) { super.onComplete(response); try { JSONObject jsonObject = response.json.getJSONObject("response"); res[0] = jsonObject.getString("likes"); } catch (JSONException e) { e.printStackTrace(); }} }); return res[0]; }