Ver Mensaje Individual
  #1  
Antiguo 15-03-2016
wolfran_hack wolfran_hack is offline
Miembro
 
Registrado: abr 2013
Posts: 97
Reputación: 12
wolfran_hack Va por buen camino
Share Audio MP3

Básicamente tenemos un MP3 y queremos compartirlo en otra aplicación:

En Java es:

Código:
//en android
    //String sharePath = Environment.getExternalStorageDirectory().getPath() + "/Soundboard/Ringtones/custom_ringtone.ogg";
    //Uri uri = Uri.parse(sharePath);
    //Intent share = new Intent(Intent.ACTION_SEND);
    //share.setType("audio/*");
    //share.putExtra(Intent.EXTRA_STREAM, uri);
    //startActivity(Intent.createChooser(share, "Share Sound File"));
En Delphi:

Código Delphi [-]
con42 := TPath.GetDocumentsPath + PathDelim + 'archivo.mp3';

  Intent := TJIntent.Create;
  //Intent.setData(StrToJURI(con42));
  Intent.setAction(TJIntent.JavaClass.ACTION_SEND);
  Intent.setType(StringToJString('audio/*'));
  Intent.putExtra(TJIntent.JavaClass.EXTRA_STREAM,StringToJString(con42));
  MainActivity.startActivity(Intent);

Me deja compartir pero al seleccionar da error: "Fallo a compartir, intentelo nuevamente.."

Probe con:

Código Delphi [-]
intent.setType("audio/mpeg");

Código Delphi [-]
intent.setType("audio/mpeg3");

y tampoco funciona.

Ideas?
Responder Con Cita