Suppose,i want to write a word named "test" using gesture on the screen and then segment it as letters(t,e,s,t). I Google for it and not found any helpful link to write a word using gesture and then segment the letters from the word.Any helpful link or tutorial over this topic will be thankful..(Currently i do some code which only write a letter at a time,a word can't,and then how to segment this text i can't understand)
my code is
public class GestureTest extends Activity implements OnGesturePerformedListener {
private static GestureLibrary gesturerLib;
TextView showText1;
TextView showText2;
EditText firstEditText;
ArrayList<String> bindList;
ArrayList<Prediction> result;
ListView listViewShow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_gesture_test);
GestureOverlayView gestureOverLayerView = new GestureOverlayView(this);
//View inflate = getLayoutInflater().inflate(R.layout.activity_gesture_test,null);
View inflate = getLayoutInflater().inflate(R.layout.activity_gesture_test,null);
gestureOverLayerView.addView(inflate);
gestureOverLayerView.addOnGesturePerformedListener(this);
gesturerLib = GestureLibraries.fromRawResource(getApplicationContext(), R.raw.gestures);
if(!gesturerLib.load()){
finish();
}
setContentView(gestureOverLayerView);
}
@Override
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
// TODO Auto-generated method stub
showText1 = (TextView)findViewById(R.id.listView1);
result = gesturerLib.recognize(gesture);
String point=null;
String firstLetter=null;
StringBuffer sb = new StringBuffer();
String value1 = "";
if(result.size() > 0 && result.get(0).score>1.0){
value1 += result.get(0).name;
for(int j= 0;j< prescriptionNames.length;j++){
// prescriptionName is String[]
firstLetter = prescriptionNames[j];
Log.i("THE STRING[] VALUE",firstLetter );
if( firstLetter.startsWith(value1)){
showText1.setText(firstLetter);
}
}
}
for example link https://play.google.com/store/apps/details?id=com.visionobjects.stylusmobile.v3_2_store
i want to write word on screen with breaks example : write test on screen but i can write only t if i write second letter e , the first letter disappear.. that is the my problem
hope u can understand
please tell me it is possible or any wrong
In your activity:
In the XML you need to put this where you want to get the gestures recognized:
AND you need the library of gestures. Follow the first step of this tutorial: Android Gestures Tutorial