Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public double doCalories(boolean fem, boolean male, double age, double weight, double feet, double inches){
- DisplayDateTime = (TextView)findViewById(R.id.date_test);
- calander = Calendar.getInstance();
- simpledateformat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
- Date = simpledateformat.format(calander.getTime());
- DisplayDateTime.setText(Date);
- double bmrResult = 0;
- double height_in_inches;
- if (MainActivity.unit_is_gram){
- weight = weight * 2.2;
- }
- if (MainActivity.unit_is_meter){
- height_in_inches = 0.39370* inches; //actually is 0.39370 * centimeters
- }
- else height_in_inches = (feet*12)+inches;
- if (fem == true) {
- bmrResult = 10*(weight/2.2)+6.25*(height_in_inches*2.54)-5*age-161;
- }
- else if (male == true){
- bmrResult = 10*(weight/2.2)+6.25*(height_in_inches*2.54)-5*age+5;
- }
- return bmrResult;
- }
- private static final String DATABASE_NAME = "UserManager.db";
- // User table name
- private static final String TABLE_USER = "user";
- // User Table Columns names
- private static final String COLUMN_USER_ID = "user_id";
- private static final String COLUMN_USER_NAME = "user_name";
- private static final String COLUMN_USER_EMAIL = "user_email";
- private static final String COLUMN_USER_PASSWORD = "user_password";
- // create table sql query
- private String CREATE_USER_TABLE = "CREATE TABLE " + TABLE_USER + "("
- + COLUMN_USER_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + COLUMN_USER_NAME + " TEXT,"
- + COLUMN_USER_EMAIL + " TEXT," + COLUMN_USER_PASSWORD + " TEXT" + ")";
Add Comment
Please, Sign In to add comment