Android Open Source - verival-uiautomator String Getter






From Project

Back to project page verival-uiautomator.

License

The source code is released under:

GNU General Public License

If you think the Android project verival-uiautomator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package br.unb.vvs.uiautomator;
//from w  w  w . j  a v a  2s.c  o  m
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class StringGetter {  
    public static String getString(String property) {
      Properties props = new Properties();
      
      String language = java.util.Locale.getDefault().getLanguage();
      String contry = java.util.Locale.getDefault().getCountry();
      
      String fileName = "strings_" + language + "-" + contry + ".properties";
      
      File temp = new File("/data/local/tmp/" + fileName);
      InputStream input = null;
    
      try {
      input = new FileInputStream(temp);
      props.load(input);
    } catch (Exception e) {
      try {
        // Default .properties
        fileName = "strings_en-US.properties";          
          temp = new File("/data/local/tmp/" + fileName);
          input = new FileInputStream(temp);
        props.load(input);
      } catch (Exception e1) {
        System.out.println("Erro leitura do arquivo de propriedades default: " + e1.getMessage());
      }
      System.out.println("Erro leitura do arquivo de propriedades: " + e.getMessage());
    } 
      
      return props.getProperty(property);
    }
}




Java Source Code List

br.unb.vvs.uiautomator.StringGetter.java
br.unb.vvs.uiautomator.Test01_20minutesCall.java
br.unb.vvs.uiautomator.Test02_40SequencedCalls.java
br.unb.vvs.uiautomator.Test04_callEmergencyNumbers.java
br.unb.vvs.uiautomator.Test05_TurnOnOffAdapters.java
br.unb.vvs.uiautomator.Test06_Send100TextMessage.java
br.unb.vvs.uiautomator.Test07_SendVerifyEmail.java
br.unb.vvs.uiautomator.Test08_Add1000NewContacts.java