• LETS BUILD AWESOME MOBILE APPS BY A SIMPLE WAY

    A write less, do more library for Android. Andbrain Engine makes your code more concise and development simpler by using annotation
    GET STARTED NOW

RECENTCOMPONENTS

validat

Andbrain Engine Validator

A simple library for validating user input in forms using annotations, you can validate all views at once and show feedback to user With one line of code or use
live validation  to  check user input as he moves between views with immediate feedback.
Some validation rules:
EmailValidator :
Ensures that the field does contain a email address. You can also define a regex to check for a particular domain name with the function
NotEmptyValidator :
Ensures that the field is not empty.
UrlValidator :
Ensures that the field is a valid url.
AlnumValidator :
Ensure that the feld has Alnum characters.
RegExpPattern :
Ensure that the field does match setted Pattern.
PhoneValidator :
Ensure that the field is a valid phone number.
NumericValidator :
Checks whether the field contains only numeric digits
Date:
checks that the field is a valid date/datetime format

@NotEmpty(messageId = R.string.validation_name, order = 1)
private EditText mNameEditText;
@RegExp(value = EMAIL, messageId = R.string.validation_valid_email)
private EditText mEditEmail;
@RegExp(value = "^[0-9]+$", messageId = R.string.validation_valid_count)
private EditText mEditCount;
injector

Andbrain Injector

Why do you bother with findViewById(R.id.someView)?Why do you need to find the view and store it into a variable in your class each and every time? Andbrain Injector is a simple, and powerful way to inject views,Intent extras and most important resource types into your classes automatically,its based on annotations. Most annotations will need only one parameter named value which can be a View id or a list of ids.
For Example:

public class TestActivity extends Activity {

    @InjectView(id = R.id.textView1)
    TextView textView;

    @InjectResource(id = R.drawable.icon)
    Bitmap iconBitmap;

    @InjectExtra(key = "color")
    String color;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Injector.injectInto(this);

        // textView, iconBitmap, and color are available now
    }
}
events

Andbrain Engine Events

Andbrain Engine Events its a android library based on annotations ,that eases the process of injecting InputEvents (OnClick,OnTouch,MotionEvent, KeyEvent,…) into your classes automatically.its provide Handlers that allow for special methods that will be called for specific events.
Some Events Annotations Examples :
@OnClick
This annotation will trigger an event when a View (for example, a Button) is clicked.
Example

@OnClick(R.id.button)
public void onClick() {
    Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
}

@OnItemClick(R.id.list)
This annotation will trigger an event when an AbsListView (ListView, GridView…​) item is clicked.

Example

@OnItemClick
public void onItemClick(int position) {
    Toast.makeText(this, "Item $position clicked", Toast.LENGTH_SHORT).show();
}

@OnFocusChanged
This annotation will trigger an event when a View receives or loses focus.
Example

@OnFocusChanged(R.id.my_view)
public void onFocusChanged(boolean hasFocus) {
    Toast.makeText(this, "View has focus: $hasFocus", Toast.LENGTH_SHORT).show();
}

@OnUIThread
This annotation will execute the code inside the method on the UI Thread using a Handler.

@OnUIThread()
public void getResult(Context context, boolean value){
    if(value == true) {
        Toast.makeText(context, "Result was: $value", Toast.LENGTH_SHORT).show()
    }
}

@OnBackground
This annotation will execute the code inside the method on a background Thread.
@OnEditorAction
This annotation will trigger an event when a TextView receives an action such as pressing ENTER key or a custom action on the keyboard.

Lets Build Awesome Mobile Apps By a Simple Way
GET STARTED NOW