This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app/build.gradle | |
| apply plugin: 'io.fabric' | |
| check.dependsOn 'assembleDebugAndroidTest' | |
| android { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ImageSliderAdapter extends FragmentPagerAdapter { | |
| private final List<Fragment> fragmentList = new ArrayList<>(); | |
| public ImageSliderAdapter(@NonNull FragmentManager fm) { | |
| super(fm); | |
| } | |
| @Override | |
| public Fragment getItem(int position) { | |
| return fragmentList.get(position); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.graphics.Rect; | |
| import android.view.View; | |
| import android.view.inputmethod.InputMethodManager; | |
| public class KeyboardUtils { | |
| public static void hideKeyboard(Activity activity) { | |
| View view = activity.findViewById(android.R.id.content); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.vijay.backend; | |
| import android.app.AlertDialog; | |
| import android.app.Service; | |
| import android.content.Context; | |
| import android.content.DialogInterface; | |
| import android.content.Intent; | |
| import android.location.Location; | |
| import android.location.LocationListener; | |
| import android.location.LocationManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity; | |
| import android.app.Application; | |
| import android.content.pm.ActivityInfo; | |
| import android.content.res.Configuration; | |
| import android.os.Bundle; | |
| import androidx.annotation.NonNull; | |
| import androidx.annotation.Nullable; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static MapOrderDetail fromJson(String decoded) { | |
| Gson gson = new Gson(); | |
| Type type = new TypeToken<MapOrderDetail>() { | |
| }.getType(); | |
| return gson.fromJson(decoded, type); | |
| } | |
| public static String toJson(MapOrderDetail mapOrderDetail) { | |
| Gson gson = new Gson(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IntentIntegrator integrator = new IntentIntegrator(this); | |
| integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE); | |
| integrator.setPrompt("Scan a QR Code"); | |
| integrator.setBeepEnabled(true); | |
| integrator.setBarcodeImageEnabled(true); | |
| integrator.setOrientationLocked(true); | |
| integrator.initiateScan(); | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UploadImageASYNC extends AsyncTask<String, String, String> { | |
| private final ProgressDialog dialog = new ProgressDialog(UploadImageDashboard.this); | |
| @Override | |
| protected void onProgressUpdate(String... msg) { | |
| if (msg.length > 0 && msg[0].length() > 0) { | |
| this.dialog.setMessage(msg[0]); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static boolean isInternetAvailable(Context context) { | |
| ConnectivityManager conMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
| NetworkInfo netInfo = null; | |
| if (conMgr != null) { | |
| netInfo = conMgr.getActiveNetworkInfo(); | |
| } | |
| if (netInfo == null) { | |
| new androidx.appcompat.app.AlertDialog.Builder(context) | |
| .setTitle(context.getResources().getString(R.string.app_name)) | |
| .setMessage(context.getResources().getString(R.string.internet_error)) |
OlderNewer