NewStats: 3,261,381 , 8,173,850 topics. Date: Thursday, 29 May 2025 at 05:33 AM 312g3f6z3e3g |
Android Dictionary Application With Search Suggest And Text To Speech Feature (3140 Views)
(1) (Go Down)
nollyj2: 10:42am On Apr 12, 2015 |
In this android tutorial we are going to learn how to create an android dictionary application with Search Suggest and Text to Speech feature. The android application can be used in defining or words use in a particular field. You can found an example of Biology Dictionary I built in one of my apps in the Google Play Store. The app will consist of different words and their meaning. When a word is selected, it will display the definition or meaning of the word with an option to convert it to speech. The app will also has a search functionality with integrated search suggestion. When a type in two characters the search box will display all the words that contain the type in characters. If you still don't understand what search suggest means you can read my post on Android ListView with EditText Search Filter We will start by deg android SQLITE database that will house our data. There are different ways we can use to create our database. In this tutorial, I am going to use a SQLITE Manager to create and manager the database file. The database will be create using SQLite Expert Professional Manager which is a paid software but there are many free to use SQLite Manager you can get online and use. I will go ahead and create a database called dictionary. Now, we have to create a table inside our database called dictionary. The table will have three columns – id, word and meaning. The SQLite code for the table is shown below. Create Table [dictionary] ( Before we start, the first thing I will do is to list the environment and tools I used in this android tutorial but feel free to use whatever environment or tools you are familiar with. Windows 7 Android Studio Samsung Galaxy Fame Lite Min SDK 14 Target SDK 19 To create a new android application project, following the steps as stipulated below. Go to File menu Click on New menu Click on Android Application Enter Project name: AndroidDictionaryApplication Package: com.inducesmile.androiddictionaryapplication Keep other default selections. Continue to click on next button until Finish button is active, then click on Finish Button Once you are done with creating your project, make sure you change the package name if you did not use the same package. 1 Like |
ITbomb(m): 11:00am On Apr 12, 2015 |
Following
1 Like |
nollyj2: 9:08am On Apr 13, 2015 |
SQLITE Database We will start from the backend and build the application to finish. The first thing we will do is to create a folder called databases inside assets folder. Since we created our SQLite database file using SQLite database manager, we will drag and drop the file inside the databases folder and zip. We are preparing our database file this way since we are going to use a third party library called android sqlite asset helper. This library will help us to create and manage your database file. You can read more about this library here. The next to do is the import the library to our project. Since the library makes use of gradle, just open your build.gradle file and copy and paste the code below under the dependence section. compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' Now you can build your project and the library will be added automatically to your project. If you are using Eclipse for you android development, you can search on how to import library inside android project. We will go ahead with the SQLite database code now that we have finished setting up our database library. We will create three different files – DictionaryDatabase.java, DatabaseObject.java and DbBackend.java. The DictionaryDatabase java class will inherit from SQLiteAssetHelper which is a class from our imported library. We will define our database name and version. The version number is use to control our application database update. Whenever there is a change in the database file, the version number will be updated. The code sample is shown below. Copy and paste it to your project file. import android.content.Context; We are going to establish a connection for our database and return the instance of our database in DatabaseObject.java file. An instance of the DictionaryDatabase is created and the getReadableDatabase of the class is used to get the connection object. The getter and close methods in the class is used to return and close the database connection. The code for this class is shown below. import android.content.Context; |
(1) (Reply)
The Eight Levels Of Programmers
(Go Up)
Sections: How To . 16 Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland. |