Para gerar o certificado Lets Encrypt é muito simples, aqui as instruções estão baseadas em um tutorial publicado pela Locaweb. (Web archive)
Primeiro vamos criar um diretório para isso:
| /** | |
| * Created by douglas on 02/05/16. | |
| */ | |
| public final class TooltipGenerator { | |
| private Activity activity; | |
| private Dialog dialog; | |
| private Context context; | |
| private List<SimpleTooltip> tooltips = new ArrayList<>(); |
| import android.graphics.Bitmap; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| /** | |
| * Created by douglas on 29/05/17. | |
| * Adapted from http://new-grumpy-mentat.blogspot.com.br/2014/06/java-escpos-image-printing.html | |
| */ |
Para gerar o certificado Lets Encrypt é muito simples, aqui as instruções estão baseadas em um tutorial publicado pela Locaweb. (Web archive)
Primeiro vamos criar um diretório para isso:
| package com.emil.android.util; | |
| import android.content.Context; | |
| import android.net.ConnectivityManager; | |
| import android.net.NetworkInfo; | |
| import android.telephony.TelephonyManager; | |
| /** | |
| * Check device's network connectivity and speed | |
| * @author emil http://stackoverflow.com/users/220710/emil |
| public class MyActivity extends Activity { | |
| public void onCreate(...){ | |
| RecyclerView rv = findViewByIdCast(R.id.rv); | |
| // 2 is the number of columns | |
| rv.setLayoutManager(new GridLayoutManager(this, 2)); | |
| // Calculates the width of the "CardView" dynamically. | |
| int cardViewWidth = getResources().getDimension(R.dimen.my_cardview_width) + getResources().getDimension(R.dimen.my_cardview_margin) * 2; | |
| rv.getViewTreeObserver().addOnGlobalLayoutListener(new OnFlowLayoutListener(rv, cardViewWidth)); | |
| } |
| import java.io.ByteArrayInputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileNotFoundException; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import okhttp3.MediaType; | |
| import okhttp3.RequestBody; | |
| import okio.BufferedSink; |
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.view.MotionEvent; | |
| import com.weiwangcn.betterspinner.library.material.MaterialBetterSpinner; | |
| /** | |
| * Created by Douglas Nassif Roma Junior on 30/09/15. | |
| */ | |
| public class CustomMaterialSpinner extends MaterialBetterSpinner { |
| package com.youtproject.util; | |
| import android.text.Editable; | |
| import android.text.TextWatcher; | |
| /** | |
| * Listener used to capture "on selected item" event on MaterialBetterSpinner. | |
| * Created by douglas on 22/09/15. | |
| */ | |
| public abstract class OnItemSelectedListener implements TextWatcher { |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.widget.FrameLayout; | |
| import java.util.ArrayList; | |
| import java.util.List; |
| <?php | |
| header('Content-Type: application/json'); | |
| header('Character-Encoding: utf-8'); | |
| // recebe os parâmetros | |
| $QTD = (int) filter_input(INPUT_GET, 'qtd', FILTER_VALIDATE_INT); | |
| $LAT = (float) filter_input(INPUT_GET, 'lat', FILTER_VALIDATE_FLOAT); | |
| $LNG = (float) filter_input(INPUT_GET, 'lng', FILTER_VALIDATE_FLOAT); | |
| if ($LAT && $LNG) { |