Am developing an app that enables one to send images,audio and video through the internet. the person receiving this media files must have installed my app in his device.
What i can do right now is compress the image to be sent. i don't know where to start since most of the online tutorials are using intents to do this but i don't want to trigger another app to carry out the sending. my app should be able to do all this by itself.
this is how am compressing the image
public class ImageCompression extends AsyncTask<String, Void, String> {
private Context context;
private static final float maxHeight = 1280.0f;
private static final float maxWidth = 1280.0f;
public ImageCompression(Context context){
this.context=context;
}
@Override
protected String doInBackground(String... strings) {
if(strings.length == 0 || strings[0] == null)
return null;
return compressImage(strings[0]);
}
protected void onPostExecute(String imagePath){
// imagePath is path of new compressed image.
}