Monday 28 August 2017

Shared Preferences Example

      ----------- Shared Preferences Example----------





--------------Appcontroller class------------



package com.example.shirsh.shareprefeferenceexample;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import static android.content.pm.PackageManager.*;

/** * Created by androidsys1 on 3/31/2017. */
public class AppController extends MultiDexApplication {

    private static AppController mInstance;
    public static int invoiceId = 0;
    public static final String TAG = AppController.class.getSimpleName();

    public static synchronized AppController getInstance() {
        return mInstance;
    }

    @Override    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);

    }




    @Override    public void onCreate() {
        MultiDex.install(this);
        super.onCreate();
        mInstance = this;


    }

    public void handleUncaughtException(Thread thread, Throwable e) {
        e.printStackTrace();
    }

}






---------------SavedData class------------



package com.example.meenakshi.shareprefeferenceexample;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;



public class SavedData {

    private static final String SERVICE_ID = "service_id";
    private static final String Edittext1 = "edit_1";




    static SharedPreferences prefs;

    public static SharedPreferences getInstance() {
        if (prefs == null) {
            prefs = PreferenceManager.getDefaultSharedPreferences(AppController.getInstance());
        }
        return prefs;
    }


    public static String getServiceId() {
        return getInstance().getString(SERVICE_ID, null);
    }

    public static void saveServiceId(String service_id) {
        SharedPreferences.Editor editor = getInstance().edit();
        editor.putString(SERVICE_ID, service_id);
        editor.apply();
    }
public static String getEdittext1() {
        return getInstance().getString(Edittext1, null);
    }

    public static void saveEdittext1(String edit_1) {
        SharedPreferences.Editor editor = getInstance().edit();
        editor.putString(Edittext1, edit_1);
        editor.apply();
    }


}












---------------Splash Screen Activity-----------------


package com.example.meenakshi.shareprefeferenceexample;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class Main4Activity extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        if(SavedData.getServiceId()==null) {
            Intent intent = new Intent(Main4Activity.this, MainActivity.class);
            startActivity(intent);

        }
        else if(SavedData.getServiceId().equals("Activity1")) {
            Intent intent = new Intent(Main4Activity.this, MainActivity.class);
            startActivity(intent);

        }
        else if(SavedData.getServiceId().equals("Activity2")) {
            Intent intent = new Intent(Main4Activity.this, Main2Activity.class);
            startActivity(intent);

        }
        else if(SavedData.getServiceId().equals("Activity3")) {
            Intent intent = new Intent(Main4Activity.this, Main3Activity.class);
            startActivity(intent);

        }
        new Handler().postDelayed(new Runnable() {
            @Override            public void run() {

            }
        }, 2000);
    }
}


------------------MainActivity----------------

package com.example.meenakshi.shareprefeferenceexample;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import static com.example.meenakshi.shareprefeferenceexample.R.styleable.View;

public class MainActivity extends AppCompatActivity {
    EditText firsttext, secondtext, thirdtext, fourthtext;
    Button buttonfirstactivity;

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        firsttext = (EditText) findViewById(R.id.firsttext);
        secondtext = (EditText) findViewById(R.id.secondtext);
        thirdtext = (EditText) findViewById(R.id.thirdtext);
        fourthtext = (EditText) findViewById(R.id.fourthtext);
        Log.e("shish", "============");
        SavedData.saveServiceId("Activity1");

        buttonfirstactivity = (Button) findViewById(R.id.buttonfirstactivity);


        buttonfirstactivity.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View view) {

                Intent intent = new Intent(MainActivity.this, Main2Activity.class);
                SavedData.saveEdittext1(firsttext.getText().toString());
                startActivity(intent);
            }
        });
    }
}







----------------------Main2activity--------------------




package com.example.meenakshi.shareprefeferenceexample;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Main2Activity extends AppCompatActivity {
    EditText firsttext_secondact, secondtext_secondact, thirdtext_secondact, fourthtext_secondact;
    Button buttonfirstactivity_secondact;

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        String text = SavedData.getEdittext1();
        Log.e("shirsh","++++++++2");
        Log.e("", "==============" + text);
        SavedData.saveServiceId("Activity2");
        firsttext_secondact = (EditText) findViewById(R.id.firsttext_secondact);
        secondtext_secondact = (EditText) findViewById(R.id.secondtext_secondact);
        thirdtext_secondact = (EditText) findViewById(R.id.thirdtext_secondact);
        fourthtext_secondact = (EditText) findViewById(R.id.fourthtext_secondact);
         firsttext_secondact.setText(text);
        buttonfirstactivity_secondact = (Button) findViewById(R.id.buttonfirstactivity_secondact);
        buttonfirstactivity_secondact.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View view) {
                Intent intent = new Intent(Main2Activity.this, Main3Activity.class);
                startActivity(intent);
            }
        });

    }
}



Picasso image loading

                                                                   Picasso image loading



on Adapter---------




@Override   public void onBindViewHolder(MyViewHolder holder, final int position) {



holder.textnamenew.setText(clickCategoryListObject. getText());

//getNumber is  get from model 

    Picasso.with(context)
            .load(clickCategoryListObject.getNumber()).error(R.drawable.downloadfirst)
            .into(holder.nameTextView);


}

Wednesday 23 August 2017

LoginSignUP

-------------------------------LoginSignUP----------------------------------





--------------------------------------Manifest---------------------------------




<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"   
 package="com.example.meenakshi.loginsignupapi">
<uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application      
  android:name=".AppController" 
       android:allowBackup="true"  
      android:icon="@mipmap/ic_launcher" 
       android:label="@string/app_name"   
     android:supportsRtl="true"    
    android:theme="@style/AppTheme">
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SignupActivity"></activity>
    </application>

</manifest>





---------Appcontroller-----------------------


package com.example.meenakshi.loginsignupapi;

import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.text.TextUtils;

import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.Volley;

/** * Created by meenakshi on 8/23/2017. */
public class AppController extends MultiDexApplication {

    public static final String TAG = AppController.class.getSimpleName();

    private RequestQueue mRequestQueue;

    private static AppController mInstance;
    DiskBasedCache cache;

    @Override    public void onCreate() {
        super.onCreate();
        mInstance = this;
//        new LoginDataHelper(this);
//        new UserDetailDataHelper(this);   
     MultiDex.install(this);
        // Create global configuration and initialize ImageLoader with this config    
     }

    public DiskBasedCache getDiskCache() {
        if (cache == null) {
            cache = new DiskBasedCache(getExternalCacheDir(), 209715200);
        }
        return cache;
    }

    public static synchronized AppController getInstance() {
        return mInstance;
    }

    public RequestQueue getRequestQueue() {
        if (mRequestQueue == null) {
            mRequestQueue = Volley.newRequestQueue(getApplicationContext());
        }

        return mRequestQueue;
    }

    public <T> void addToRequestQueue(Request<T> req, String tag) {
        req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
        getRequestQueue().add(req);
    }

    public <T> void addToRequestQueue(Request<T> req) {
        req.setTag(TAG);
        getRequestQueue().add(req);
    }

    public void cancelPendingRequests(Object tag) {
        if (mRequestQueue != null) {
            mRequestQueue.cancelAll(tag);
        }
    }
}




---------------Helper-------------------

package com.example.meenakshi.loginsignupapi;

/** * Created by meenakshi on 8/23/2017. */public interface Helper {
    public void backResponse(String response);
}








----------JASONparser-----------------------



package com.example.meenakshi.loginsignupapi;

import android.content.Context;
import android.util.Log;

import com.afollestad.materialdialogs.MaterialDialog;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;


public class JSONParser {

    static InputStream is = null;
    static JSONObject jObj = null, response;
    static String json = "";
    private Context cx;

    // constructor     public JSONParser(Context cx) {
    this.cx = cx;
}



    // function get json from url   
 // by making HTTP POST or GET mehtod
    public static String convertInputStreamToString(InputStream inputStream)
            throws IOException {
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(inputStream));
        String line = "";
        String result = "";
        while ((line = bufferedReader.readLine()) != null)
            result += line;
        inputStream.close();
        return result;

    }

    public void parseVollyJSONObject(String url, int method, final JSONObject param, final Helper h) {
        //method GET=0,POST=1             /* String perameters;        if (param == null) {            perameters = null;        }        else {            perameters = param.toString();        }        */        if (method == 0 || method == 1) {
            final JsonObjectRequest jsObjRequest = new JsonObjectRequest
                    (method, url, param, new Response.Listener<JSONObject>() {

                        @Override                        public void onResponse(JSONObject response) {
                            //Log.e("Response: ", response.toString());                            if (response != null) {
                                h.backResponse(response.toString());

                            } else {
                                M.E("Something went wrong.!");
                            }
                        }

                    }, new Response.ErrorListener() {

                        @Override         
               public void onErrorResponse(VolleyError error) {
                            String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
                            h.backResponse("error");
                            Log.e("sdcard-err2:", err);
                            M.E("Something went wrong.!");
                        }
                    }) 
{
                @Override     
           public Map<String, String> getHeaders() throws AuthFailureError {
                    HashMap<String, String> headers = new HashMap<String, String>();
                    headers.put("Content-Type", "application/json; charset=utf-8");
                    return headers;
                }
            };

            jsObjRequest.setShouldCache(true);
            // Adding request to request queue   
         AppController.getInstance().
                    addToRequestQueue(jsObjRequest);
        } else {
            M.E("Invalid Request Method");
        }
    }

    public void parseVollyStringRequest(String url, int method, final Map<String, String> params, final Helper h) {
        //method GET=0,POST=1        if (NetworkUtil.getConnectivityStatus(cx)) {        if (method == 0 || method == 1) {
            final MaterialDialog materialDialog = M.initProgressDialog(cx);
            final StringRequest jsObjRequest = new StringRequest
                    (method, url, new Response.Listener<String>() 
{

                        @Override         
               public void onResponse(String response) {
                            //M.E("Response: " + response.toString());                            if (response != null) {
                                materialDialog.dismiss();
                                h.backResponse(response.toString());
                            } else {
                                M.E("Invalid Request Method");
                            }
                        }
                    }, new Response.ErrorListener() {

                        @Override   
                     public void onErrorResponse(VolleyError error) {
                            String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
                            materialDialog.dismiss();
                            h.backResponse("error");
                            M.E("sdcard-err2:" + err);
                            M.E("Something went wrong.!");
                        }
                    }) {
                @Override         
       protected Map<String, String> getParams() throws AuthFailureError {


                    //returning parameters        
                                return params;
                }
            };
            // Adding request to request queue    
        AppController.getInstance().addToRequestQueue(jsObjRequest);


        } else {
            M.E("Invalid Request Method");
        }
    }


public void parseVollyStringRequestWithautProgressBar(String url, int method, final Map<String, String> params, final Helper h) {
        //method GET=0,POST=1     
       if (NetworkUtil.getConnectivityStatus(cx)) {
        if (method == 0 || method == 1) {
//                final MaterialDialog materialDialog=M.initProgressDialog(cx);final StringRequest jsObjRequest = new StringRequest
        (method, url, new Response.Listener<String>() {
@Override                      
      public void onResponse(String response) {
        //M.E("Response: " + response.toString());    
    if (response != null) {
//                                    materialDialog.dismiss();     
   h.backResponse(response.toString());
        } else {
        M.E("Invalid Request Method");
        }
        }
        }, new Response.ErrorListener() {

@Overridepublic void onErrorResponse(VolleyError error) {
        String err = (error.getMessage() == null) ? "Parse Fail" : error.getMessage();
//                  materialDialog.dismiss();        h.backResponse("error");
        M.E("sdcard-err2:" + err);
        M.E("Something went wrong.!");
        }
        }) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {















        //returning parameters       
 return params;
        }
        };
        // Adding request to request queue    
    AppController.getInstance().addToRequestQueue(jsObjRequest);


        } else {
        M.E("Invalid Request Method");
        }
        } else {
//        M.T(cx, cx.getString(R.string.no_internet));        }
        }
        }






------------LoginActivity.Activity----------




package com.example.meenakshi.loginsignupapi;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class LoginActivity extends AppCompatActivity {
EditText Login_mobile_numberEt,Login_passwordEt;
    TextView Login_signupTv;
    Button Login_buttonBt;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        Login_mobile_numberEt=(EditText)findViewById(R.id.Login_mobile_numberEt);
        Login_passwordEt=(EditText)findViewById(R.id.Login_passwordEt);

        Login_buttonBt=(Button)findViewById(R.id.Login_buttonBt);
        Login_signupTv=(TextView)findViewById(R.id.Login_signupTv);
Loginmethod();

        Login_signupTv.setOnClickListener(new View.OnClickListener() {
            @Override            public void onClick(View view) {

                Intent intent=new Intent(LoginActivity.this,SignupActivity.class);
                startActivity(intent);
            }
        });
    }

    private void Loginmethod() {
        Log.e("Prams --- ","" + getPrams());
        new JSONParser(this).parseVollyStringRequest(WebServiceURL.URL.LOGIN, 1, getPrams(), new Helper() {
            @Override            public void backResponse(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);
                    if (jsonObject.getString("status").equals("200")) {
                        JSONObject data=jsonObject.getJSONObject("data");

                        finish();
                    }else {
//                        S.T(LoginActivity.this,"Enter a valid Mobile Number & Password");
                    }
                } catch (JSONException e) {
                    Log.e("","exception" + e);
                }
            }
        });

    }

    private Map<String, String> getPrams() {
        Map<String, String> param = new HashMap<String, String>();
        param.put("mobile", Login_mobile_numberEt.getText().toString());
        param.put("password", Login_passwordEt.getText().toString());
        return param;
    }
    @Override    public void onBackPressed() {
        //check if first fragment in wizard is loaded, if true get abandon confirmation before going back//        Intent intent=new Intent(LoginActivity.this,MainActivity.class);//        startActivity(intent);        finish();
    }
}







----------SignUpActivity.Activity-------------




package com.example.meenakshi.loginsignupapi;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class SignupActivity extends AppCompatActivity {
    EditText Signup_mobile_numberEt,Signup_password_numberEt,Signup_otp_numberEt;
    Button Signup_signupBt;
    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_signup);

        Signup_mobile_numberEt=(EditText)findViewById(R.id.Signup_mobile_numberEt);
        Signup_password_numberEt=(EditText)findViewById(R.id.Signup_password_numberEt);
        Signup_otp_numberEt=(EditText)findViewById(R.id.Signup_otp_numberEt);

        Signup_signupBt=(Button)findViewById(R.id.Signup_signupBt);
        Signup();


    }

    private void Signup() {
        Log.e("Prams --- ","" + getPrams());
        new JSONParser(this).parseVollyStringRequest(WebServiceURL.URL.SIGN_UP , 1, getPrams(), new Helper() {
            @Override            public void backResponse(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);
                    if (jsonObject.getString("status").equals("200")) {
                        JSONObject data=jsonObject.getJSONObject("data");

                        finish();
                    }else {
//                        S.T(LoginActivity.this,"Enter a valid Mobile Number & Password");
                    }
                } catch (JSONException e) {
                    Log.e("","exception" + e);
                }
            }
        });

    }

    private Map<String, String> getPrams() {
        Map<String, String> param = new HashMap<String, String>();
        param.put("mobile", Signup_mobile_numberEt.getText().toString());
        param.put("password", Signup_password_numberEt.getText().toString());
        param.put("otp", Signup_otp_numberEt.getText().toString());
        return param;
    }
    @Override    public void onBackPressed() {
        //check if first fragment in wizard is loaded, if true get abandon confirmation before going back//        Intent intent=new Intent(LoginActivity.this,MainActivity.class);//        startActivity(intent);        finish();
    }
}







-----------------M class---------------------





package com.example.meenakshi.loginsignupapi;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;


/** * Created by Sohel on 9/17/2015. */public class M {
    public static void I(Context cx, Class<?> startActivity, Bundle data) {
        Intent i = new Intent(cx, startActivity);
        if (data != null)
            i.putExtras(data);
        cx.startActivity(i);
    }

    public static void E(String msg) {
        Log.e("Log.E By Sohel ", msg);
    }


    public static void T(Context c, String msg) {
        Toast.makeText(c, msg, Toast.LENGTH_SHORT).show();
    }



    public static MaterialDialog initProgressDialog(Context c) {
        return new MaterialDialog.Builder(c)
                .title("Please wait...")
                .autoDismiss(false)
                .content("Wait for a moment.")
                .progress(true, 0)
                .show();
    }

    public static void share(Context c, String subject, String shareBody) {
        Intent sharingIntent = new Intent(Intent.ACTION_SEND);
        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
        sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
        c.startActivity(Intent.createChooser(sharingIntent, "Share via"));
    }
}





----------NeworkUtil---------------------







package com.example.meenakshi.loginsignupapi;
/** * Created by CRUD Technology on 8/22/2015. */
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.os.Build;

public class NetworkUtil {

    public static Boolean getConnectivityStatus(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Network[] networks = connectivityManager.getAllNetworks();
            NetworkInfo networkInfo;
            for (Network mNetwork : networks) {
                networkInfo = connectivityManager.getNetworkInfo(mNetwork);
                if (networkInfo.getState().equals(NetworkInfo.State.CONNECTED)) {
                    return true;
                }
            }
        } else {
            if (connectivityManager != null) {
                //noinspection deprecation         
       NetworkInfo[] info = connectivityManager.getAllNetworkInfo();
                if (info != null) {
                    for (NetworkInfo anInfo : info) {
                        if (anInfo.getState() == NetworkInfo.State.CONNECTED) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
}





------------WebServiceUrl--------------------




package com.example.meenakshi.loginsignupapi;

/** * Created by meenakshi on 8/23/2017. */public class WebServiceURL {
    public interface URL {
        public static String login_url = "http://bookmyservice.info/control/bookMyServiceApi/index.php/Webservice/";
        public static String signup_url = "http://bookmyservice.info/control/bookMyServiceApi/index.php/Webservice/";
        public static String host_url = "http://activegrowthinc.com/tiffin/Webservice/";

        public static String LOGIN = host_url + "login";
        public static String SIGN_UP = host_url + "signUp";
    }
}









----------activity_main.xml-------------






<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/activity_main"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context="com.example.meenakshi.loginsignupapi.LoginActivity">

   
    <LinearLayout      
  android:layout_width="match_parent"   
     android:layout_height="wrap_content"  
      android:orientation="vertical">
        <TextView
            android:layout_width="match_parent"  

          android:layout_height="match_parent"      
      android:text="Login page"        
    android:textSize="20sp"        
    android:gravity="center"/>
        <LinearLayout        
    android:layout_width="match_parent"     
       android:layout_height="wrap_content"       
     android:layout_marginTop="20dp"      
      android:orientation="vertical">
        <EditText         
   android:layout_width="match_parent"   
         android:layout_height="wrap_content"      
      android:textSize="16sp"       
     android:id="@+id/Login_mobile_numberEt"      
      android:hint="Mobile number"            />
            <EditText               
 android:layout_width="match_parent"  
              android:layout_height="wrap_content" 
               android:id="@+id/Login_passwordEt"

                android:textSize="16sp"           
     android:hint="Password"        
        />
            <Button            
    android:layout_width="match_parent"   

             android:layout_height="wrap_content"  
              android:layout_marginTop="20dp"       
         android:id="@+id/Login_buttonBt"       
         android:text="Login"                />
        </LinearLayout>
    </LinearLayout>
    <TextView
        android:layout_width="match_parent"  
      android:layout_height="wrap_content"    
    android:layout_alignParentBottom="true"   
     android:gravity="center"       
 android:textSize="18sp"      
  android:id="@+id/Login_signupTv"  
      android:text="You have no account! SignUP"/>
</RelativeLayout>








--------------activity_signup-----------


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
   xmlns:tools="http://schemas.android.com/tools"   
 android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"  
  android:paddingBottom="@dimen/activity_vertical_margin"   
 android:paddingLeft="@dimen/activity_horizontal_margin" 
   android:paddingRight="@dimen/activity_horizontal_margin" 
   android:paddingTop="@dimen/activity_vertical_margin">


    <LinearLayout      
  android:layout_width="match_parent" 

       android:layout_height="wrap_content"  
      android:orientation="vertical">

        <TextView        
    android:layout_width="match_parent" 
           android:layout_height="match_parent"
            android:gravity="center"      
      android:text="SignUp page"       
     android:textSize="20sp" />

        <LinearLayout       
     android:layout_width="match_parent"   
         android:layout_height="wrap_content"     
       android:layout_marginTop="20dp"        
    android:orientation="vertical">

            <EditText          
      android:id="@+id/Signup_mobile_numberEt"   
             android:layout_width="match_parent" 
               android:layout_height="wrap_content"    
            android:hint="Mobile number"             
   android:textSize="16sp" />

            <EditText          
      android:id="@+id/Signup_password_numberEt" 
               android:layout_width="match_parent"  
              android:layout_height="wrap_content"


                android:hint="Password"         
       android:textSize="16sp" />
            <EditText             
   android:id="@+id/Signup_otp_numberEt"     
           android:layout_width="match_parent"  
              android:layout_height="wrap_content"

                android:hint="OTP"        
        android:textSize="16sp" />

            <Button            
    android:id="@+id/Signup_signupBt"   
             android:layout_width="match_parent"  
              android:layout_height="wrap_content" 
               android:layout_marginTop="20dp"        
        android:text="Signup" />
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>





-------------build.gradle(app)2no.---------
apply plugin: 'com.android.application'
android {
    compileSdkVersion 26    buildToolsVersion "26.0.1"    defaultConfig {
        applicationId "com.example.meenakshi.loginsignupapi"        minSdkVersion 15        targetSdkVersion 26        versionCode 1        versionName "1.0"        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }
    buildTypes {
        release {
            minifyEnabled false    
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'    })
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'  
  testCompile 'junit:junit:4.12'




    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'  
  testCompile 'junit:junit:4.12'   
 compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
  compile 'com.google.code.gson:gson:2.3.1'   
 compile 'com.android.support:multidex:1.0.1'  
  compile 'com.afollestad.material-dialogs:core:0.9.0.1'
}

AutoComplete Address (Updated)

-------------------------------------Activity---------------------------------- package placeautocomplete.iteritory.com; import androi...