У меня есть серверная часть в лазурном мобильном приложении.Версия ios работает нормально, но в Android я включил автономную синхронизацию, и она выдает эту ошибку «выбросить с нулевым исключением». Сначала я попробовал онлайн-загрузку.Данные поступают для каждого поля. Ниже приведен мой код. Пожалуйста, укажите, где я делаю ошибку.
try {
mClient = new MobileServiceClient(
"https://chenabclub.azurewebsites.net",
this).withFilter(new ProgressFilter());
mClient.setAndroidHttpClientFactory(new OkHttpClientFactory() {
@Override
public OkHttpClient createOkHttpClient() {
OkHttpClient client = new OkHttpClient();
client.setReadTimeout(20, TimeUnit.SECONDS);
client.setWriteTimeout(20, TimeUnit.SECONDS);
return client;
}
});
mToDoTable = mClient.getSyncTable("AppFoodMenu", AppFoodMenu.class);
initLocalStore().get();
refreshItemsFromTable();
}
Это мое локальное хранилище SQLiteLocalStore localStore = new SQLiteLocalStore (mClient.getContext (), "OfflineStore", null, 1);
Map<String, ColumnDataType> tableDefinition = new HashMap<String, ColumnDataType>();
tableDefinition.put("id", ColumnDataType.String);
tableDefinition.put("icode", ColumnDataType.String);
tableDefinition.put("ides", ColumnDataType.String);
tableDefinition.put("priceet", ColumnDataType.String);
tableDefinition.put("priceit", ColumnDataType.String);
tableDefinition.put("tax", ColumnDataType.String);
tableDefinition.put("rcode", ColumnDataType.String);
tableDefinition.put("ccode", ColumnDataType.String);
localStore.defineTable("AppFoodMenu", tableDefinition);
SimpleSyncHandler handler = new SimpleSyncHandler();
syncContext.initialize(localStore, handler).get();
Мой класс модели
public class AppFoodMenu {
@com.google.gson.annotations.SerializedName("id")
private String mId;
@com.google.gson.annotations.SerializedName("itemcode")
private String ICode;
@com.google.gson.annotations.SerializedName("ides")
private String Name;
@com.google.gson.annotations.SerializedName("priceet")
private String PriceET;
@com.google.gson.annotations.SerializedName("priceit")
private String PriceIT;
@com.google.gson.annotations.SerializedName("tax")
private String Tax;
@com.google.gson.annotations.SerializedName("rcode")
private String RCode;
@com.google.gson.annotations.SerializedName("ccode")
private String CCode;
@com.google.gson.annotations.SerializedName("unit")
private String Unit;
public AppFoodMenu() {
}