Android Open Source - app_starter Functions






From Project

Back to project page app_starter.

License

The source code is released under:

GNU General Public License

If you think the Android project app_starter 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 appname.companyname.com.appname;
//from w  ww . ja  v  a2  s  .c o m
import android.content.Context;
import android.os.Build;
import android.widget.Toast;
 
public class Functions {
     
    private Context mContext;
     
    public Functions(Context context){
        this.mContext = context;
    }
    
    // Toast Message (Long)
    public void toast(String message) 
  {
    Toast.makeText(mContext.getApplicationContext(), message, Toast.LENGTH_LONG)
    .show();
  }
    
    // Get Device Information 
    public String getDeviceName() {
        String manufacturer = Build.MANUFACTURER;
        String model = Build.MODEL;
        if (model.startsWith(manufacturer)) {
          return capitalize(model);
        } else {
          return capitalize(manufacturer) + " " + model;
        }
      }
    
    // Capitalize
  public String capitalize(String text) {
    char first = text.charAt(0);
    if (text == null || text.length() == 0) {
        return "Unknow";
    }
    else if (Character.isUpperCase(first)) {
        return text;
    } else {
        return Character.toUpperCase(first) + text.substring(1);
    }
  }

    // Keydown

}




Java Source Code List

appname.companyname.com.appname.AppContent.java
appname.companyname.com.appname.ConnectionDetector.java
appname.companyname.com.appname.Error.java
appname.companyname.com.appname.Functions.java
appname.companyname.com.appname.MyActivity.java
appname.companyname.com.appname.Rateme.java
appname.companyname.com.appname.SplashScreen.java