package com.sunil.hp.gjstatus.login_registration;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.percent.PercentLayoutHelper;
import android.support.percent.PercentRelativeLayout;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.sunil.hp.gjstatus.R;
import com.sunil.hp.gjstatus.forgotpassword.ForgotPasswordActivity;
import com.sunil.hp.gjstatus.helper.AppConfig;
import com.sunil.hp.gjstatus.preference.LoginPreference;
import com.sunil.hp.gjstatus.slidingmenu.SlidingmenuActivity;
import com.sunil.hp.gjstatus.utils.ApplicationSession;
import com.sunil.hp.gjstatus.utils.CircularProgressViewDialog;
import com.sunil.hp.gjstatus.utils.Constants;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import retrofit.Callback;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;
public class Login_RegistrationActivity extends AppCompatActivity implements View.OnClickListener {
String BASE_URL = "http://sktechnocast.com/";
private boolean isSigninScreen = true;
private TextView tvSignupInvoker, tvSigninInvoker, txt_forget;
private LinearLayout llSignin;
private Button btnSignup, btnSignin;
private EditText login_uname, login_pass;
private String el_uname, el_pass;
private Animation uptodown, downtoup;
private LinearLayout llSignup, llsignup;
private LoginPreference session;
private CircularProgressViewDialog circularProgressViewDialog;
private Context context;
private String user_id, user_name;
EditText edt_uname, edt_email, edt_pass, edt_conf_pass, edt_phone;
private String r_uname, r_phone, r_pass, r_conf_pass, r_email;
private ImageView upload_display_image;
private int PICK_IMAGE_REQUEST = 1;
private Bitmap bitmap;
private Uri filePath;
private String uploadImage;
private int flag = 0;
private LinearLayout ll_image_up, ll_down;
private String login = "Login";
private String Registration = "Registration";
private AdView adView;
private InterstitialAd mInterstitial;
private InterstitialAd mInterstitialAd;
private AdView adView_sineup;
private android.app.AlertDialog b;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login__registration_activity);
try {
getSupportActionBar().setTitle(login);
ActionBar mActionbar = getSupportActionBar();
mActionbar.setBackgroundDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.toolbar_baground, null));
if (Build.VERSION.SDK_INT >= 21) {
getWindow().setBackgroundDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.toolbar_baground, null)); //status bar or the time bar at the top }
/* * code for hiding keyboard for focus on username */ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
addbaner();
init();
listener();
} catch (Exception e) {
e.printStackTrace();
}
}
public void addbaner(){
try {
MobileAds.initialize(this,getResources().getString(R.string.addmob_app_id));
adView = (AdView) findViewById(R.id.adView);
adView.setAdListener(new AdListener()
{
public void onAdLoaded()
{
adView.setVisibility(View.VISIBLE);
}
});
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
}
catch (Exception e){
e.printStackTrace();
}
}
public void addbaner_sineup(){
try {
MobileAds.initialize(this,getResources().getString(R.string.addmob_app_id));
adView_sineup = (AdView) findViewById(R.id.adView_sineup);
adView_sineup.setAdListener(new AdListener()
{
public void onAdLoaded()
{
adView_sineup.setVisibility(View.VISIBLE);
}
});
AdRequest adRequest = new AdRequest.Builder().build();
adView_sineup.loadAd(adRequest);
}
catch (Exception e){
e.printStackTrace();
}
}
public void init() {
try {
llSignin = (LinearLayout) findViewById(R.id.llSignin);
llSignin.setOnClickListener(this);
llsignup = (LinearLayout) findViewById(R.id.llSignup);
llsignup.setOnClickListener(this);
tvSignupInvoker = (TextView) findViewById(R.id.tvSignupInvoker);
tvSigninInvoker = (TextView) findViewById(R.id.tvSigninInvoker);
llSignup = (LinearLayout) findViewById(R.id.llSignup);
llSignin = (LinearLayout) findViewById(R.id.llSignin);
//login page login_uname = (EditText) findViewById(R.id.login_uname);
login_pass = (EditText) findViewById(R.id.login_pass);
btnSignin = (Button) findViewById(R.id.btnSignin);
ll_image_up = (LinearLayout) findViewById(R.id.ll_image_up);
ll_down = (LinearLayout) findViewById(R.id.ll_down);
//sinup page
edt_uname = (EditText) findViewById(R.id.edt_uname);
edt_phone = (EditText) findViewById(R.id.edt_phone);
edt_pass = (EditText) findViewById(R.id.edt_pass);
edt_conf_pass = (EditText) findViewById(R.id.edt_conf_pass);
edt_email = (EditText) findViewById(R.id.edt_email);
upload_display_image = (ImageView) findViewById(R.id.iv_select);
btnSignup = (Button) findViewById(R.id.btnSignup);
txt_forget = (TextView) findViewById(R.id.txt_forget);
uptodown = AnimationUtils.loadAnimation(this, R.anim.uptodown);
downtoup = AnimationUtils.loadAnimation(this, R.anim.downtoup);
ll_image_up.setAnimation(uptodown);
ll_down.setAnimation(downtoup);
session = new LoginPreference(getApplicationContext());
if (session.isUserLoggedIn()) {
startActivity(new Intent(Login_RegistrationActivity.this, SlidingmenuActivity.class));
finish();
}
txt_forget.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
Intent i = new Intent(getApplicationContext(), ForgotPasswordActivity.class);
startActivity(i);
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
public void listener() {
try {
tvSignupInvoker.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
try {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
isSigninScreen = false;
showSignupForm();
flag = 2;
getSupportActionBar().setTitle(Registration);
addbaner_sineup();
} catch (Exception e) {
e.printStackTrace();
}
}
});
tvSigninInvoker.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
try {
isSigninScreen = true;
showSigninForm();
flag = 1;
getSupportActionBar().setTitle(login);
} catch (Exception e) {
e.printStackTrace();
}
}
});
showSigninForm();
btnSignin.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
try {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm.getActiveNetworkInfo() != null) {
el_uname = login_uname.getText().toString();
el_pass = login_pass.getText().toString();
if (login_uname.length() > 0 && login_pass.length() > 0) {
login_user();
} else {
if (el_uname.length() == 0) {
login_uname.requestFocus();
login_uname.setError("Enter User Name");
} else if (el_pass.length() < 5) {
login_pass.requestFocus();
login_pass.setError("Enter Password Must Be 5 char");
}
}
} else {
Toast.makeText(getApplicationContext(), "Turn On Your Internet Connection", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
btnSignup.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
try {
Animation clockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_right_to_left);
if (isSigninScreen)
btnSignup.startAnimation(clockwise);
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm.getActiveNetworkInfo() != null) {
r_uname = edt_uname.getText().toString();
r_phone = edt_phone.getText().toString();
r_pass = edt_pass.getText().toString();
r_conf_pass = edt_conf_pass.getText().toString();
r_email = edt_email.getText().toString();
if (edt_uname.length() > 0 && edt_phone.length() > 0 && edt_phone.length() == 10 && edt_pass.length() > 0 && edt_pass.length() >= 4 && edt_conf_pass.length() > 0 && edt_email.length() > 0 && isValidEmail(r_email)) {
if (edt_pass.getText().toString().equals(edt_conf_pass.getText().toString())) {
if (filePath != null) {
uploadImage = getStringImage(bitmap);
Register_database();
} else {
successDialog();
/* final AlertDialog.Builder alertDialog = new AlertDialog.Builder(Login_RegistrationActivity.this); alertDialog.setTitle("Alert"); alertDialog.setMessage("Please Select Image"); alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); alertDialog.show();*/ }
} else {
edt_conf_pass.requestFocus();
edt_conf_pass.setError("Password And Confirm Passsword Does Not Match ");
}
} else {
if (r_uname.length() == 0) {
edt_uname.requestFocus();
edt_uname.setError("Enter User Name");
} else if (r_phone.length() <= 0) {
edt_phone.requestFocus();
edt_phone.setError("Enter Phone Number");
} else if (r_phone.length() < 10) {
edt_phone.requestFocus();
edt_phone.setError("Enter Must Be 10 Digit");
} else if (r_pass.length() <= 0) {
edt_pass.requestFocus();
edt_pass.setError("Enter Password ");
} else if (r_pass.length() < 4) {
edt_pass.requestFocus();
edt_pass.setError("Enter Password Must Be 5 char");
} else if (r_conf_pass.length() <= 0) {
edt_conf_pass.requestFocus();
edt_conf_pass.setError("Enter Confirm Password");
} else if (!edt_pass.getText().toString().equals(edt_conf_pass.getText().toString())) //conform password velidation textviee nu id levu {
// else if (r_conf_pass.length() < 5) { edt_conf_pass.requestFocus();
edt_conf_pass.setError("Password And Confirm Password Does Not Match");
} else if (edt_email.length() <= 0) {
edt_email.requestFocus();
edt_email.setError("Enter Email");
} else if (!isValidEmail(r_email)) {
edt_email.requestFocus();
edt_email.setError("Enter valid Email");
}
}
} else {
Toast.makeText(getApplicationContext(), "Please Check Internet Connection", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
//display button selected Image======================
upload_display_image.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View arg0) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
}
});
//clode image code ==========================
} catch (Exception e) {
e.printStackTrace();
}
}
public void successDialog() {
final android.app.AlertDialog.Builder dialogBuilder = new android.app.AlertDialog.Builder(this);
LayoutInflater inflater = (this).getLayoutInflater();
View dialogView = inflater.inflate(R.layout.custom_dialog, null);
dialogBuilder.setView(dialogView);
dialogBuilder.setCancelable(false);
b = dialogBuilder.create();
b.show();
TextView tv_ok = (TextView) dialogView.findViewById(R.id.tv_ok);
tv_ok.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
finish();
b.dismiss();
}
});
}
@Override public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
private void showSignupForm() {
try {
PercentRelativeLayout.LayoutParams paramsLogin = (PercentRelativeLayout.LayoutParams) llSignin.getLayoutParams();
PercentLayoutHelper.PercentLayoutInfo infoLogin = paramsLogin.getPercentLayoutInfo();
infoLogin.widthPercent = 0.15f;
llSignin.requestLayout();
PercentRelativeLayout.LayoutParams paramsSignup = (PercentRelativeLayout.LayoutParams) llSignup.getLayoutParams();
PercentLayoutHelper.PercentLayoutInfo infoSignup = paramsSignup.getPercentLayoutInfo();
infoSignup.widthPercent = 0.85f;
llSignup.requestLayout();
tvSignupInvoker.setVisibility(View.GONE);
tvSigninInvoker.setVisibility(View.VISIBLE);
Animation translate = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_right_to_left);
llSignup.startAnimation(translate);
Animation clockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_right_to_left);
btnSignup.startAnimation(clockwise);
} catch (Exception e) {
e.printStackTrace();
}
}
private void showSigninForm() {
try {
PercentRelativeLayout.LayoutParams paramsLogin = (PercentRelativeLayout.LayoutParams) llSignin.getLayoutParams();
PercentLayoutHelper.PercentLayoutInfo infoLogin = paramsLogin.getPercentLayoutInfo();
infoLogin.widthPercent = 0.85f;
llSignin.requestLayout();
PercentRelativeLayout.LayoutParams paramsSignup = (PercentRelativeLayout.LayoutParams) llSignup.getLayoutParams();
PercentLayoutHelper.PercentLayoutInfo infoSignup = paramsSignup.getPercentLayoutInfo();
infoSignup.widthPercent = 0.15f;
llSignup.requestLayout();
Animation translate = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.translate_left_to_right);
llSignin.startAnimation(translate);
tvSignupInvoker.setVisibility(View.VISIBLE);
tvSigninInvoker.setVisibility(View.GONE);
Animation clockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_left_to_right);
btnSignin.startAnimation(clockwise);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override public void onClick(View v) {
if (v.getId() == R.id.llSignin || v.getId() == R.id.llSignup) {
// Toast.makeText(this, "clicked", Toast.LENGTH_SHORT).show(); InputMethodManager methodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
methodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
}
}
public void login_user() {
try {
final ProgressDialog loading = new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);
loading.setMessage("Loading");
loading.show();
loading.setCancelable(true);
loading.setCanceledOnTouchOutside(false);
RestAdapter adapter = new RestAdapter.Builder()
.setEndpoint(BASE_URL) //Setting the Root URL .build();
AppConfig.login_user api = adapter.create(AppConfig.login_user.class);
api.insertData(
login_uname.getText().toString(),
login_pass.getText().toString(),
new Callback<Response>() {
@Override public void success(Response result, Response response) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(result.getBody().in()));
String resp;
resp = reader.readLine();
Log.d("success", "" + resp);
JSONObject jObj = new JSONObject(resp);
int success = jObj.getInt("success");
if (success == 1) {
JSONArray j1 = jObj.getJSONArray("result"); //array object create thay te
for (int i = 0; i < j1.length(); i++) {
JSONObject obj = j1.getJSONObject(i);
user_id = obj.getString("user_id");
user_name = obj.getString("user_name");
}
loading.dismiss();
ApplicationSession.setToPreference(Constants.Preferences.PREF_LOGIN_DONE, true);
LoginPreference loginpreference = new LoginPreference(getApplicationContext());
loginpreference.set_login_value(user_id, user_name);
Intent in = new Intent(getApplicationContext(), SlidingmenuActivity.class);
in.putExtra("u_id", user_id);
in.putExtra("u_name", user_name);
startActivity(in);
finish();
} else {
loading.dismiss();
Toast.makeText(getApplicationContext(), "Your Username Or Password Is Invalid", Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
Log.d("Exception", e.toString());
} catch (JSONException e) {
Log.d("JsonException", e.toString());
}
}
@Override public void failure(RetrofitError error) {
Toast.makeText(Login_RegistrationActivity.this, "Check Your Internet Connection", Toast.LENGTH_LONG).show();
}
}
);
} catch (Exception e) {
e.printStackTrace();
}
}
//image feach from storeg media========================
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {
filePath = data.getData();
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
upload_display_image.setImageBitmap(bitmap);
bitmap = Bitmap.createScaledBitmap(bitmap, 250, 250, false);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public String getStringImage(Bitmap bmp) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT);
return encodedImage;
}
/*close image code===========================*/
public final static boolean isValidEmail(CharSequence uname) {
return !TextUtils.isEmpty(uname) && android.util.Patterns.EMAIL_ADDRESS.matcher(uname).matches();
}
public void Register_database() {
try {
final ProgressDialog loading = new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);
loading.setMessage("Loading");
loading.show();
loading.setCancelable(true);
loading.setCanceledOnTouchOutside(false);
RestAdapter adapter = new RestAdapter.Builder()
.setEndpoint(BASE_URL) //Setting the Root URL .build();
AppConfig.insert_record api = adapter.create(AppConfig.insert_record.class);
api.insertData(
edt_uname.getText().toString(),
edt_phone.getText().toString(),
edt_pass.getText().toString(),
edt_conf_pass.getText().toString(),
edt_email.getText().toString(),
uploadImage,
new Callback<Response>() {
@Override public void success(Response result, Response response) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(result.getBody().in()));
String resp;
resp = reader.readLine();
Log.d("success", "" + resp);
JSONObject jObj = new JSONObject(resp);
int success = jObj.getInt("success");
if (success == 1) {
loading.dismiss();
Toast.makeText(getApplicationContext(), "Successfully Registration", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), Login_RegistrationActivity.class));
finish();
} else {
loading.dismiss();
Toast.makeText(getApplicationContext(), "Your Mobile Already Registreed Plese Try Another Mobile", Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
Log.d("Exception", e.toString());
} catch (JSONException e) {
Log.d("JsonException", e.toString());
}
}
@Override public void failure(RetrofitError error) {
Toast.makeText(Login_RegistrationActivity.this, "Check Your Internet Connection", Toast.LENGTH_LONG).show();
}
}
);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override public void onBackPressed() {
try {
if (flag == 1) {
isSigninScreen = false;
showSignupForm();
flag = 0;
} else if (flag == 2) {
isSigninScreen = true;
showSigninForm();
flag = 0;
} else {
super.onBackPressed();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
=========================
package com.sunil.hp.gjstatus.helper;
import com.sunil.hp.gjstatus.model.model_category;
import com.sunil.hp.gjstatus.model.model_category_image;
import com.sunil.hp.gjstatus.model.model_festival_main_status;
import com.sunil.hp.gjstatus.model.model_festival_selectedall_status;
import com.sunil.hp.gjstatus.model.model_language;
import com.sunil.hp.gjstatus.model.model_selected_category_image;
import com.sunil.hp.gjstatus.model.model_single_category_status;
import com.google.gson.JsonElement;
import retrofit.Callback;
import retrofit.client.Response;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.POST;
public class AppConfig {
public interface display_versionupdate {
@GET("/android_liveapp/status/app_version_check.php")
void read_versionupdate (Callback<JsonElement> callback);
}
public interface login_user {
@FormUrlEncoded @POST("/android_liveapp/status/user_login.php")
void insertData(
@Field("user_name") String edt_username,
@Field("user_password") String edt_password,
Callback<Response> callback);
}
public interface insert_record {
@FormUrlEncoded @POST("/android_liveapp/status/user_registration.php")
void insertData(
@Field("user_name") String edt_uname,
@Field("user_mobile_no") String edt_phone,
@Field("user_password") String edt_pass,
@Field("user_confirm_password") String edt_conf_pass,
@Field("user_email") String edt_email,
@Field("user_image") String uploadImage,
Callback<Response> callback);
}
public interface insert_record_forget_password {
@FormUrlEncoded @POST("/android_liveapp/status/check_mobile_forgot.php")
void forget_password_insertData(
@Field("user_mobile_no") String edt_forget_number,
@Field("user_email") String edt_forget_email,
Callback<Response> callback);
}
public interface update_record_forget_new_password {
@FormUrlEncoded @POST("/android_liveapp/status/forgot_password.php")
void update_password_new_insertData(
@Field("user_mobile_no") String edt_forget_number,
@Field("user_email") String edt_forget_email,
@Field("user_password") String edt_forget_new_pass,
@Field("user_confirm_password") String edt_forget_confirm_pass,
Callback<Response> callback);
}
public interface read {
@GET("/android_liveapp/status/status_main_item_category.php")
void readData(Callback<model_language> callback);
}
public interface status_sub {
@FormUrlEncoded @POST("/android_liveapp/status/status_main_item_sub_category.php")
void status_sub_readal(
@Field("category_id") String category_id,
Callback<model_category> callback);
}
public interface status_sub_all {
@FormUrlEncoded @POST("/android_liveapp/status/status_all_sub_category.php")
void status_sub_all_readal(
@Field("sub_category_id") String category_id,
Callback<model_festival_main_status> callback);
}
public interface festival_all {
@FormUrlEncoded @POST("/android_liveapp/status/Status_main.php")
void festival_all_readal(
@Field("all_sub_category_id") String category_id,
Callback<model_festival_selectedall_status> callback);
}
public interface single_category_status {
@FormUrlEncoded @POST("/android_liveapp/status/status_single_category_add.php")
void single_category_status_readall(
@Field("sub_category_id") String category_id,
Callback<model_single_category_status> callback);
}
public interface status_single_add {
@FormUrlEncoded @POST("/android_liveapp/status/status_single_category_add.php")
void status_single_readal(
@Field("sub_category_id") String category_id,
Callback<JsonElement> callback);
}
public interface spin_language {
@POST("/android_liveapp/status/insert_status_laguage_select.php")
void spin_language_readal(Callback<JsonElement> callback);
}
public interface spin_get_id_language {
@FormUrlEncoded @POST("/android_liveapp/status/insert_spin_lanuage_idget.php")
void spin_subcategory_language_readal2(
@Field("category_name") String category_name,
Callback<JsonElement> callback);
}
public interface spin_get_fest {
@FormUrlEncoded @POST("/android_liveapp/status/insert_spin_subcategory_idget.php")
void spin_get_festival_ids(
@Field("category_id") String category_id,
@Field("sub_category_name") String sub_cat_name,
Callback<JsonElement> callback);
}
public interface spin_get_fest_sub {
@FormUrlEncoded @POST("/android_liveapp/status/insert_spin_festival_idget.php")
void spin_get_festival_sub_ids(
@Field("category_id") String category_id,
@Field("sub_category_id") String sub_cat_id,
@Field("all_sub_item") String all_item,
Callback<JsonElement> callback);
}
public interface spin_subcategory_language {
@FormUrlEncoded @POST("/android_liveapp/status/insert_spin_subcategory_selected_item.php")
void spin_subcategory_language_readal(
@Field("category_name") String category_name,
Callback<JsonElement> callback);
}
public interface spin_subcategory_festival {
@FormUrlEncoded @POST("/android_liveapp/status/insert_spin_subcategory_festival.php")
void spin_subcategory_festival_readal(
@Field("category_name1") String category_name1,
Callback<JsonElement> callback);
}
public interface status_add_festival {
@FormUrlEncoded @POST("/android_liveapp/status/insert_status_festiva_androidside.php")
void status_add_festival_insert(
@Field("user_id") String uname1,
@Field("user_name") String uname2,
@Field("category_name") String category_name,
@Field("sub_category_name") String category_name1,
@Field("all_sub_item") String category_name2,
@Field("add_status") String edt_status,
@Field("approve") String approve,
Callback<Response> callback);
}
public interface status_add_joke {
@FormUrlEncoded @POST("/android_liveapp/status/insert_status_joke_androidside.php")
void status_add_joke_insert(
@Field("user_id") String uname1,
@Field("user_name") String uname2,
@Field("category_name") String category_name,
@Field("sub_category_name") String category_name1,
@Field("single_status") String edt_status,
@Field("approve") String approve,
Callback<Response> callback);
}
public interface status_user_detail {
@FormUrlEncoded @POST("/android_liveapp/status/User_profile_display.php")
void status_user_detailread(
@Field("user_id") String user_id,
Callback<JsonElement> callback);
}
public interface update_user {
@FormUrlEncoded @POST("/android_liveapp/status/User_Update_profile.php")
void update_user_Data(
@Field("user_id") String user_id,
@Field("user_name") String edt_username,
@Field("user_mobile_no") String edt_mobile,
@Field("user_email") String edt_email,
@Field("user_image") String image,
Callback<Response> callback);
}
public interface update_user_without_imageselect {
@FormUrlEncoded @POST("/android_liveapp/status/User_Update_profile_without_select_image.php")
void update_user_without_imageselect_Data(
@Field("user_id") String user_id,
@Field("user_name") String edt_username,
@Field("user_mobile_no") String edt_mobile,
@Field("user_email") String edt_email,
@Field("user_image") String image,
Callback<Response> callback);
}
//image uplad
public interface spin_image_category {
@POST("/android_liveapp/status/image_spinner_upload_fetch_android_side.php")
void spin_spin_image_category_readal(Callback<JsonElement> callback);
}
public interface status_insert_image {
@FormUrlEncoded @POST("/android_liveapp/status/image_upload_user_android_side.php")
void status_insert_image_submit(
@Field("user_id") String uname1,
@Field("user_name") String uname2,
@Field("category_name") String category_name,
@Field("category_images") String uploadImage,
@Field("approve") String approve,
Callback<Response> callback);
}
// get image
public interface read_image {
@GET("/android_liveapp/status/image/displayAllretrofit_image_all.php")
void readData_image(Callback<model_category_image> callback);
}
public interface read_all_image {
@FormUrlEncoded @POST("/android_liveapp/status/image/display_select_status_image.php")
void readall(
@Field("category_idd") String id,
Callback<model_selected_category_image> callback);
}
}
Comments
Post a Comment