This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android number of packets

Hi,

I'm developing an Android application that uses Android DFU Library and I want to set the number of packets that are sent every notification interval to 1. I couldn't find an example of how this can be achieved.

The closest thing that I found is Android nRF Toolbox and it seems to save the value the user enters for Number of packets in shared preferences using a key named SETTINGS_NUMBER_OF_PACKETS that is defined in no.nordicsemi.android.dfu.DfuSettingsConstants. I couldn't find where this value is actually being used and simply saving on my app shared preferences with the same key and the value 1 is not doing the trick.

So, how can I reduce the number of packets in each notification interval to 1 using the Android DFU Library? Thanks for the help.

  • I've found how to solve this issue: you have to save the number of packets on your app shared preferences before starting the DFU upload.

    final SharedPreferences preferences = getSharedPreferences(getPackageName() + "_preferences", Context.MODE_PRIVATE);
    preferences.edit().putString(DfuSettingsConstants.SETTINGS_NUMBER_OF_PACKETS, "1").apply();
    
Related