Gmail won't send attachment from my application on Android -
i trying add emailing capabilities android application. trying send file contains json string representing application data using action_send intent. problem on device, htc desire froyo, gmail sends actual email, not attachment, though see attachment when gmail app starts attached. however, on emulator, using default email application, works fine. works if using application such astro file manager send attachment directly sd card it's default suggested mime type. encountered similar? code looks this:
intent sendintent = new intent(intent.action_send); sendintent.settype("application/sal"); sendintent.putextra(intent.extra_subject, "shopping list"); log.d(tag, "attachment file: " + uri.parse("file:/" + filewithpath)); sendintent.putextra(intent.extra_stream, uri.parse("file:/" + filewithpath));
i have tried variety of mime types also, such application/json or text/plain same result.
apparently, there issue uri's starting file:// on gmail android, found recommendations regarding how handle attachments , files said content provider internal application, access file content should used. examples implementing can found in oi filemanager here , here. have looked on source code fore mentioned , tried implementing own content provider access file want attach, , worked. hope information helpful others may try this.
Comments
Post a Comment