Home

Javier Sánchez Hernández edited this page Jun 23, 2016 · 1 revision
Clone this wiki locally

Welcome to the accessibility-layer-sdk-java wiki!

How to use?

You just need to include the accessibility-layer-2.1.jar and the json-simple-1.1.1.jar libraries into your Java project.

Here you can find an example of use:

package com.example;

import eu.abletoinclude.al.AbleAccessibilityLayer;
import eu.abletoinclude.al.model.PictogramBase;

/**
 * Example class using the accessibility-layer-2.1 library.
 */
public class Example {
	
	/**
	 * Main method.
	 * @param args The arguments given to the method.
	 */
	public static void main(String[] args) {
		/*
		 * Create the AbleAccessibilityLayer object.
		 */
		AbleAccessibilityLayer ableAccessibilityLayer =
				new AbleAccessibilityLayer();
		
		/*
		 * Call to the getTextToPictograms method to get the pictogram list for
		 *  the given text.
		 */
		System.out.println("= Text to pictograms =");
		System.out.println(ableAccessibilityLayer.
				getTextToPictograms("The boy plays in the garden", "english",
						PictogramBase.sclera, true).toString());
		System.out.println();
		
		/*
		 * Call to the getTextToSimplifiedText method to get the simplified text
		 *  for the given text.
		 */
		System.out.println("= Text to simplified text =");
		System.out.println(ableAccessibilityLayer.
				getTextToSimplifiedText("The boy was playing in the garden when"
						+ " a van came up and hit him.", "english").toString());
		System.out.println();
		
		/*
		 * Call to the getTextToSpeech method to get the audio file 
		 * corresponding with the given text.
		 */
		System.out.println("= Text to speech =");
		System.out.println(ableAccessibilityLayer.
				getTextToSpeech("The boy plays in the garden", "english").
				toString());
		System.out.println();
	}
}