Android

Note

Over-the-air model downloads are not included on certain subscription plans. For more information on plans and pricing, visit our website.

After adding tags to models, you can query models in the Android SDK.

To fetch a list of managed models tagged “group-1” from our API:

Fritz.fetchManagedModelsByTags(new String[]{"group-1"}, new SearchModelTagsListener() {
   @Override
   public void onCompleted(List<FritzManagedModel> modelVersions) {
      // do something with the managed models
   }

   @Override
   public void onError() {
      // handle errors with the API
   }
});

To download a list of managed models with “group-1” and “group-2”:

// Models will be downloaded one at a time and stored on the device.
Fritz.loadOnDeviceModelsByTags(new String[]{"group-1", "group-2"}, new DownloadTaggedModelsListener() {
   @Override
   public void onCompleted(List<FritzOnDeviceModel> onDeviceModels) {
         Log.d(TAG, "READY TO USE MODELS: " + onDeviceModels.size());

         // From here, you can create interpreters for your models when you're ready to use them.
         FritzOnDeviceModel onDeviceModel = onDeviceModels.get(0);
         FritzTFLiteInterpreter interpreter = new FritzTFLiteInterpreter(onDeviceModel);
   }

   @Override
   public void onError() {
         Log.e(TAG, "Something went wrong loading the models");
   }
});