You can make use of the VK Android Sdk directly. I use VKShareDialog.
new VKShareDialogBuilder().setText("Title share")
.setAttachmentImages(new VKUploadImage[]{new VKUploadImage(bitmap, VKImageParameters.pngImage())})
.setAttachmentLink("Link title", myURL)
.setShareDialogListener(new VKShareDialog.VKShareDialogListener() {
public void onVkShareComplete(int postId) {
Toast.makeText(context, "Shared sucessfully", Toast.LENGTH_SHORT).show();
}
public void onVkShareCancel() {
Toast.makeText(context, "Share cancelled", Toast.LENGTH_SHORT).show();
}
@Override
public void onVkShareError(VKError error) {
Toast.makeText(context, "Failed to share", Toast.LENGTH_SHORT).show();
}
})
.show(activity.getSupportFragmentManager(), "VK_SHARE_DIALOG");
To post on the wall, you need some authorizations:
VKSdk.login(ActivityLogin.this,VKScope.FRIENDS,VKScope.WALL,VKScope.PHOTOS);