I’ve created a java application to be a go between for my c# app and talking with facebook.
This helper class allows me to get friendslists and post on a facebook wall.
I’ve recently had some issues trying to bind one of my java functions to monodroid.
The java function I’m using follows:
public void PostPicture(Activity mainActivity, String opponent, byte[] bytes, String picdescription, RequestListener listener)
{
Bundle params = new Bundle();
params.putString("name", picdescription);
params.putByteArray("source", bytes);
if(opponent != null)
{
params.putString("tags", opponent);
}
_asyncFacebook.request("me/photos", params, "POST", listener, null);
}
The issue I’m having is trying to bind the byte[] bytes.
JNIEnv.GetMethodID(_class_ref, “PostPicture”, “(Landroid/app/Activity;Ljava/lang/String;[Ljava/lang/Byte;Ljava/lang/String;Lcom/Hitcents/PictureThis/BaseRequestListener;)V”);
Where _class_ref is my fully qualified name to the java class that contains “PostPicture”.
Is [Ljava/lang/Byte not the correct binding to a byte[]?
I was able to answer my own question. By just passing the byte array through as a Ljava/lang/Object, I was then able to cast it to a byte[] on the java side.