This is how my asstes folder in android looks like. I am trying to get the path to the "19.png" inside assets. I will use this path in file creation as in new File("pathTo19.png")
. I tried variations of "android/assets/19.png"
, "assets/19.png"
etc but none worked. What is the path to the assets folder in libgdx project?
EDIT: I'm gonna use it in a MMS. Based on @Majid Daei Nejad answer I tried this. However, inside mms there is no image, just text and template image(not 19.png) so I'm guessing that the path is incorrect. The file path printed out is "file:/data/19.png"
.
FileHandle fh = Gdx.files.internal("data/19.png");
Intent sendIntent1 = new Intent(Intent.ACTION_SEND);
try {
sendIntent1.setType("text/x-vcard");
sendIntent1.putExtra("address","0475223091");
sendIntent1.putExtra("sms_body","hello..");
sendIntent1.putExtra(Intent.EXTRA_STREAM,
Uri.parse(fh.file().toURI().toURL().toString()));
System.out.println(fh.file().toURI().toURL().toString());
}
catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
context.startActivity(sendIntent1);