I have looked at the Android wifi p2p API here and have taken a look at the sample code provided in "WiFiDirectActivity" which simply allows phones to transfer image files from one phone to another. The code they use for this is:
public void onClick(View v)
{
// Allow user to pick an image from Gallery or other
// registered apps
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, CHOOSE_FILE_RESULT_CODE);
}
I have changed it to the following with no Compiler errors:
public void onClick(View v)
{
// Allow user to pick an image from Gallery or other
// registered apps
ArrayList<String> deck = new ArrayList<String>();
deck.add("Lulz");
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("ArrayList<String>");
startActivityForResult(intent, CHOOSE_FILE_RESULT_CODE);
}
The problem is this transfer is only one way and it only transfers files whereas I would like to implement it into my pvp card game application code to transfer ArrayList objects BOTH ways. How can I do this?
Also how can I transfer the current "ArrayList deck" that I have instantiated there to begin with? I won't need to search, I'll know my ArrayList's name from inside the code.