So I after finishing up my school work, I began working on uploading the binary to the cloud and succeeded.
There’s a method flashBinaryFile that doesn’t seem to be used in the app, which allows me to upload the binary file from the app to the cloud for flashing (I think that’s how it works - not too sure, but it works).
new AsyncTask<Void, Void, String>(){
@Override
protected String doInBackground(Void... voids) {
if(command_format.get(0) == "flash"){
try{
InputStream stream = getResources().openRawResource(R.raw.firmware);
selected_device.flashBinaryFile(stream);
return null;
}
catch(IOException | ParticleCloudException e){
return e.getMessage();
}
}
else{
try {
Integer returnValue = device.callFunction("CloudCommand", command_format);
String result = returnValue.toString();
return result;
} catch (ParticleDevice.FunctionDoesNotExistException | ParticleCloudException | IOException e) {
return e.getMessage();
}
}
}
@Override
protected void onPostExecute(@NonNull String mst) {
Toaster.l(MainActivity.this, mst);
//etc.
}
}.execute();