Tuesday, December 9, 2014

Dynamic Controls Creation in Android with validation of Child Views



Previous post with out validation

http://android-pratap.blogspot.in/2014/11/dynamic-controls-creation-in-android.html



DynamicFieldsActivity.java


package com.pratap.allsampleprojects;

import android.animation.LayoutTransition;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

public class DynamicFieldsActivity extends Activity {

EditText textIn;
Button buttonAdd;
LinearLayout container;
Button buttonShowAll;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dynamicfields);
textIn = (EditText) findViewById(R.id.textin);
buttonAdd = (Button) findViewById(R.id.add);
container = (LinearLayout) findViewById(R.id.container);

buttonAdd.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {

int val = Integer.parseInt(textIn.getText().toString());

for (int c = 1; c <= val; c++) {

LayoutInflater layoutInflater = (LayoutInflater) getBaseContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View addView = layoutInflater.inflate(
R.layout.dynamicrow, null);

container.addView(addView, 0);

}

}
});

LayoutTransition transition = new LayoutTransition();
container.setLayoutTransition(transition);

buttonShowAll = (Button) findViewById(R.id.showall);
buttonShowAll.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {

String showallPrompt = "";

int childCount = container.getChildCount();
showallPrompt += "childCount: " + childCount + "\n\n";

for (int c = 0; c < childCount; c++) {
View childView = container.getChildAt(c);

final EditText etText = (EditText) (childView
.findViewById(R.id.etname));

EditText etAge = (EditText) (childView
.findViewById(R.id.etAge));

RadioGroup radioSexGroup = (RadioGroup) childView
.findViewById(R.id.radioSex);

int selectedId = radioSexGroup.getCheckedRadioButtonId();

RadioButton radioSexButton = (RadioButton) childView
.findViewById(selectedId);

String name = (String) (etText.getText().toString());

String age = (String) (etAge.getText().toString());

String gender = (String) (radioSexButton.getText()
.toString());

etText.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable edt) {
if (etText.getText().length() > 0) {
etText.setError(null);
}
}

@Override
public void beforeTextChanged(CharSequence s,
int start, int count, int after) {
// TODO Auto-generated method stub

}

@Override
public void onTextChanged(CharSequence s, int start,
int before, int count) {
// TODO Auto-generated method stub

}
});

if (etText.getText().toString().length() == 0) {

etText.setError("Enter Name");

} else {

}

if (age.equals("")) {

etAge.setError("Enter age");

}

if (gender.equals("")) {

radioSexButton.setError("Enter Gender");

}

String childTextViewText = "";

childTextViewText += (String) (etText.getText().toString());

childTextViewText += (String) (etAge.getText().toString());

childTextViewText += (String) (radioSexButton.getText()
.toString());

showallPrompt += c + ": " + childTextViewText + "\n";
}

Toast.makeText(DynamicFieldsActivity.this, showallPrompt,
Toast.LENGTH_LONG).show();
}
});
}
}


Monday, December 8, 2014

Changes in Minimum wages rates w.e.f. Jan'2013 to present

Construction Labour
Sometimes states minimum wage rate is higher then that of center

If you are currently employed in Manufacturing industries/Construction companies who need general maintenance contracts for their jobs to be done, then its very important for them to have a knowledge of minimum wages to be paid to their labours and keep them self updated of the changes which happen periodically.
As of Central wage rate is concerned, it changes on April and October every year. with a gap of Six Months.

As of States are concerned, they have their own timing for the change but they also follow the same rule of center.
Right Now, as of center directives, every contract should have the price variation clause to enable the contractor to pay their labours as per minimum wage decided by government.This is called PVC clause.
Here I am giving you the links of Center and West Bengal Government circulars of minimum wage for a reference.

Center revision of Minimum Wage rate from April 2013 to March 2015


        Saturday, December 6, 2014

        Masha Search and Rescue Cheat

        Masha Search and Rescue Cheat - Unlimited Candies, all balloons unlocked.                               
        Masha Search and Rescue Cheat
        click on the image to see more screenshot

        LAST UPDATED ON DECEMBER 07, 2014

        OVERVIEW
          • Masha Search and Rescue Cheat - game save file with unlimited candies, all balloons unlocked.
          • Why game save? - game save file is the easiest and safest cheat method, you can update the game after applied this cheat.

        TESTED AND WORKS ON
          • Rooted Jiayu G5 phone
          • Masha Search and Rescue v1.1.1
          • Android 4.2.1

        WARNING!!!
          • This will remove your current progress!
          • Backup your game data
          • Root access is required

        LET'S DO IT
          • CLEAR Masha Search and Rescue game data.
          • Download save game file
          • Extract to /data/data/ 
          • Run your game and enjoy

        IMPORTANT!
          • How to CLEAR game data
          • How to extract game save to /data/data directory
          • How To Get Read Write Access To System Directory
          • How to backup game data
          • How to check root access on your device

        Apocalypse Knights Cheat

        Apocalypse Knights Cheat - game save file with game level 99, unlimited gems, honors and coins
        click on the image to see more screenshot

        LAST UPDATED ON DECEMBER 07, 2014

        OVERVIEW
          • Apocalypse Knights Cheat - game save file with game level 99, unlimited gems, honors and coins.
          • Why game save? - game save file is the easiest and safest cheat method, you can update the game after applied this cheat.

        TESTED AND WORKS ON
          • Rooted Jiayu G5 phone
          • Apocalypse Knights v1.0.8
          • Android 4.2.1

        WARNING!!!
          • This will remove your current progress!
          • Backup your game data
          • Root access is required

        LET'S DO IT
          • Clear Apocalypse Knights game data.
          • Download save game file
          • Extract to /data/data/ 
          • Run your game and enjoy

        Thursday, December 4, 2014

        Running Fred Cheat

        Running Fred Cheat - unlimited skulies and powers, all avatar and worlds unlocked, all skills unlocked and fully upgraded.
        click on the image to see more screenshot

        LAST UPDATED ON DECEMBER 05, 2014

        OVERVIEW
          • Running Fred Cheat - game save file with unlimited skullies and powers, all avatar and worlds unlocked, all skills unlocked and fully upgraded.
          • Why game save? - game save file is the easiest and safest cheat method, you can update the game via playstore, modded game apk is risky and may contain malicious code and cannot be updated.

        TESTED AND WORKS ON
          • Rooted Jiayu G5 phone
          • Running Fred v1.7.3
          • Android 4.2.1

        WARNING!!!
          • This will remove your current progress!
          • Backup your game data
          • Root access is required

        LET'S DO IT
          • Clear Running Fred game data.
          • Download save game file
          • Extract to /data/data/ 
          • Run your game and enjoy

        Tuesday, December 2, 2014

        Kidung online

        Karena sampai saat ini aplikasi Alkitab di Play Store masih dibanned, kami setim mengerjakan sesuatu yang lain. Akhirnya, kami mengupdate website kami, dan telah menambahkan menu kidung di dalamnya. Silakan lihat-lihat di www.bibleforandroid.com/songs


        Semua buku kidung yang ada di aplikasi Alkitab sudah tersedia di versi web. Bila anda klik salah satu buku kidung, maka akan muncul halaman di mana anda dapat memilih lagu dari daftar lagu yang tersedia, seperti gambar layar tembak di bawah ini.


        Pilih salah satu lagu, maka lagu tersebut akan ditampilkan. Anda dapat dengan mudah berpindah lagu dengan menggunakan dropdown menu navigasi di samping kiri. Kami juga mengajak anda untuk dapat berbagian melengkapi buku lagu dengan mengirimkan link youtube yang relevan, supaya pengguna juga lebih mudah dalam mempelajari lagu tersebut. Juga tersedia fasilitas search yang bisa anda gunakan untuk mencari isi teks/judul/nama pengarang.


        Monday, December 1, 2014

        The Battle Cats Cheats

        Unlimited XP, Unlimited Cat Food, All Characters Unlocked and Fully Upgraded.                                                                                                                                                             The Battle Cats Cheats
        The Battle Cats Cheatsclick on the image to see more screenshot

        UPDATED ON JULY 24, 2015

        DESCRIPTION
         • The Battle Cats game save file
         • 99999999 XP
         • 999999 Cat Food
         • All Characters Unlocked and Fully Upgraded
         • You can update the game after applied this cheat
         • Only work for rooted devices
         • Must be extracted using ES Explorer

        TESTED AND WORKS ON
          • The Battle Cats v3.0.0
          • Jiayu G5  |  Cooper i7 phones and several devices.
          • Android 4.2.1 | 4.4.2 | 4.4.4

        WARNING!!!
          • This will remove your current progress!
          • Backup your game data!

        LET'S DO IT
          • Force stop game [ Do NOT clear data ]
          • Download game save file | at the bottom of this page
          • Extract using ES Explorer to /data/data/ 
          • Overwrite existing file
          • Run your game and enjoy

        IMPORTANT!
          • How to download game save file
          • How to force stop and clear game data
          • How to extract game save to /data/data/
          • How to get access to /data/data/
          • How to backup game data
          • How to check root on your device
          • How to find bestselling product  ads