Showing posts with label listactivity. Show all posts
Showing posts with label listactivity. Show all posts

Sunday, April 15, 2012

version 3 of personalDictionary!

New version of PersonalDictionary, as promised with import/export function by using the SD Card.
What is new is that you can use with MultiLektor! you only have to copy the file exported by PersonalDictionary to the chapters directory of MultiLektor.

For export you have to go to the copy function, insert a name of the file and press Store, you will find this file inside the sd card in the folder of the app, the folder is named personalDictionary.

For import you have to insert the file inside the same folder and later, import by using the copy function again, but now inserting the name of the file (by hand) and pressing to export.

What you can do with MultiLektor is add new words some functions will be added during the next days (as modify, list, delete...)

Use PersonalDictionary to have access to your personal pocket dictionary where you can store as much words as you want with your own translation and access wherever you want. Now, moreover you can train and learn this words by using MultiLektor.

Still some functions are not developed but you can always open the dictionary files with any text reader for example notepad and modify the words, only try to follow the pattern:

original word=translated word
original word2=translated word2

you can insert sentences also!!!

market android (play)


Sunday, January 29, 2012

Android: creating and fullfilling a list

Sometimes, It is needed to update a list of elements, for example for an agenda, a list of things to buy, etc.


For create a list we have to add to our xml layout the following:

<ListView
android:id="@android:id/list"
android:layout_width="wrap_content"
  android:layout_height="wrap_content" >
</ListView>


and we can add entries by using code, for example the action fillData(), will take our own objects, in my case words and add them to the list by using an adapter.

private void fillData() {
     //db.open(); open the database
     words = db.fetchAllWords();
     ArrayAdapter<Word> adapter= new ArrayAdapter<Word>(this, R.layout.entry, R.id.text1, words);
    ListView lv = getListView();
    lv.setAdapter(adapter);
    //db.close();
}



your own objects, in my case Word needs to have overriten the toString method, the string that will be returned is the string used by the adapter, so the string which will be used for fullfill the list.

@Override
public String toString(){
     return a+" -> "+b;
}