我正在开发Android应用程序,其中SQlite作为数据库.我想以编程方式将我的Android应用程序数据库导出为excel文件格式,以便普通人可以轻松地读取他们的数据库.如果有可能请给我提示或不提示帮助我转换任何其他文件格式,如文本文件或其他.谢谢投票......
我是Realm集成的新手。我正在尝试将翻新的json响应保存到Realm数据库中。但我仍然困惑如何完成此任务以进行改装2。
我收到json响应,并根据RealM文档扩展了RealmObject类。但仍然没有获得将我的回应直接存储到领域中的好方法。
仪表板活动:
apiInterface = APIClient.getClient().create(APIInterface.class);
final Call<RealmList<ExampleTest>> call = apiInterface.getSurvay();
call.enqueue(new Callback<RealmList<ExampleTest>>() {
@Override
public void onResponse(Call<RealmList<ExampleTest>> call, Response<RealmList<ExampleTest>> response) {
resource = response.body();
Log.d(" response "," success ");
}
Run Code Online (Sandbox Code Playgroud)
API客户端:
{
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
retrofit = new Retrofit.Builder()
.baseUrl("** my URL **")
.addConverterFactory(GsonConverterFactory.create())
.client(client)
.build();
return retrofit;
}
Run Code Online (Sandbox Code Playgroud)
build.gradle:
compile ('com.squareup.retrofit2:retrofit:2.1.0') {
exclude module: 'okhttp'
}
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
Run Code Online (Sandbox Code Playgroud)
POJO类:
示例测试:
public class ExampleTest extends …Run Code Online (Sandbox Code Playgroud)