Tag Archives: fieldTask

Connected Arabic fonts in Android 2.3

I’m working with a customer that is conducting a survey in Iraq using Samsung Galaxy Y Duos (android 2.3) and fieldTask. Later model phones (android 3+) worked well with Arabic but not these earlier versions. Even after rooting the phones and installing new fonts it still didn’t connect the characters.  See below a screen shot using Dr Ben Ox Arabic fonts which seemed to give the best results.
arabic2 (1)

Fortunately there is an Arabic reshaping library available from https://github.com/agawish/Better-Arabic-Reshaper/ which can be used with these old phones. I added ArabicReshaper.java and ArabicUtilities.java from this library to the odkCollect library that performs survey completion in fieldTask. I then modified the “QuestionWidget.java”, “SelectOneWidget.java” and “SelectMultipleWidget.java” files in odkCollect to call the “reshape” function when setting the text. See line 12 below.

[code language=”java” highlight=”11,12″]
protected void addQuestionText(FormEntryPrompt p) {
String imageURI = p.getImageText();
String audioURI = p.getAudioText();
String videoURI = p.getSpecialFormQuestionText(“video”);

// shown when image is clicked
String bigImageURI = p.getSpecialFormQuestionText(“big-image”);

// Add the text view. Textview always exists, regardless of whether there’s text.
mQuestionText = new TextView(getContext());
// mQuestionText.setText(p.getLongText()); smap
mQuestionText.setText(ArabicUtilities.reshape(p.getLongText())); // smap
mQuestionText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mQuestionFontsize);
mQuestionText.setTypeface(null, Typeface.BOLD);
mQuestionText.setPadding(0, 0, 0, 7);
mQuestionText.setId(QuestionWidget.newUniqueId()); // assign random id

// Wrap to the size of the parent view
mQuestionText.setHorizontallyScrolling(false);

if (p.getLongText() == null) {
mQuestionText.setVisibility(GONE);
}

// Create the layout for audio, image, text
mediaLayout = new MediaLayout(getContext());
mediaLayout.setAVT(p.getIndex(), “”, mQuestionText, audioURI, imageURI, videoURI, bigImageURI);

addView(mediaLayout, mLayout);
}
[/code]

This improved the display significantly:
SC20130708-172712

This Arabic version of fieldTask is available for download from http://dev/smap.com.au. There are other widgets that could have this functionality added and presumably the arabic text typed by an enumerator in a text field should also be reshaped. These additional changes will be made on an as needs basis. The preferred option is to get a phone that supports Arabic fonts natively which would be a better option than having to root the phones to install new fonts.

Announcement of Smap Release – April 2013

Dashboard panels are now only viewable by the user that created them.  No more sharing!  The concept of sharing all dashboard panels worked reasonably well when a project team was working collaboratively on a project.  But there were still issues, for example when a team member wanted to do some experimentation with graphs.  However there were significant problems during workshops when 30 odd people were creating and deleting panels independently and the system was trying to keep all of the panels in sync.   So I came to the conclusion that no-sharing is better than sharing everything.   If anyone has any ideas on how to introduce some managed sharing back in to the dashboard panels let me know.

You can now specify address fields from the previous survey in follow up tasks.  See picture below:

tasks

fieldTask works a little differently.  The menu option “get new forms” now goes direct to the server.  If you want to delete forms or data from the phone you will need to select “delete forms” from the main menu.  

Other changes:

  • More informative error messages when uploading templates
  • Surveys can be set in settings to automatically upload when they have been completed (with odk1.3)
  • In settings you can specify the use of forward and next buttons instead of swiping (with odk1.3)
  • Vertices of polygon questions are now shown on map panels.  Apart from allowing the user to look at question responses on each point of the polygon the display of these points make it easier to find small polygons on the map.  (This one for Mark)
  • The usual assortment of bug fixes