I am attempting to create an Android mobile application that can be used to
generate and display graphs and charts from CommCare application data
stored on the mobile device.
I am trying to query a CommCare app data repository by using an Android
ContentResolver.
Here is the code I have written to query the database:
···
-------------------------------
private static final String REPORT_INSTANCE_ID = "commcare:reports";
Cursor c = cr.query(Uri.parse("content://org.commcare.dalvik.case/fixturedb/" + fixtureId), null, null, null, null);
if (!c.moveToFirst()) {
return null;
}
return c.getString(c.getColumnIndex("content"));
}
I am not certain if the Uri I am using is correct but the Uri was recommended by a Dimagi employee. However, the ContentResolver always returns NULL when I perform a query.
Can anyone advise me on what I am doing wrong or assist me in resolving this issue.
Can you try that and see if it addresses the issue?
-Clayton
···
On Thu, Nov 23, 2017 at 2:11 AM, Faizel Faker wrote:
Hi Guys,
I am attempting to create an Android mobile application that can be used
to generate and display graphs and charts from CommCare application data
stored on the mobile device.
I am trying to query a CommCare app data repository by using an Android
ContentResolver.
Here is the code I have written to query the database:
private static final String REPORT_INSTANCE_ID = "commcare:reports";
Cursor c = cr.query(Uri.parse("content://org.commcare.dalvik.case/fixturedb/" + fixtureId), null, null, null, null);
if (!c.moveToFirst()) {
return null;
}
return c.getString(c.getColumnIndex("content"));
}
I am not certain if the Uri I am using is correct but the Uri was recommended by a Dimagi employee. However, the ContentResolver always returns NULL when I perform a query.
Can anyone advise me on what I am doing wrong or assist me in resolving this issue.