How to show introscreens in android app when app is opened first time



To download app click on : Check out App


Custom In-App intro guide screens for Android :

Main idea behind in app intro guide screen is to make activity background transparent with some alpha and customizing look as you want.


Step 1 : Download Layout file : 


activity_introscreen.xml


Step 2: Edit your Manifest.xml file :


  <activity android:name=".IntroScreenActivity"

            android:theme="@style/Theme.Transparent"/>



Step 3 : Add code in res - styles.xml file


 <style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">

        <item name="android:windowIsTranslucent">true</item>

        <item name="android:statusBarColor">@android:color/transparent</item>

        <item name="android:windowBackground">@android:color/transparent</item>

  </style>


We are done with setting up introscreen you can run and see output and add which ever design you like.

You can finish introscreen activity once user clicks on it.

To make it more Cool :

You can add fade out animation on click of introscreen as follows :

Step 1: Create Animation file in anim package :fade_in.xml


<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android="http://schemas.android.com/apk/res/android"

           android:interpolator="@android:anim/accelerate_interpolator"

           android:fromAlpha="0.0" android:toAlpha="1.0"



           android:duration="500" />


Step 2: Create Animation file for closing effect : fade_out.xml


<?xml version="1.0" encoding="utf-8"?>

<alpha xmlns:android="http://schemas.android.com/apk/res/android"

           android:interpolator="@android:anim/accelerate_interpolator"

           android:fromAlpha="1.0" android:toAlpha="0.0"

           android:fillAfter="true"



           android:duration="500" />



Step 3: Add this code when starting your introscreen activity :


Intent i = new Intent(this, IntroScreenActivity.class);
startActivity(i);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);



If you want your introscreen to be only launched first time user opens app  you can use sharedPreference to store app opened status.

Download SharedPreference Util file :


SharedPreference.java

Copy paste code into your first homescreen Activity :


        SharedPreference spre=new SharedPreference(getApplicationContext());
        String show=spref.getData("IntroShown");
        if(show==null){
            Intent intent=new Intent(getApplicationContext(),IntroScreenActivity.class);
            startActivity(intent);
        }
        spref.setData("IntroShown","Yes");



Thank you
Share and Comment





Popup date picker or time picker dialog on click of edittext or any view in Android.




Simple Step by Step tutorial on adding DatePicker and TimePicker in Android :

Step 1 : Include Library in Apps "build.gradle"
compile 'com.wdullaer:materialdatetimepicker:3.0.0'


Step 2 : Declare and Initialize DatePicker and TimePicker :
        //Declaration of Datetimepicker and timepicker dialog
        TimePickerDialog tpd;
        DatePickerDialog dpd;

        //Definition of Datetimepicker and timepicker dialog place in onCreate()
        tpd = TimePickerDialog.newInstance(
                 new TimePickerListener(),
                now.get(Calendar.HOUR),
                now.get(Calendar.MINUTE),
                false
        );
        dpd = DatePickerDialog.newInstance(
                 new DatePickerListener(tv_event_date_from,tv_event_date_to),
                now.get(Calendar.YEAR),
                now.get(Calendar.MONTH),
                now.get(Calendar.DAY_OF_MONTH)
        );

       //To Open Datepicker dialog call this function as follows
       dpd.show(getFragmentManager(), "AnyTag");

       //To Open TimePicker dialog call this function as follows
       tpd.show(getFragmentManager(), "AnyTag");



Step 3 : Creating Listener
//Create a new Listener Class to manage clicks

import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;

public class DatePickerListener implements  DatePickerDialog.OnDateSetListener {

    TextView from,to;

    public DatePickerListener(TextView from, TextView to){
        this.from=from;
        this.to=to;
    }

    @Override
    public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
        String tag=view.getTag();
        
         if(tag.equals("from")){
            from.setText(year+"-"+(monthOfYear+1)+"-"+dayOfMonth);
            OrderHistoryActivity.datefrom=year+"-"+(monthOfYear+1)+"-"+dayOfMonth;
        }else{
            to.setText(year+"-"+(monthOfYear+1)+"-"+dayOfMonth);
            OrderHistoryActivity.dateto=year+"-"+(monthOfYear+1)+"-"+dayOfMonth;
        }
    }
}


//Create a new Listener Class to manage timepicker clicks

import com.wdullaer.materialdatetimepicker.time.TimePickerDialog;

public class TimePickerListener implements  TimePickerDialog.OnTimeSetListener {

    public TimePickerListener(){
    }

     @Override
    public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute, int second) {
        String format;
        if (hourOfDay == 0) {

            hourOfDay += 12;

            format = "AM";
        }
        else if (hourOfDay == 12) {

            format = "PM";

        }
        else if (hourOfDay > 12) {

            hourOfDay -= 12;

            format = "PM";

        }
        else {
            format = "AM";
        }

        String time = hourOfDay+":"+minute+":0"+second+" ";
 
    }
}


Thank You for your Visit +1 and Comment down.

Creating Shopping cart in android : Step by Step tutorial




Shopping Cart is most important feature of all Ecommerce Apps.
Here,
I introduce you with simplest and Customisable Shopping Cart System.

Following is Step By Step Details of implementation :

Step 1 : Create new Activity and Copy this into Layout file : activity_cart.xml

<RelativeLayout android:background="#e1e1e1"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout
        android:id="@+id/layout_total"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:padding="5dp"
        android:weightSum="2">
        <TextView android:gravity="end"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:text="Total : "
            android:textSize="20dp">
        </TextView>

        <TextView
            android:id="@+id/tv_total"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:text="0 Rs"
            android:textSize="20dp">
        </TextView>
    </LinearLayout>


    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_cart"
        android:layout_above="@+id/btn_placeorder"
        android:layout_below="@+id/layout_total"
        android:layout_height="match_parent"
        android:layout_width="match_parent">
    </android.support.v7.widget.RecyclerView>


    <Button
        android:id="@+id/btn_placeorder"
        android:layout_gravity="center"
        android:layout_alignParentBottom="true"
        android:layout_height="60dp"
        android:layout_width="match_parent"
        android:onClick="insertOrder"
        android:text="Place Order"
        android:textColor="@android:color/white"
        android:theme="@style/Theme.MaterialButton">
    </Button>

</RelativeLayout>



Copy button style into style.xml in res->val->style.xml

    <style name="Theme.MaterialButton" parent="AppTheme">
        <item name="colorAccent">@color/colorAccent</item>
        <item name="colorButtonNormal">@color/colorPrimaryDark</item>
        <item name="colorControlHighlight">@color/colorAccent</item>
    </style>

Download Images and Put it into your Drawable package :






Step 2 : Copy this into corresponding Java Activity File:



public class CartActivity extends AppCompatActivity {

    RecyclerView recycler_itemlist;
    public static TextView tv_total;
    CartListAdapter cartListAdapter;
    public static int total=0;
    String jsonCartList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cart);

        //Set back button to activity
        android.support.v7.app.ActionBar actionBar=getSupportActionBar();
        if(actionBar!=null){
            actionBar.setHomeButtonEnabled(true);
            actionBar.setTitle("Cart");
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }

        tv_total =(TextView) findViewById(R.id.tv_total);

        recycler_itemlist =(RecyclerView) findViewById(R.id.recycler_cart);
        recycler_itemlist.setHasFixedSize(true);
        recycler_itemlist.setRecycledViewPool(new RecyclerView.RecycledViewPool());
        recycler_itemlist.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL,false));
        recycler_itemlist.getRecycledViewPool().setMaxRecycledViews(0, 0);

        cartListAdapter = new CartListAdapter(CartActivity.this,ItemListAdapter.selecteditems);
        recycler_itemlist.setAdapter(cartListAdapter);

        getIntentData();

        calculateTotal();
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                // app icon in action bar clicked; goto parent activity.
                this.finish();
                return true;

            default:
                return super.onOptionsItemSelected(item);
        }
    }

    private void getIntentData(){
        if(getIntent()!=null && getIntent().getExtras()!=null){
           // Get the Required Parameters for sending Order to server.
        }
    }

    public static void calculateTotal(){
        int i=0;
        total=0;
        while(i<ItemListAdapter.selecteditems.size()){
            total=total + ( Integer.valueOf(ItemListAdapter.selecteditems.get(i).getRate()) * Integer.valueOf(ItemListAdapter.selecteditems.get(i).getQuantity()) );
            i++;
        }
        tv_total.setText(""+total);
    }

    public void insertOrder(View view){

            if(total>0){

            Gson gson = new Gson();
            jsonCartList = gson.toJson(ItemListAdapter.selecteditems);

            DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    switch (which){
                        case DialogInterface.BUTTON_POSITIVE:
                            //Yes button clicked
                            placeOrderRequest();
                            break;

                        case DialogInterface.BUTTON_NEGATIVE:
                            //No button clicked
                            break;
                    }
                }
            };

            AlertDialog.Builder builder = new AlertDialog.Builder(CartActivity.this);
            builder.setMessage("Do you want to place Order ?").setPositiveButton("Yes", dialogClickListener)
                    .setNegativeButton("No", dialogClickListener).show();

        }else{
                Toast.makeText(CartActivity.this,"No items in Cart !",Toast.LENGTH_LONG).show();
            }


    }


    private void placeOrderRequest(){
       //Send Request to Server with required Parameters
    /*
   jsonCartList - Consists of Objects of all product selected.
    */
    
    }

}


Include gson and retrofit api :


    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'





Step 3 : Copy model class required to capture all attributes of an Item/Product :




public class Item {

    public String ItemId;
    public String ItemName;
    public String Size;
    public String Company;
    public String Rate;

    public String getStatus() {
        return Status;
    }

    public void setStatus(String status) {
        Status = status;
    }

    public String Status;

    public String getQuantity() {
        return Quantity;
    }

    public void setQuantity(String quantity) {
        Quantity = quantity;
    }

    public String Quantity;

    public void setItemId(String ItemId){
        this.ItemId=ItemId;
    }
    public String getItemId(){
        return ItemId;
    }
    public void setItemName(String ItemName){
        this.ItemName=ItemName;
    }
    public String getItemName(){
        return ItemName;
    }
    public void setSize(String Size){
        this.Size=Size;
    }
    public String getSize(){
        return Size;
    }
    public void setCompany(String Company){
        this.Company=Company;
    }
    public String getCompany(){
        return Company;
    }
    public void setRate(String Rate){
        this.Rate=Rate;
    }
    public String getRate(){
        return Rate;
    }

    public String getJsonObject(){
        return "{ItemId:"+ItemId+",ItemName:"+ItemName+",Size:"+Size+",Company:"+Company+",Rate:"+Rate+"}";
    }
}




To create your custom Model class you can prefer my Automation Site :

Model Class Generator




Step 4 : Copy the Sole of Cart, Adding Items:


We need to copy this static List variable into List Adapter used to display our Item / Product

Just copy this line into Recycler or List Adapter so that 
Items can be added into this list and it can be accessed from any where.

 

public static List < item > selecteditems;




You can check if list already contains item to be added like this :


        if(ItemListAdapter.selecteditems.contains(itemobject)){
           //List already contains item
        }else{
            //List does not contains item you can add item here.
            ItemListAdapter.selecteditems.add(itemobject);
        }




Step 5 : Removing Items from Cart :



            ItemListAdapter.selecteditems.remove(item);
            cartListAdapter.notifyDataSetChanged();
            CartActivity.calculateTotal();





Thank You
Please Dont forget to Comment and +1 Post.



Automate update query in php mysql - Tool DataUpdater



Why ? DataUpdater ?

When you want to update a row in database.
For example, Consider your app or web has a User Profile Page and user can edit it when ever he wants.

In this case we will require php service to update specific record in database and if an extra column needs to be updated in future then we need to change our php service as well.

But using DataUpdater we can update columns dynamically without worrying about code.

So,

Lets use DataUpdater

DataUpdater accepts a unique primary key in your table and columns to update as input and updates that specific row. 


After successful execution of DataUpdater it will return status as output in JSON Array of Object format .


Download DataUpdater.php



How to use DataUpdater.php ?
Steps :


1. Just supply your database details into DataUpdater.php and copy DataUpdater.php into your xampp project.


2. Now DataUpdater is ready to run.


3. Now go to your Chrome browser in url section type following


http://localhost/YourProjectName/DataUpdater.php?table=YourTableName&KeyName=PrimaryKeyName&KeyValue=PrimaryKeyValue&ColumnName1=ColumnValue1&ColumnName2=ColumnValue2

Where,

ColumnName1,ColumnName2,..

Denotes column name to be updated in your table.

ColumnValue1, ColumnValue2,

Denotes Values that need to be assigned to specific column in table.


Note: 

There is no limit for ColumnName and Values you can update N number of Columns using DataUpdater.

Replace YourTableName with any table name in your database.

Replace YourProjectName with your project name or folder name.


Thank You
+1 Post and Comment

How to automate delete data from mysql table - DataDeleter.php



Why ? DataDeleter?

When you want to delete a row in database. 
For example, Consider you wanna delete a post created by user and he wishes it to be deleted, then we create PHP service that accepts post id from client and delete row matching that post id into table.

So, 
Why not automate these coding.
Here comes DataDeleter.

DataDeleter accepts a unique primary key in your table as input and delete that row.

After successful execution of DataPutter it will return status as output in JSON Array of Object format .



So, to download DataDeleter.php go to this link below :





How to use DataDeleter.php ?


Steps :


1. Just supply your database details into DataPutter.php and copy DataPutter.php into your xampp project.

2. Edit database details code to point to your database.

3. Now DataDeleter is ready to run.

4. Now go to your Chrome browser in url section type following :


http://localhost/YourProjectName/DataDeleter.php?table=YourTableName&KeyName=PrimaryKeyName&KeyValue=PrimaryKeyValue


Where,

PrimaryKeyName Denotes name of primary key column in your table.

PrimaryKeyValue 
Denotes value of primary key column in your table.


Example would be as follows :

http://localhost/YourProjectName/DataDeleter.php?table=tblTest&KeyName=UserId&KeyValue=22




Hope you like tutorial.
+1 Post and Comment your response


How to automate insert data into mysql table - DataPutter.php


Why ? DataPutter ?

When you create a registration form in Android or IOS. You ofcourse require a php service to store user data in database. 
In such situation we require to create a php file which will accept some parameters with get/post request and then store that data into database.

After successful execution of php service it will return status denoting success or failure.

So, 
Why not automate these coding.
Here comes DataPutter.

DataPutter accepts all column names and their value as parameter and automatically insert data into table you specify.

After successful execution of DataPutter it will return status as output in JSON Array of Object format as shown in image below :



In above image,

RowId : Denotes inserted row ID.


So, to download DataPutter.php go to this link below :


Download DataPutter.php



How to use DataPutter.php ?

Steps :

1. Just supply your database details into DataPutter.php and copy DataPutter.php into your xampp project.
2. Edit database details code to point to your database.
3. Now DataPutter is ready to run.
4. Now go to your Chrome browser in url section type following :

http://localhost/YourProjectName/DataPutter.php?table=YourTableName&ColumnName1=Value1&ColumnName2=Value2

Where,


ColumnName1, ColumnName2,... Denotes names of column in your table specified.


YourTableName Denotes your table name you want to insert data.



Note: 

Replace YourTableName with any table name in your database.
Replace YourProjectName with your project name or folder name.
5. You will get status data in json format.

Thank You
+1 Post and Comment



How to reset mobile online in Child mode and password protected in Redmi Mi or any mobile 100% working!











Got tired searching on Internet about this topic ?


And yet didnt found any solution ?



Here,

I introduce you with super amazing solution. 

But,

This solution will reset your complete mobile and make it fresh new....



This means all your apps installed will be cleared.

If your data and contacts are linked with gmail then,

Sit clam and don't worry they will be fine.


Solution Requires 2 Prerequisites :

1. The mobile you wanna format has to be connected to internet.

2. The mobile should be linked with your gmail.



 1. The mobile you wanna format has to be connected to internet.


Here there can be chance of your wifi enabled in your mobile and connected to a hotspot or any internet service.

If your mobile is not connected to internet then follow following instructions :

Check out this forum 

Go to Forum





2. The mobile should be linked with your gmail.

Its very important to have your gmail connected with your mobile other wise its very difficult to reset mobile.



Now lets rock with solution,


1. Open gmail in your computer / Desktop login with your account.


2. Now open new tab and go to www.google.com


3. Search Android Device Manager.


OR


Just

Follow this Link




In left panel there are 3 options


1. Play Sound - Plays your ringtone


2. Lock -Locks your Device 


3. Erase - Reset your mobile



 Click on Erase - your mobile will be Reset Completely 


Note : After you click on Erase your mobile will start erasing process and it will take some time don't press any button during process let it do its work !



Thank you

Found it helpful ? Comment and +1 Post using Google +









Automatic PHP code generator for insert or get data from mysql table ?



Hey,


I guess you have a mysql database and tables, So you need to create php services to get data and insert data into these table.

Its very easy with faster automation tool which will be discussed as follows.


Click on link

Visit Automation Tool



How does this automation tool work ?


1. It takes all column names in your single table as input.
2. It takes your table name.
3. Then it generates all corresponding JSON object (which can be used in model class generation ),
    It also creates PHP service to insert and get data from tables and display data in JSON array    
    format.

So lots of your struggle will be reduced and your time will be saved.


Thank you 
Like and Subscribe